/* =========================================================================
   KERDIA Management — theme
   ========================================================================= */
:root {
  --krd-primary:   #c8102e;   /* KERDIA crimson */
  --krd-primary-2: #ed1c24;   /* KERDIA red */
  --krd-accent:    #f7941d;   /* KERDIA orange */
  --krd-dark:      #1b1b1f;   /* near-black sidebar (wordmark tone) */
  --krd-dark-2:    #2a2a30;
  --krd-muted:     #6d6e71;   /* brand gray ("ONLINE SOLUTIONS") */
  --krd-bg:        #f6f4f3;   /* warm off-white */
  --krd-radius:    14px;
  --krd-shadow:    0 1px 3px rgba(20, 20, 25, .08), 0 1px 2px rgba(20, 20, 25, .06);
  --krd-sidebar-w: 256px;
  /* Signature brand gradient: orange → red → crimson, as in the logo mark. */
  --krd-grad:      linear-gradient(135deg, #f7941d 0%, #ed1c24 55%, #c8102e 100%);

  /* Emerald is the single ACTION / accent colour (buttons, active nav, links).
     Brand red/orange lives in the logo; red is reserved for delete/danger. */
  --krd-emerald:    #10b981;
  --krd-emerald-d:  #059669;
  --krd-emerald-dd: #047857;
  --krd-emerald-rgb: 5, 150, 105;

  /* Point Bootstrap's "primary" at emerald so every primary utility (badges,
     icons, borders, links) follows the accent. */
  --bs-primary:         #059669;
  --bs-primary-rgb:     5, 150, 105;
  --bs-link-color:      #059669;
  --bs-link-color-rgb:  5, 150, 105;
  --bs-link-hover-color:#047857;
}

* { box-sizing: border-box; }
body {
  background: var(--krd-bg);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: #1e293b;
  font-size: .925rem;
}

/* ---- App shell ---------------------------------------------------------- */
.krd-shell { display: flex; min-height: 100vh; }

.krd-sidebar {
  width: var(--krd-sidebar-w);
  background: var(--krd-dark);
  color: #cbd5e1;
  position: fixed; inset: 0 auto 0 0;
  display: flex; flex-direction: column;
  z-index: 1040;
  transition: transform .25s ease;
}
.krd-sidebar .brand {
  padding: 1.15rem 1.25rem;
  display: flex; align-items: center; gap: .6rem;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.krd-sidebar .brand .logo-mark {
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--krd-grad);
  display: grid; place-items: center; color: #fff; font-weight: 800;
  letter-spacing: -.5px; flex: 0 0 auto;
}
/* Real KERDIA arrow mark on a white tile (mark includes a dark triangle that
   would otherwise vanish on the dark sidebar). */
.krd-sidebar .brand .logo-mark-img {
  width: 38px; height: 38px; flex: 0 0 auto;
  background: #fff; border-radius: 9px; padding: 4px; object-fit: contain;
  box-shadow: 0 1px 4px rgba(0,0,0,.25);
}
.krd-sidebar .brand .name { color: #fff; font-weight: 700; line-height: 1; }
.krd-sidebar .brand .name small { display:block; color:#94a3b8; font-weight:500; font-size:.68rem; margin-top:2px; }

.krd-nav {
  padding: .75rem .65rem; overflow-y: auto; flex: 1;
  /* Modern overlay scrollbar: hidden until the menu is hovered, thin, and a
     translucent thumb that blends into the dark sidebar. */
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;       /* Firefox: hidden by default */
  transition: scrollbar-color .2s ease;
}
.krd-nav:hover { scrollbar-color: rgba(255,255,255,.16) transparent; }
.krd-nav::-webkit-scrollbar { width: 6px; }
.krd-nav::-webkit-scrollbar-track { background: transparent; }
.krd-nav::-webkit-scrollbar-thumb {
  background: transparent; border-radius: 999px;
  transition: background .2s ease;
}
.krd-nav:hover::-webkit-scrollbar-thumb { background: rgba(255,255,255,.16); }
.krd-nav::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.30); }
.krd-nav .nav-section {
  font-size: .68rem; text-transform: uppercase; letter-spacing: .08em;
  color: #64748b; padding: .9rem .85rem .35rem; font-weight: 600;
}
.krd-nav a {
  display: flex; align-items: center; gap: .7rem;
  padding: .6rem .85rem; margin: 1px 0;
  color: #cbd5e1; text-decoration: none; border-radius: 9px;
  font-weight: 500; transition: background .15s, color .15s;
}
.krd-nav a i { font-size: 1.05rem; width: 20px; text-align: center; }
.krd-nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.krd-nav a.active {
  /* Brand red, softened: a subtle semi-black dot-grid texture + a dark overlay
     that's heaviest on the lighter (brighter-red) side, so it doesn't vibrate. */
  background:
    radial-gradient(rgba(0,0,0,.16) 1px, transparent 1.6px) 0 0 / 10px 10px,
    linear-gradient(135deg, rgba(0,0,0,.34) 0%, rgba(0,0,0,.06) 55%, rgba(0,0,0,.14) 100%),
    linear-gradient(135deg, var(--krd-primary-2), var(--krd-primary));
  color: #fff; box-shadow: var(--krd-shadow);
}

/* ---- Main column -------------------------------------------------------- */
.krd-main { flex: 1; margin-left: var(--krd-sidebar-w); display: flex; flex-direction: column; min-width: 0; }
.krd-topbar {
  height: 62px; background: #fff; border-bottom: 1px solid #e2e8f0;
  display: flex; align-items: center; gap: 1rem; padding: 0 1.25rem;
  position: sticky; top: 0; z-index: 1030;
}
.krd-topbar .page-title { font-weight: 700; font-size: 1.05rem; margin: 0; }
.krd-content { padding: 1.4rem; flex: 1; }
.krd-hamburger { display: none; font-size: 1.4rem; background: none; border: 0; color: #334155; }

.avatar-chip {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--krd-grad);
  color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .8rem;
}

/* ---- Cards & stats ------------------------------------------------------ */
.card { border: 1px solid #e9eef5; border-radius: var(--krd-radius); box-shadow: var(--krd-shadow); }
.card-header { background: #fff; border-bottom: 1px solid #eef2f7; font-weight: 600; border-radius: var(--krd-radius) var(--krd-radius) 0 0 !important; }

.stat-card { position: relative; overflow: hidden; }
.stat-card .stat-icon {
  width: 48px; height: 48px; border-radius: 12px;
  display: grid; place-items: center; font-size: 1.4rem; color: #fff;
}
.stat-card .stat-value { font-size: 1.7rem; font-weight: 800; line-height: 1; }
.stat-card .stat-label { color: var(--krd-muted); font-size: .8rem; }
/* Brand-aligned stat gradients (warm-dominant). */
.bg-grad-blue   { background: linear-gradient(135deg, #ed1c24, #c8102e); }  /* brand red   */
.bg-grad-cyan   { background: linear-gradient(135deg, #f7941d, #f1592a); }  /* brand orange*/
.bg-grad-green  { background: linear-gradient(135deg, #10b981, #059669); }
.bg-grad-amber  { background: linear-gradient(135deg, #f59e0b, #d97706); }
.bg-grad-rose   { background: linear-gradient(135deg, #f43f5e, #be123c); }
.bg-grad-violet { background: linear-gradient(135deg, #e0202a, #9e1b32); }  /* deep crimson */

/* Emerald primary actions with a soft colored "glow" that lifts on hover —
   modern, easy on the eyes, and clearly distinct from destructive red. */
.btn-primary {
  background: var(--krd-emerald-d); border-color: var(--krd-emerald-d);
  box-shadow: 0 4px 14px rgba(var(--krd-emerald-rgb), .30);
  transition: box-shadow .18s ease, transform .12s ease, background .15s ease;
}
.btn-primary:hover {
  background: var(--krd-emerald-dd); border-color: var(--krd-emerald-dd);
  box-shadow: 0 6px 22px rgba(var(--krd-emerald-rgb), .48);
  transform: translateY(-1px);
}
.btn-primary:focus, .btn-primary:active {
  background: var(--krd-emerald-dd); border-color: var(--krd-emerald-dd);
  box-shadow: 0 0 0 .25rem rgba(var(--krd-emerald-rgb), .30);
}
/* Distinct violet accent for the "Leave" attendance status (not green/red). */
.text-bg-violet { background-color: #7c3aed !important; color: #fff !important; }
.text-violet    { color: #7c3aed !important; }
.border-violet  { border-color: #7c3aed !important; }

.btn-success { background: var(--krd-emerald-d); border-color: var(--krd-emerald-d); }
.btn-success:hover { background: var(--krd-emerald-dd); border-color: var(--krd-emerald-dd); }
.btn-outline-primary { color: var(--krd-emerald-d); border-color: var(--krd-emerald-d); }
.btn-outline-primary:hover { background: var(--krd-emerald-d); border-color: var(--krd-emerald-d); color: #fff; }
a { color: var(--krd-emerald-d); }
a:hover { color: var(--krd-emerald-dd); }
.text-primary { color: var(--krd-emerald-d) !important; }

/* ---- Auth / public pages ------------------------------------------------ */
.krd-auth {
  min-height: 100vh; display: grid; place-items: center;
  background: radial-gradient(1200px 600px at 10% -10%, #c8102e 0%, transparent 55%),
              radial-gradient(900px 500px at 110% 110%, #f7941d 0%, transparent 45%),
              var(--krd-dark);
  padding: 1.5rem;
}
.krd-auth-card { width: 100%; max-width: 410px; border: 0; border-radius: 18px; }
.krd-auth-card .card-body { padding: 2.2rem; }
.krd-logo-lg {
  width: 56px; height: 56px; border-radius: 14px;
  background: var(--krd-grad);
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 1.5rem;
}
/* Real arrow mark on a white tile, for dark backgrounds (login screen). */
.krd-logo-img {
  display: block; width: 64px; height: 64px; padding: 8px;
  background: #fff; border-radius: 16px; object-fit: contain;
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
}

/* ---- Verify certificate page ------------------------------------------- */
.verify-wrap { max-width: 720px; margin: 0 auto; }
.verify-status { font-size: 3rem; line-height: 1; }
/* Vertical padding only — leave horizontal padding to the Bootstrap column
   gutter so two-column field grids (e.g. employee details) keep a gap. */
.cert-field { padding-top: .6rem; padding-bottom: .6rem; border-bottom: 1px dashed #e2e8f0; }
.cert-field:last-child { border-bottom: 0; }
.cert-field .lbl { color: var(--krd-muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
.cert-field .val { font-weight: 600; }

/* 7-column grid for the attendance calendar (Bootstrap stops at 6). */
.row-cols-7 > * { flex: 0 0 auto; width: 14.2857%; }
@media (max-width: 575.98px) { .row-cols-7 > * { width: 14.2857%; font-size: .75rem; } }

/* ---- Responsive --------------------------------------------------------- */
@media (max-width: 991.98px) {
  .krd-sidebar { transform: translateX(-100%); }
  .krd-sidebar.open { transform: translateX(0); }
  .krd-main { margin-left: 0; }
  .krd-hamburger { display: inline-flex; }
  .krd-backdrop { position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 1035; }
}
