/* ════════════════════════════════════════════════════════
   POK 2026 – Design System v2
   Art BSA · Kulturno društvo BSA
   Poletni orkestrski kamp
   ════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400&display=swap');

/* ─── Tokens ─── */
:root {
  /* POK Brand */
  --pok-blue:        #1c86bf;
  --pok-blue-dark:   #1570a6;
  --pok-blue-light:  #e8f4fb;
  --pok-navy:        #0D1B2A;
  --pok-navy-mid:    #142333;
  --pok-orange:      #f46409;
  --pok-orange-dark: #d45500;
  --pok-red:         #EF4444;
  --pok-green:       #22C55E;
  --pok-green-dark:  #16A34A;
  --pok-amber:       #F59E0B;

  /* Surface */
  --bg:           #EFF3F8;
  --white:        #FFFFFF;
  --border:       #E2E8F0;
  --border-light: #F1F5F9;

  /* Text */
  --text:       #0F1923;
  --text-mid:   #4A5568;
  --text-light: #94A3B8;

  /* Sidebar */
  --sidebar-w: 235px;

  /* Radii */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-sm: 0 1px 4px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 14px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 28px rgba(0,0,0,0.09), 0 4px 8px rgba(0,0,0,0.04);

  --transition: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Reset ─── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  /* Padding will only be added via :has selector below */
}

/* Pages WITH sidebar get left padding */
body:has(.nav) {
  padding-left: var(--sidebar-w);
}

h1, h2, h3, h4 {
  letter-spacing: -0.25px;
}

a {
  color: var(--pok-blue);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover { color: var(--pok-blue-dark); }


/* ════════════════════════════════════════════════════════
   SIDEBAR  (class="nav")
   ════════════════════════════════════════════════════════ */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: var(--pok-navy);
  display: flex;
  flex-direction: column;
  z-index: 200;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.08) transparent;
}

/* ─── Sidebar brand (real anchor, clickable home link) */
.nav-brand {
  display: flex;
  align-items: center;
  padding: 0 1.1rem 0 3.2rem;
  min-height: 64px;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--white);
  text-decoration: none;
  letter-spacing: -0.3px;
  background-color: var(--pok-navy-mid);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%231c86bf' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpath d='M9 18V5l12-2v13'/%3E%3Ccircle cx='6' cy='18' r='3'/%3E%3Ccircle cx='18' cy='16' r='3'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 1.2rem center;
  background-size: 18px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  border-left: none;
  flex-shrink: 0;
  transition: background-color 0.15s ease;
  cursor: pointer;
}

.nav-brand:hover {
  background-color: rgba(28,134,191,0.18);
  color: var(--white);
}

.nav-brand:focus-visible {
  outline: 2px solid var(--pok-blue);
  outline-offset: -2px;
}

/* Override: nav-brand must not inherit .nav a styles */
.nav a.nav-brand {
  padding: 0 1.1rem 0 3.2rem;
  min-height: 64px;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--white);
  border-left: none;
  background-color: var(--pok-navy-mid);
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.nav a.nav-brand:hover {
  background: rgba(28,134,191,0.18);
  color: var(--white);
}

/* ─── Nav links */
.nav a {
  display: flex;
  align-items: center;
  padding: 0.55rem 1.15rem;
  color: rgba(255,255,255,0.58);
  font-size: 0.84rem;
  font-weight: 500;
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  gap: 0.5rem;
  line-height: 1.4;
}

.nav a:hover {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.9);
}

.nav a.active {
  background: rgba(28,134,191,0.18);
  color: var(--white);
  border-left-color: var(--pok-blue);
  font-weight: 600;
}

/* Separator spans → hidden */
.nav > span {
  display: none !important;
}

/* Section breaks between nav groups */
.nav a[href="projekti.php"] {
  margin-top: 0.5rem;
  border-top: 1px solid rgba(255,255,255,0.06);
  padding-top: 0.8rem;
}

.nav a[href="prijava-orkester.php"],
.nav a[href="prijava-zbor.php"] {
  margin-top: 0.25rem;
  border-top: 1px solid rgba(255,255,255,0.06);
  padding-top: 0.8rem;
}

/* External links */
.nav a[target="_blank"] {
  color: rgba(52,211,153,0.7) !important;
}
.nav a[target="_blank"]:hover {
  color: #6EE7B7 !important;
  background: rgba(52,211,153,0.06) !important;
}

/* Logout */
.nav a[href*="logout"] {
  margin-top: auto !important;
  margin-left: 0 !important;
  color: rgba(248,113,113,0.6) !important;
  border-top: 1px solid rgba(255,255,255,0.06);
  padding-top: 0.8rem;
}
.nav a[href*="logout"]:hover {
  background: rgba(248,113,113,0.08) !important;
  color: #FCA5A5 !important;
}

/* Sidebar footer tag */
.nav::after {
  content: 'Art BSA · Kulturno društvo BSA';
  display: block;
  padding: 0.75rem 1.15rem;
  font-size: 0.62rem;
  color: rgba(255,255,255,0.2);
  letter-spacing: 0.03em;
  flex-shrink: 0;
}


/* ════════════════════════════════════════════════════════
   LAYOUT
   ════════════════════════════════════════════════════════ */

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.75rem 2rem;
}


/* ════════════════════════════════════════════════════════
   PAGE HEADER  (.header)
   ════════════════════════════════════════════════════════ */

.header {
  background: var(--white);
  border-radius: var(--r-lg);
  padding: 1.4rem 1.75rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  text-align: left;
  border-bottom: 3px solid var(--pok-blue);
}

.header h1 {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 0.2rem;
}

.header p {
  font-size: 0.82rem;
  color: var(--text-mid);
  font-weight: 400;
}

.header a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  font-weight: 500;
}


/* ════════════════════════════════════════════════════════
   CARDS
   ════════════════════════════════════════════════════════ */

.card {
  background: var(--white);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  border: 1px solid var(--border);
}

.card h2 {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1.1rem;
  padding-bottom: 0.65rem;
  border-bottom: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.card h3 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-mid);
  margin-bottom: 0.75rem;
}


/* ════════════════════════════════════════════════════════
   STAT BOXES
   ════════════════════════════════════════════════════════ */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin: 1.25rem 0;
}

.stat-box {
  background: var(--white);
  border-radius: var(--r-lg);
  padding: 1.25rem 1.4rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  border-left: 4px solid var(--pok-blue);
  transition: transform var(--transition), box-shadow var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-box:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-box h3 {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
  margin-bottom: 0.3rem;
  font-family: 'Inter', sans-serif;
  letter-spacing: -0.5px;
}

.stat-box p {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  line-height: 1.3;
}

.stat-box.gold {
  border-left-color: var(--pok-orange);
}
.stat-box.gold h3 {
  color: var(--pok-orange-dark);
}

.stat-box.dark {
  background: var(--pok-navy);
  border-color: var(--pok-navy);
  border-left-color: var(--pok-blue);
}
.stat-box.dark h3 { color: var(--white); }
.stat-box.dark p  { color: rgba(255,255,255,0.45); }

.stat-box.green  { border-left-color: var(--pok-green); }
.stat-box.purple { border-left-color: #8B5CF6; }
.stat-box.red    { border-left-color: var(--pok-red); }
.stat-box.teal   { border-left-color: #14B8A6; }


/* ════════════════════════════════════════════════════════
   TABLES
   ════════════════════════════════════════════════════════ */

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.84rem;
}

table th {
  background: #F8FAFC;
  color: var(--text-mid);
  padding: 0.65rem 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}

table th:first-child { border-radius: var(--r-sm) 0 0 0; }
table th:last-child  { border-radius: 0 var(--r-sm) 0 0; }

table td {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--border-light);
  color: var(--text);
  vertical-align: middle;
}

table tbody tr {
  transition: background var(--transition);
}

table tbody tr:nth-child(even) { background: #FAFBFD; }
table tbody tr:hover            { background: #EFF6FF; }
table tbody tr:last-child td   { border-bottom: none; }

/* tfoot / totals */
table tfoot td {
  background: #F8FAFC;
  font-weight: 700;
  color: var(--text);
  border-top: 2px solid var(--border);
  padding: 0.7rem 1rem;
}

/* Money cells */
.money, td[style*="text-align:right"], td[align="right"] {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}


/* ════════════════════════════════════════════════════════
   BUTTONS
   ════════════════════════════════════════════════════════ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 1.1rem;
  background: var(--pok-blue);
  color: var(--white);
  border: none;
  border-radius: var(--r-sm);
  font-size: 0.82rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  text-decoration: none;
  letter-spacing: 0.1px;
  white-space: nowrap;
}

.btn:hover {
  background: var(--pok-blue-dark);
  color: var(--white);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(28,134,191,0.35);
}

.btn:active {
  transform: scale(0.98);
  box-shadow: none;
}

/* CTA / submit buttons */
.btn-cta,
button.btn[type="submit"]:not(.btn-secondary):not([name="save_admin_notes"]):not([name="add_payment"]) {
  background: var(--pok-orange);
}

.btn-cta:hover,
button.btn[type="submit"]:not(.btn-secondary):not([name="save_admin_notes"]):not([name="add_payment"]):hover {
  background: var(--pok-orange-dark);
  box-shadow: 0 4px 12px rgba(244,100,9,0.35);
}

.btn-secondary {
  background: var(--white);
  color: var(--text-mid);
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow-xs);
}
.btn-secondary:hover {
  background: var(--border-light);
  box-shadow: var(--shadow-sm);
  color: var(--text);
  transform: none;
}

.btn-danger {
  background: var(--pok-red);
}
.btn-danger:hover {
  background: #DC2626;
  box-shadow: 0 4px 12px rgba(239,68,68,0.35);
}

.btn-sm {
  padding: 0.35rem 0.8rem;
  font-size: 0.75rem;
}

.btn-lg {
  padding: 0.7rem 1.6rem;
  font-size: 0.9rem;
}


/* ════════════════════════════════════════════════════════
   FORMS
   ════════════════════════════════════════════════════════ */

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.3rem;
  font-weight: 600;
  color: var(--text-mid);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.55rem 0.85rem;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 0.875rem;
  font-family: 'Inter', sans-serif;
  background: var(--white);
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--pok-blue);
  box-shadow: 0 0 0 3px rgba(28,134,191,0.12);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-light);
}

.form-group textarea {
  resize: vertical;
  min-height: 90px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* Form helpers */
.required::after {
  content: ' *';
  color: var(--pok-red);
}

.help-text {
  font-size: 0.73rem;
  color: var(--text-light);
  margin-top: 0.3rem;
  line-height: 1.5;
}

.error {
  font-size: 0.75rem;
  color: var(--pok-red);
  margin-top: 0.25rem;
}


/* ════════════════════════════════════════════════════════
   ALERTS
   ════════════════════════════════════════════════════════ */

.alert {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.85rem 1.1rem;
  border-radius: var(--r-md);
  margin-bottom: 1.25rem;
  font-weight: 500;
  font-size: 0.84rem;
  line-height: 1.5;
}

.alert-success {
  background: #DCFCE7;
  color: #15803D;
  border: 1px solid #BBF7D0;
}

.alert-error {
  background: #FEE2E2;
  color: #B91C1C;
  border: 1px solid #FECACA;
}

.alert-info {
  background: #DBEAFE;
  color: #1D4ED8;
  border: 1px solid #BFDBFE;
}

.alert-warning {
  background: #FEF3C7;
  color: #92400E;
  border: 1px solid #FDE68A;
}


/* ════════════════════════════════════════════════════════
   PROGRESS BARS
   ════════════════════════════════════════════════════════ */

.progress-bar-wrap {
  background: var(--border);
  border-radius: 100px;
  height: 16px;
  overflow: hidden;
}

.progress-bar {
  height: 16px;
  border-radius: 100px;
  transition: width 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 6px;
  font-size: 10px;
  font-weight: 700;
  color: var(--white);
  min-width: 4px;
}


/* ════════════════════════════════════════════════════════
   BADGES / STATUS PILLS
   ════════════════════════════════════════════════════════ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.65rem;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}

/* Status pills via inline spans */
span[style*="background:#d97706"],
span[style*="background: #d97706"] {
  background: #FEF3C7 !important;
  color: #92400E !important;
  border: 1px solid #FDE68A !important;
}
span[style*="background:#059669"],
span[style*="background: #059669"] {
  background: #DCFCE7 !important;
  color: #15803D !important;
  border: 1px solid #BBF7D0 !important;
}
span[style*="background:#2563eb"],
span[style*="background: #2563eb"] {
  background: #DBEAFE !important;
  color: #1D4ED8 !important;
  border: 1px solid #BFDBFE !important;
}
span[style*="background:#dc2626"],
span[style*="background: #dc2626"] {
  background: #FEE2E2 !important;
  color: #B91C1C !important;
  border: 1px solid #FECACA !important;
}
span[style*="background:#6b7280"],
span[style*="background: #6b7280"] {
  background: #F1F5F9 !important;
  color: #475569 !important;
  border: 1px solid #CBD5E1 !important;
}

/* Payment status pills */
span[style*="background:#dc2626"] { /* unpaid */
  background: #FEE2E2 !important;
  color: #B91C1C !important;
  border: 1px solid #FECACA !important;
}


/* ════════════════════════════════════════════════════════
   COUNTDOWN  (used in admin dashboard + index)
   ════════════════════════════════════════════════════════ */

.countdown-wrap {
  display: flex;
  align-items: baseline;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.cd-item {
  text-align: center;
}

.cd-val {
  font-size: 2rem;
  font-weight: 800;
  color: var(--pok-blue);
  line-height: 1;
  letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
}

.cd-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-light);
  margin-top: 0.2rem;
  font-weight: 600;
}


/* ════════════════════════════════════════════════════════
   LOGIN PAGE  (admin.php when not logged in)
   ════════════════════════════════════════════════════════ */

/* The login uses .container > .header + .card */
/* When there's no .nav, body has no sidebar padding */
body:not(:has(.nav)) .container {
  max-width: 480px;
  padding-top: 3rem;
}

body:not(:has(.nav)) .header {
  text-align: center;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-left: none;
  border-bottom: none;
  background: var(--pok-blue);
  color: var(--white);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  margin-bottom: 0;
  position: relative;
}

body:not(:has(.nav)) .header::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -4px;
  height: 4px;
  background: #D2F245;
  z-index: 1;
}

body:not(:has(.nav)) .header h1 {
  color: var(--white);
}

body:not(:has(.nav)) .header p {
  color: #B3CDFF;
}

body:not(:has(.nav)) .card:first-of-type {
  border-radius: 0 0 var(--r-lg) var(--r-lg);
  border-top: none;
  box-shadow: var(--shadow-lg);
}


/* ════════════════════════════════════════════════════════
   FOOTER
   ════════════════════════════════════════════════════════ */

/* Override the inline-styled footer card */
.card[style*="background:#f0f0f0"],
.card[style*="background: #f0f0f0"] {
  background: transparent !important;
  box-shadow: none !important;
  border: none !important;
  padding: 1rem !important;
  margin-top: 0.5rem !important;
}

.card[style*="background:#f0f0f0"] p,
.card[style*="background: #f0f0f0"] p {
  color: var(--text-light) !important;
  font-size: 0.78rem !important;
}


/* ════════════════════════════════════════════════════════
   PUBLIC FORMS  (prijava-orkester / prijava-zbor / profil)
   ════════════════════════════════════════════════════════ */

/* When no nav (no sidebar), use centered max-width for forms */
body:not(:has(.nav)) {
  background: var(--bg);
}


/* ════════════════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════════════════ */

@media (max-width: 1024px) {
  :root { --sidebar-w: 210px; }
  .container { padding: 1.5rem 1.5rem; }
}

@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }

  body:has(.nav) {
    padding-left: 0;
    padding-top: 56px; /* topbar height */
  }

  .nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: auto;
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    padding: 0;
    height: 56px;
    overflow: hidden;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.08);
  }

  .nav::before {
    height: 56px;
    min-height: 56px;
    padding: 0 1rem 0 2.8rem;
    font-size: 0.9rem;
    background-position: 0.8rem center;
    border-bottom: none;
    border-right: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
    white-space: nowrap;
  }

  .nav::after {
    display: none;
  }

  .nav a {
    padding: 0.45rem 0.7rem;
    font-size: 0.78rem;
    border-left: none;
    border-radius: var(--r-sm);
    flex-shrink: 0;
  }

  .nav a.active {
    background: rgba(28,134,191,0.3);
    border-left: none;
  }

  .nav a[href="projekti.php"],
  .nav a[href="prijava-orkester.php"],
  .nav a[href="prijava-zbor.php"] {
    border-top: none;
    margin-top: 0;
    padding-top: 0.45rem;
  }

  .nav a[href*="logout"] {
    margin-top: 0 !important;
    border-top: none;
    padding-top: 0.45rem;
  }

  .stats { grid-template-columns: repeat(2, 1fr); }
  .form-row { grid-template-columns: 1fr; }
  .container { padding: 1rem; }
}

@media (max-width: 480px) {
  .stats { grid-template-columns: 1fr; }
}


/* ════════════════════════════════════════════════════════
   UTILITY
   ════════════════════════════════════════════════════════ */

.text-muted  { color: var(--text-light); }
.text-blue   { color: var(--pok-blue); }
.text-green  { color: var(--pok-green-dark); }
.text-red    { color: var(--pok-red); }
.text-orange { color: var(--pok-orange); }
.text-mono   { font-variant-numeric: tabular-nums; }

.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }

.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mt-1 { margin-top: 0.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-2 { margin-bottom: 1rem; }

.flex         { display: flex; }
.flex-center  { display: flex; align-items: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-sm       { gap: 0.5rem; }
.gap-md       { gap: 1rem; }

/* Grid helpers */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1.25rem; }

@media (max-width: 768px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}


/* ════════════════════════════════════════════════════════
   PRINT
   ════════════════════════════════════════════════════════ */

@media print {
  body:has(.nav) { padding-left: 0; }
  .nav { display: none !important; }
  .card { box-shadow: none; border: 1px solid #ddd; }
  .btn  { display: none; }

/* ════════════════════════════════════════════════════════
   V17 – Dashboard hero
   ════════════════════════════════════════════════════════ */

.dash-hero {
  background: linear-gradient(135deg, #0b1a2e 0%, #1B2C43 60%, #1C86BF 100%);
  color: #fff;
  border-radius: 20px;
  padding: 40px 44px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}
.dash-hero::before {
  content: '';
  position: absolute; right: -80px; top: -80px;
  width: 320px; height: 320px; border-radius: 50%;
  background: radial-gradient(circle, rgba(28,134,191,.35), transparent 70%);
  pointer-events: none;
}
.dash-hero-label {
  font-size: 11px; letter-spacing: 2.5px; opacity: .65; font-weight: 600;
  text-transform: uppercase;
}
.dash-hero-title {
  font-family: 'Inter', sans-serif;
  font-size: 48px; font-weight: 800; line-height: 1.05;
  margin: 10px 0 8px; letter-spacing: -1px;
}
.dash-hero-sub { opacity: .7; font-size: 14px; }
.dash-hero-stats {
  display: flex; gap: 52px; margin-top: 26px; flex-wrap: wrap;
}
.dash-hero-stats > div strong {
  display: block; font-size: 46px; font-weight: 800; line-height: 1;
  letter-spacing: -1px;
}
.dash-hero-stats > div span {
  display: block; margin-top: 5px; font-size: 10px;
  letter-spacing: 2.5px; opacity: .55; font-weight: 600; text-transform: uppercase;
}
.dash-hero-stats .t-blue  strong { color: #6FB9E8; }
.dash-hero-stats .t-purple strong { color: #C6A8FF; }

/* ════════════════════════════════════════════════════════
   V17 – Status cards (dashboard)
   ════════════════════════════════════════════════════════ */

.status-card {
  border-radius: 14px; padding: 18px 14px; text-align: center;
  transition: transform .15s, box-shadow .15s;
}
.status-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(27,44,67,.1); }
.status-card .icon { margin-bottom: 10px; display: block; }
.status-num  { font-size: 34px; font-weight: 800; line-height: 1; letter-spacing: -0.5px; }
.status-label { font-size: 11px; letter-spacing: 1.5px; color: #8892a6; font-weight: 600; text-transform: uppercase; margin-top: 6px; }

/* ════════════════════════════════════════════════════════
   V17 – Pack cards (dashboard)
   ════════════════════════════════════════════════════════ */

.pack-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pack-card { border-radius: 14px; padding: 20px; color: #fff; position: relative; overflow: hidden; }
.pack-blue   { background: linear-gradient(135deg, #1C86BF, #0f5a85); }
.pack-orange { background: linear-gradient(135deg, #F46409, #a73e04); }
.pack-title  { font-weight: 700; font-size: 17px; letter-spacing: .5px; }
.pack-price  { opacity: .75; font-size: 12px; margin-top: 3px; }
.pack-body   { display: flex; justify-content: space-between; align-items: baseline; margin-top: 18px; }
.pack-count  { font-size: 42px; font-weight: 800; line-height: 1; letter-spacing: -1px; }
.pack-total  { font-size: 16px; font-weight: 600; opacity: .9; }
.pack-total-row {
  display: flex; gap: 20px; align-items: baseline;
  padding: 14px 18px; margin-top: 12px;
  background: #FCFFEB; border-radius: 10px;
  font-size: 13px; color: #1B2C43; flex-wrap: wrap;
}
.pack-total-row span { font-weight: 600; letter-spacing: 1.5px; color: #8892a6; font-size: 11px; text-transform: uppercase; }
.pack-total-row b { font-size: 16px; font-weight: 700; }

/* ════════════════════════════════════════════════════════
   V17 – Countdown cards (colored-top)
   ════════════════════════════════════════════════════════ */

.count-card {
  background: #fff; border-radius: 12px; padding: 16px 18px;
  box-shadow: 0 2px 8px rgba(27,44,67,.06);
  border-top: 4px solid #1C86BF;
  border: 1px solid var(--border);
  border-top-width: 4px;
  transition: transform .15s, box-shadow .15s;
}
.count-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(27,44,67,.08); }
.count-blue   { border-top-color: #1C86BF !important; }
.count-orange { border-top-color: #F46409 !important; }
.count-green  { border-top-color: #10b981 !important; }
.count-purple { border-top-color: #7c3aed !important; }
.count-label  { font-size: 10px; letter-spacing: 2px; color: #8892a6; font-weight: 600; text-transform: uppercase; }
.count-date   { margin: 5px 0 12px; font-size: 14px; color: #1B2C43; font-weight: 600; }
.count-timer  { display: flex; gap: 16px; }
.count-timer > div { text-align: center; }
.count-timer b { font-size: 28px; font-weight: 800; line-height: 1; letter-spacing: -0.5px; display: block; }
.count-blue   .count-timer b { color: #1C86BF; }
.count-orange .count-timer b { color: #F46409; }
.count-green  .count-timer b { color: #10b981; }
.count-purple .count-timer b { color: #7c3aed; }
.count-timer span { display: block; font-size: 9px; letter-spacing: 1.5px; color: #8892a6; margin-top: 3px; text-transform: uppercase; font-weight: 600; }

/* ════════════════════════════════════════════════════════
   V17 – Profile hero (profil.php)
   ════════════════════════════════════════════════════════ */

.profile-hero {
  background: linear-gradient(135deg, #1B2C43 0%, #1C86BF 100%);
  border-radius: 20px; padding: 32px 36px; color: #fff; margin-bottom: 22px;
}
.profile-hero-inner { display: flex; gap: 22px; align-items: center; }
.profile-avatar {
  width: 68px; height: 68px; border-radius: 50%;
  background: rgba(255,255,255,.15); border: 2px solid rgba(255,255,255,.3);
  display: grid; place-items: center; flex-shrink: 0;
  font-size: 24px; font-weight: 800; letter-spacing: -1px;
}
.profile-hero-kicker { font-size: 10px; letter-spacing: 2.5px; opacity: .65; font-weight: 600; text-transform: uppercase; }
.profile-hero-title  { font-size: 34px; margin: 5px 0 7px; font-weight: 800; letter-spacing: -0.5px; line-height: 1.1; }
.profile-hero-meta   { opacity: .8; font-size: 13px; }
.profile-hero-meta span + span { margin-left: 4px; }

/* ════════════════════════════════════════════════════════
   V17 – Info grid (profil.php stat cards)
   ════════════════════════════════════════════════════════ */

.info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 22px; }
.info-card {
  background: #fff; border-radius: 16px; padding: 22px;
  border: 1px solid var(--border);
  box-shadow: 0 2px 10px rgba(27,44,67,.05);
  transition: transform .15s, box-shadow .15s;
}
.info-card:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(27,44,67,.08); }
.info-icon { color: var(--pok-blue); margin-bottom: 12px; display: block; }
.info-pay  .info-icon  { color: #10b981; }
.info-notes .info-icon { color: #1C86BF; }
.info-status .info-icon { color: #F46409; }
.info-value {
  font-size: 30px; font-weight: 800; color: #1B2C43; line-height: 1.1; letter-spacing: -0.5px;
}
.info-status-text { font-size: 20px; }
.info-label { color: #8892a6; font-size: 12px; margin-top: 5px; font-weight: 500; }
.info-bar { height: 5px; background: #eef1f5; border-radius: 3px; margin-top: 12px; overflow: hidden; }
.info-bar > div { height: 100%; background: linear-gradient(90deg, #10b981, #34d399); border-radius: 3px; transition: width .4s; }

/* ════════════════════════════════════════════════════════
   V17 – Profile cards (section wrappers in profil.php)
   ════════════════════════════════════════════════════════ */

.profile-card {
  background: #fff; border-radius: 16px; padding: 26px;
  border: 1px solid var(--border);
  box-shadow: 0 2px 10px rgba(27,44,67,.04);
  margin-bottom: 18px;
}
.profile-card h2, .profile-card h3 {
  font-size: 18px; font-weight: 700; color: #1B2C43;
  display: flex; align-items: center; gap: 9px;
  margin: 0 0 16px; padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.profile-card h2 .icon, .profile-card h3 .icon { color: var(--pok-blue); }

/* ════════════════════════════════════════════════════════
   V17 – Form fields (profil.php)
   ════════════════════════════════════════════════════════ */

.field { margin-bottom: 14px; }
.field label {
  display: block; font-weight: 600; font-size: 13px;
  color: #1B2C43; margin-bottom: 6px;
}
.field input, .field textarea, .field select {
  width: 100%; padding: 11px 13px; border: 1.5px solid #e2e7ee;
  border-radius: 10px; font-size: 14px; font-family: 'Inter', sans-serif;
  background: #fafbfd; color: #1B2C43;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--pok-blue);
  background: #fff; box-shadow: 0 0 0 3px rgba(28,134,191,.12);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.btn-primary {
  background: linear-gradient(135deg, #1C86BF, #0f5a85);
  color: #fff; border: 0; padding: 11px 22px;
  border-radius: 10px; font-weight: 600; font-size: 14px;
  cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
  transition: transform .1s, box-shadow .15s;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(28,134,191,.3); }

/* SVG icon helper */
.icon { vertical-align: middle; flex-shrink: 0; }

/* ════════════════════════════════════════════════════════
   V19 – Profile layout wrapper
   ════════════════════════════════════════════════════════ */

.profile-wrap {
  max-width: 880px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}
@media (max-width: 720px) {
  .profile-wrap { padding: 20px 16px 48px; }
}

/* ════════════════════════════════════════════════════════
   V19 – Field grid (2-column form layout)
   ════════════════════════════════════════════════════════ */

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 18px;
}
.field-grid .field-full { grid-column: 1 / -1; }
@media (max-width: 560px) {
  .field-grid { grid-template-columns: 1fr; }
  .field-grid .field-full { grid-column: 1; }
}

.field-grid .field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #1B2C43;
  margin-bottom: 6px;
}
.field-grid .field input,
.field-grid .field select,
.field-grid .field textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid #e2e7ee;
  border-radius: 10px;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  background: #fafbfd;
  color: #1B2C43;
  min-height: 42px;
  box-sizing: border-box;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.field-grid .field input:focus,
.field-grid .field select:focus,
.field-grid .field textarea:focus {
  outline: none;
  border-color: #1C86BF;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(28,134,191,.12);
}
.field-grid .field textarea { min-height: 80px; resize: vertical; }

/* Width limiters */
.input-sm { max-width: 200px !important; }
.input-md { max-width: 320px !important; }

/* ════════════════════════════════════════════════════════
   V19 – Form actions row (right-aligned buttons)
   ════════════════════════════════════════════════════════ */

.form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #eef1f5;
}
.form-actions.left { justify-content: flex-start; }

/* Ensure .btn-primary is never full-width by default */
.btn-primary { width: auto; }
.btn-primary:disabled { opacity: .45; cursor: not-allowed; background: #9ca3af !important; transform: none !important; box-shadow: none !important; }

/* Ghost button */
.btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px; border-radius: 10px; font-size: 14px; font-weight: 600;
  font-family: 'Inter', sans-serif; cursor: pointer;
  background: #fff; color: #1B2C43;
  border: 1.5px solid #e2e7ee;
  transition: background .15s;
  text-decoration: none; min-height: 42px;
}
.btn-ghost:hover { background: #f5f7fa; color: #1B2C43; }

/* ════════════════════════════════════════════════════════
   V19 – Inline message form
   ════════════════════════════════════════════════════════ */

.msg-row { display: flex; gap: 10px; align-items: stretch; }
.msg-row input { flex: 1; padding: 10px 14px; border: 1.5px solid #e2e7ee; border-radius: 10px; font-size: 14px; font-family: 'Inter', sans-serif; background: #fafbfd; min-height: 42px; box-sizing: border-box; transition: border-color .15s, box-shadow .15s; }
.msg-row input:focus { outline: none; border-color: #1C86BF; background: #fff; box-shadow: 0 0 0 3px rgba(28,134,191,.12); }
.msg-row .btn-primary { flex-shrink: 0; }
@media (max-width: 480px) { .msg-row { flex-wrap: wrap; } }

/* ════════════════════════════════════════════════════════
   V19 – Admin preview banner
   ════════════════════════════════════════════════════════ */

.admin-view-banner {
  background: #D2F245;
  border-bottom: 2px solid #bada36;
  padding: 10px 0;
}
.admin-view-banner-inner {
  max-width: 880px; margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; font-size: 14px; font-weight: 500; color: #1B2C43;
}
.btn-ghost-dark {
  background: #1B2C43; color: #fff;
  padding: 6px 14px; border-radius: 8px;
  text-decoration: none; font-size: 13px; font-weight: 600;
  transition: background .15s;
}
.btn-ghost-dark:hover { background: #000; color: #fff; }

/* profile-card scroll margin */
.profile-card { scroll-margin-top: 20px; }

/* ════════════════════════════════════════════════════════
   V18 – Edit form, row actions, flash
   ════════════════════════════════════════════════════════ */

.edit-form { max-width: 1100px; }

.edit-form-actions {
  position: sticky;
  bottom: 0;
  background: linear-gradient(to top, #EFF3F8 60%, transparent);
  padding: 16px 0 20px;
  z-index: 50;
}

.row-actions { display: flex; gap: 6px; justify-content: flex-end; align-items: center; }
.row-link {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 9px; border-radius: 7px;
  font-size: 12px; font-weight: 600;
  text-decoration: none; transition: background .12s;
  white-space: nowrap;
}
.row-link           { color: var(--pok-blue); }
.row-link:hover     { background: rgba(28,134,191,.1); color: var(--pok-blue); }
.row-link-edit      { color: var(--pok-orange); }
.row-link-edit:hover { background: rgba(244,100,9,.1); color: var(--pok-orange); }

.flash {
  padding: 13px 18px; border-radius: 10px; margin-bottom: 16px;
  font-weight: 500; font-size: 14px;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.flash-success { background: #d1fae5; color: #065f46; border-left: 4px solid #10b981; }
.flash-error   { background: #fee2e2; color: #991b1b; border-left: 4px solid #CF0E25; }
.flash a       { color: inherit; text-decoration: underline; font-weight: 700; }

.meta-info {
  display: flex; gap: 24px; flex-wrap: wrap;
  padding: 14px 20px; background: #f5f7fa;
  border-radius: 12px; font-size: 12px; color: #8892a6;
  margin-top: 16px;
}
.meta-info b { color: var(--text); }
.meta-info code {
  background: #fff; padding: 1px 7px;
  border-radius: 5px; border: 1px solid #e2e7ee;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
}
}
