/* =============================================================================
   HIRA — app.css (clean, unified)
   - mode-app : UI normal (dashboard/users/login) — mockup style
   - mode-pdf : A4 sheet + PDF tables (hira_view / print)
   ============================================================================= */


/* =============================================================================
   1) VARIABLES
   ============================================================================= */

:root{
  /* App palette */
  --bg:#f3f6fb;
  --card:#ffffff;
  --ink:#0f172a;
  --muted:#64748b;

  --brand:#1e4b7a;
  --brand2:#14385d;

  --line:#e2e8f0;
  --line2:#e5e9f2;

  --shadow:0 6px 18px rgba(15,23,42,.08);
  --shadow-soft:0 2px 10px rgba(15,23,42,.05);

  --radius:14px;
  --radius-sm:10px;

  --container:1200px;
}


/* =============================================================================
   2) RESET / BASE
   ============================================================================= */

*{ box-sizing:border-box; }
html,body{ height:100%; }

body{
  margin:0;
  color:var(--ink);
  background:var(--bg);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, "Noto Sans", sans-serif;
}

a{ color:inherit; text-decoration:none; }
a:hover{ opacity:.96; }

h1,h2,h3,h4{ margin:0; }
p{ margin:0; }

.row{ display:flex; gap:10px; align-items:center; }
.row-between{ display:flex; justify-content:space-between; align-items:flex-start; gap:12px; }

.grid2{ display:grid; grid-template-columns:1fr 1fr; gap:14px; }
@media (max-width: 900px){ .grid2{ grid-template-columns:1fr; } }

.muted{ color:var(--muted); }

code{ font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; }


/* =============================================================================
   3) LAYOUT (APP)
   ============================================================================= */

.container{
  max-width: var(--container);
  margin: 18px auto;
  padding: 0 14px;
}

/* layout.php folosește <main class="container main"> */
.main{
  padding: 0;
}


/* =============================================================================
   4) APP MODE (default)
   ============================================================================= */

/* Topbar */
.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 12px 18px;
  background: linear-gradient(180deg, var(--brand), var(--brand2));
  color:#fff;
}

/* Brand text (simplu, ca mockup) */
.topbar .brand{
  font-weight:800;
  letter-spacing:.5px;
}

/* User box */
.user{
  display:flex;
  gap:10px;
  align-items:center;
}

/* Nav */
.nav{
  padding: 10px 18px;
  background: linear-gradient(180deg, var(--brand2), #0f2f4f);
}

.nav a,
.nav .navlink{
  color:#eaf2ff;
  margin-right:14px;
  font-weight:700;
  text-decoration:none;
}

.nav a:hover,
.nav .navlink:hover{
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Headings spacing (used in pages) */
h2{ font-size:28px; font-weight:800; margin-bottom:6px; }
h3{ font-size:18px; font-weight:800; margin-bottom:10px; }

/* Cards */
.card{
  background: var(--card);
  border: 1px solid var(--line2);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  margin: 18px 0;
}

/* Forms */
label{
  display:block;
  margin: 10px 0 6px;
  font-weight:700;
}

input, select, textarea{
  width:100%;
  padding: 10px 12px;
  border:1px solid var(--line);
  border-radius: var(--radius-sm);
  background:#fff;
  color: var(--ink);
  outline:none;
}

textarea{ min-height: 90px; }

input:focus, select:focus, textarea:focus{
  border-color:#94a3b8;
  box-shadow: 0 0 0 3px rgba(30,75,122,.10);
}

/* Table (Dashboard/Users look) */
.table{
  width:100%;
  border-collapse: collapse;
}

.table thead th{
  font-size:12px;
  font-weight:800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing:.06em;
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
}

.table tbody td{
  padding: 16px 12px;
  font-size:15px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.table tbody tr:last-child td{
  border-bottom:0;
}

.table tbody tr:hover td{
  background: #f7f9fd;
}

/* Buttons */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;

  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border:1px solid var(--line);

  background:#fff;
  color: var(--ink);
  font-weight:800;
  cursor:pointer;
  user-select:none;
}

.btn:hover{
  filter: brightness(.985);
}

.btn.primary{
  background: var(--brand);
  border-color: transparent;
  color:#fff;
}

.btn.small{
  padding: 8px 10px;
  font-size:13px;
  border-radius: 10px;
}

/* Open button = outline / pill-ish */
.btn.open{
  background:#fff;
  border:1px solid #dbe3f0;
  color:#0f172a;
  font-weight:800;
}

.btn.open:hover{
  background:#f3f6fb;
}

/* Badge */
.badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;

  padding: 4px 10px;
  border-radius: 999px;

  background:#eaf2ff;
  border:1px solid #cfe2ff;
  color: var(--brand);

  font-weight:900;
  font-size:12px;
}

/* Alerts */
.alert{
  padding: 10px 12px;
  border-radius: 10px;
  margin: 10px 0;
  border:1px solid var(--line);
  background:#f8fafc;
}

.alert-danger{
  background:#fee2e2;
  border:1px solid #fecaca;
  color:#7f1d1d;
}

/* Footer */
.footer{
  margin-top: 18px;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  background:#fff;
}


/* =============================================================================
   5) PDF MODE — exact look "foaie + tabel" ca în PDF
   ============================================================================= */

body.mode-pdf{
  background:#f3f3f3;
  color:#000;
  font-family: Arial, Helvetica, sans-serif;
}

/* în PDF mode: ascundem UI chrome */
body.mode-pdf .topbar,
body.mode-pdf .nav,
body.mode-pdf .footer{
  display:none !important;
}

/* în PDF mode: container full-width fără margini */
body.mode-pdf .container{
  max-width:none;
  margin:0;
  padding:0;
}

/* A4 sheet */
body.mode-pdf .sheet{
  background:#fff;
  width:210mm;
  min-height:297mm;
  margin:14px auto;
  padding:12mm;
  border:1px solid #333;
  box-sizing:border-box;
}

/* Mobile fallback */
@media (max-width: 980px){
  body.mode-pdf{ background:#fff; }
  body.mode-pdf .sheet{
    width:auto;
    min-height:auto;
    margin:0;
    border:0;
    padding:14px;
  }
}

/* PDF table styles */
body.mode-pdf .pdf-table{
  width:100%;
  border-collapse:collapse;
  font-size:14px;
}

body.mode-pdf .pdf-table td,
body.mode-pdf .pdf-table th{
  border:1px solid #333;
  padding:8px 10px;
  vertical-align:top;
}

body.mode-pdf .pdf-th{
  background:#d9d9d9;
  font-weight:700;
}

body.mode-pdf .pdf-title{
  text-align:center;
  font-weight:800;
  font-size:18px;
  letter-spacing:.2px;
}

body.mode-pdf .pdf-subtitle{
  text-align:center;
  font-weight:700;
  font-size:16px;
  margin-top:2px;
}

body.mode-pdf .pdf-muted{
  color:#333;
  font-size:12px;
}

/* în PDF mode: badge/button să fie simple (ca pe hârtie) */
body.mode-pdf .badge{
  border:1px solid #333;
  background:#eee;
  color:#000;
  border-radius:0;
  padding:2px 8px;
}

body.mode-pdf .btn{
  border:1px solid #333;
  background:#eee;
  border-radius:0;
  padding:6px 10px;
  font-weight:700;
}

body.mode-pdf .btn.primary{
  background:#ddd;
  color:#000;
}

/* în PDF mode: cardurile devin “blocuri simple” */
body.mode-pdf .card{
  border-radius:0 !important;
  box-shadow:none !important;
  border:1px solid #333 !important;
  background:#fff !important;
}

@media print{
  .no-print, .no-print *{
    display:none !important;
    visibility:hidden !important;
  }
}

