/* ===========================================================================
   Centrien Licensing — enterprise design system
   =========================================================================== */
:root {
  --brand:      #2A2630;   /* Centrien charcoal (logo background) */
  --brand-2:    #35303d;
  --accent:     #4f46e5;   /* indigo primary action */
  --accent-600: #4338ca;
  --accent-050: #eef2ff;
  --bg:         #f5f6f8;
  --surface:    #ffffff;
  --border:     #e5e7eb;
  --text:       #1a1d23;
  --muted:      #6b7280;
  --success:    #059669;
  --success-bg: #ecfdf3;
  --danger:     #dc2626;
  --warning:    #b45309;
  --radius:     10px;
  --shadow-sm:  0 1px 2px rgba(16,24,40,.05);
  --shadow:     0 1px 3px rgba(16,24,40,.08), 0 1px 2px rgba(16,24,40,.04);
  --shadow-lg:  0 8px 24px rgba(16,24,40,.10);
}

html { font-size: 15px; position: relative; min-height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex; flex-direction: column;
}
h1,h2,h3,h4,h5 { font-weight: 650; letter-spacing: -.01em; color: var(--text); }
h2 { font-size: 1.55rem; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-600); text-decoration: underline; }
.text-muted { color: var(--muted) !important; }
main { flex: 1 0 auto; }

/* ---- Top navigation ---- */
.app-nav {
  background: var(--brand);
  border-bottom: 1px solid rgba(255,255,255,.06);
  box-shadow: var(--shadow-sm);
}
.app-nav .navbar-brand { display:flex; align-items:center; gap:.6rem; font-weight:700; color:#fff; letter-spacing:.2px; }
.app-nav .navbar-brand img { height: 30px; border-radius: 6px; }
.app-nav .navbar-brand .brand-sub { font-weight: 500; color: #b9b3c4; font-size: .95rem; }
.app-nav .nav-link { color: #cfc9d8 !important; font-weight: 500; padding: .5rem .85rem !important; border-radius: 7px; transition: background .15s, color .15s; }
.app-nav .nav-link:hover { color: #fff !important; background: rgba(255,255,255,.08); text-decoration: none; }
.app-nav .nav-link.active { color: #fff !important; background: rgba(255,255,255,.12); }
.app-nav .account-name { color:#cfc9d8; font-size:.9rem; }
.app-nav .btn-logout { color:#cfc9d8; font-weight:500; text-decoration:none; }
.app-nav .btn-logout:hover { color:#fff; }

/* ---- Cards ---- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-body { padding: 1.25rem 1.4rem; }
.section-head { display:flex; align-items:center; justify-content:space-between; margin-bottom: 1.1rem; }
.section-head .subtitle { color: var(--muted); font-size: .92rem; margin-top: .15rem; }

/* ---- Stat tiles ---- */
.stat-tile { background: var(--surface); border:1px solid var(--border); border-radius: var(--radius); padding: 1.15rem 1.25rem; box-shadow: var(--shadow); }
.stat-tile .stat-num { font-size: 2rem; font-weight: 720; line-height: 1; letter-spacing: -.02em; }
.stat-tile .stat-label { color: var(--muted); font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; margin-top: .4rem; }
.stat-tile.accent .stat-num { color: var(--accent); }
.stat-tile.good   .stat-num { color: var(--success); }

/* ---- Buttons ---- */
.btn { border-radius: 8px; font-weight: 550; padding: .5rem .95rem; transition: all .15s; }
.btn-sm { padding: .3rem .65rem; font-size: .82rem; }
.btn-primary { background: var(--accent); border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-600); border-color: var(--accent-600); }
.btn-success { background: var(--success); border-color: var(--success); }
.btn-outline-secondary { color: var(--text); border-color: var(--border); background:#fff; }
.btn-outline-secondary:hover { background: #f3f4f6; color: var(--text); border-color:#d1d5db; }
.btn-link { color: var(--accent); font-weight: 550; }
.btn:focus, .form-control:focus, .form-select:focus, .form-check-input:focus {
  box-shadow: 0 0 0 3px var(--accent-050); border-color: var(--accent);
}

/* ---- Forms ---- */
.form-label { font-weight: 550; font-size: .88rem; color: #374151; margin-bottom: .3rem; }
.form-control, .form-select { border-radius: 8px; border-color: var(--border); padding: .5rem .7rem; }
.form-control::placeholder { color: #9ca3af; }

/* ---- Tables ---- */
.table { margin-bottom: 0; }
.table > thead th { background: #fafbfc; color: var(--muted); font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; border-bottom: 1px solid var(--border); padding: .7rem 1rem; }
.table > tbody td { padding: .75rem 1rem; border-color: #f1f2f4; vertical-align: middle; }
.table-hover > tbody > tr:hover > * { background: #f9fafb; }
.mono { font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace; font-size: .82em; color: #374151; word-break: break-all; }

/* ---- Badges ---- */
.badge { font-weight: 600; padding: .35em .6em; border-radius: 6px; letter-spacing: .02em; }
.badge.bg-success { background: var(--success-bg) !important; color: var(--success) !important; }
.badge.bg-secondary { background: #f3f4f6 !important; color: #6b7280 !important; }

/* ---- Alerts ---- */
.alert { border-radius: 9px; border: 1px solid transparent; font-size: .93rem; }
.alert-success { background: var(--success-bg); border-color: #a7f3d0; color: #065f46; }
.alert-danger { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alert-info { background: var(--accent-050); border-color: #c7d2fe; color: #3730a3; }

/* ---- Footer ---- */
.app-footer { flex-shrink: 0; background: var(--brand); color: #b9b3c4; padding: 1.4rem 0; margin-top: 3rem; font-size: .86rem; }
.app-footer a { color: #d6d1de; }
.app-footer a:hover { color: #fff; }
.app-footer .foot-brand { color:#fff; font-weight:600; }

/* ---- Auth pages (stock Identity) cleanup ---- */
.auth-shell main { max-width: 460px; margin: 2.5rem auto; }
.auth-shell main > h1 { font-size: 1.6rem; text-align:center; margin-bottom: 1.4rem; }
.auth-shell .row > div[class*="col-lg-4"] { display: none !important; }     /* hide external-auth column */
.auth-shell .row > div[class*="col-lg-6"] { flex: 0 0 100%; max-width: 100%; }
.auth-shell section h2, .auth-shell section h3, .auth-shell section hr { display:none; }  /* redundant sub-headings/rules on stock pages */
.auth-shell #account, .auth-shell form { background: var(--surface); border:1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.6rem; }
.auth-shell .form-floating { margin-bottom: .85rem; }
.auth-shell .btn-primary, .auth-shell button[type="submit"] { width: 100%; padding: .6rem; }
.auth-brand { text-align:center; margin: 2rem auto .5rem; }
.auth-brand img { height: 54px; border-radius: 12px; box-shadow: var(--shadow); }
