/* AttendX admin theme — light, navy/blue, Bootstrap 5 base */
:root {
    --ax-navy: #0f2a4a;
    --ax-navy-2: #16375f;
    --ax-blue: #2563eb;
    --ax-blue-soft: #e8f0fe;
    --ax-bg: #f4f6fb;
    --ax-border: #e5e9f2;
    --ax-text: #1d2433;
    --ax-muted: #6b7489;
    --ax-radius: 14px;
    --ax-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 16px rgba(16, 24, 40, .06);
    --sidebar-w: 264px;
    --bs-primary: #2563eb;
    --bs-primary-rgb: 37, 99, 235;
    --bs-body-font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body { color: var(--ax-text); }
.btn-primary { --bs-btn-bg: var(--ax-blue); --bs-btn-border-color: var(--ax-blue); --bs-btn-hover-bg: #1d4fd7; --bs-btn-hover-border-color: #1d4fd7; }
.btn-outline-primary { --bs-btn-color: var(--ax-blue); --bs-btn-border-color: var(--ax-blue); --bs-btn-hover-bg: var(--ax-blue); --bs-btn-hover-border-color: var(--ax-blue); }

/* ---------- Shell ---------- */
.app-body { background: var(--ax-bg); }
.app-shell { display: flex; min-height: 100vh; }
.app-sidebar {
    width: var(--sidebar-w); flex-shrink: 0; background: var(--ax-navy); color: #c9d4e5;
    position: fixed; inset: 0 auto 0 0; overflow-y: auto; z-index: 1040; transition: transform .2s ease;
}
.app-main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; }

.sidebar-brand { display: flex; align-items: center; gap: .75rem; padding: 1.25rem 1.25rem 1rem; }
.brand-mark {
    width: 40px; height: 40px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #3b82f6, #1e40af); color: #fff; font-size: 1.3rem;
}
.brand-mark-lg { width: 64px; height: 64px; font-size: 2rem; border-radius: 18px; }
.brand-text { color: #fff; font-weight: 700; font-size: 1.15rem; letter-spacing: .2px; }

.sidebar-nav { padding: .25rem .75rem 2rem; }
.sidebar-nav .nav-link {
    display: flex; align-items: center; gap: .65rem; color: #c9d4e5; border-radius: 10px;
    padding: .55rem .75rem; font-size: .925rem; text-decoration: none;
}
.sidebar-nav .nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar-nav .nav-link.active { background: var(--ax-blue); color: #fff; }
.sidebar-nav .nav-link i { font-size: 1.05rem; }
.sidebar-nav .nav-sub { padding-left: 2.35rem; font-size: .875rem; justify-content: space-between; }
.sidebar-nav .nav-link.disabled { color: #6f819c; cursor: default; }
.sidebar-nav .nav-link.disabled:hover { background: none; }
.nav-section {
    margin: 1.1rem .75rem .35rem; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em;
    color: #8296b3; display: flex; align-items: center; gap: .5rem;
}
.phase-tag { font-size: .65rem; padding: .05rem .4rem; border-radius: 6px; background: rgba(255,255,255,.07); color: #8296b3; }

.app-topbar {
    position: sticky; top: 0; z-index: 1030; display: flex; align-items: center; gap: 1rem;
    height: 64px; padding: 0 1.5rem; background: #fff; border-bottom: 1px solid var(--ax-border);
}
.topbar-title { font-weight: 600; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: .5rem; }
.btn-icon { width: 40px; height: 40px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.2rem; color: var(--ax-muted); }
.btn-icon:hover { background: var(--ax-bg); color: var(--ax-text); }
.notif-badge { position: absolute; top: 2px; right: 0; font-size: .62rem; }
.user-chip { display: flex; align-items: center; gap: .6rem; border: 1px solid var(--ax-border); border-radius: 12px; padding: .3rem .7rem .3rem .3rem; }
.user-chip .avatar { width: 34px; height: 34px; border-radius: 9px; background: var(--ax-blue-soft); color: var(--ax-blue); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .85rem; }
.user-name { font-size: .875rem; font-weight: 600; line-height: 1.1; }
.user-role { font-size: .75rem; color: var(--ax-muted); }

.app-content { padding: 1.5rem; max-width: 1440px; width: 100%; }

@media (max-width: 991.98px) {
    .app-sidebar { transform: translateX(-100%); }
    .app-main { margin-left: 0; }
    body.sidebar-open .app-sidebar { transform: none; }
    body.sidebar-open .sidebar-backdrop { display: block; }
    .app-content { padding: 1rem; }
}
.sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(15, 23, 42, .4); z-index: 1035; }

/* ---------- Page elements ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.page-title { font-size: 1.4rem; font-weight: 700; margin: 0; }
.page-sub { color: var(--ax-muted); margin: .2rem 0 0; }

.card-soft { border: 1px solid var(--ax-border); border-radius: var(--ax-radius); box-shadow: var(--ax-shadow); background: #fff; }
.card-header-soft { padding: .9rem 1.25rem; border-bottom: 1px solid var(--ax-border); }

.stat-card { display: flex; align-items: center; gap: 1rem; background: #fff; border: 1px solid var(--ax-border); border-radius: var(--ax-radius); box-shadow: var(--ax-shadow); padding: 1.1rem 1.25rem; height: 100%; }
.stat-icon { width: 48px; height: 48px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.35rem; flex-shrink: 0; }
.stat-value { font-size: 1.6rem; font-weight: 700; line-height: 1.1; }
.stat-label { color: var(--ax-muted); font-size: .85rem; }
.tone-navy   { background: #e6ebf3; color: var(--ax-navy); }
.tone-blue   { background: var(--ax-blue-soft); color: var(--ax-blue); }
.tone-teal   { background: #e3f6f3; color: #0f8a77; }
.tone-indigo { background: #eceafe; color: #5b4bdb; }
.tone-green  { background: #e5f6ea; color: #15803d; }
.tone-red    { background: #fdecec; color: #c62828; }
.tone-amber  { background: #fff4de; color: #b26a00; }

.mini-stat { border-left: 4px solid; border-radius: 10px; background: var(--ax-bg); padding: .8rem 1rem; }
.mini-value { font-size: 1.4rem; font-weight: 700; }
.mini-label { font-size: .8rem; color: var(--ax-muted); }

.table-clean thead th { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ax-muted); font-weight: 600; background: #fafbfd; border-bottom-color: var(--ax-border); padding: .8rem 1rem; }
.table-clean td { padding: .85rem 1rem; border-color: var(--ax-border); }

.scope-badge { font-weight: 500; }
.scope-global  { background: #e6ebf3; color: var(--ax-navy); }
.scope-company { background: var(--ax-blue-soft); color: var(--ax-blue); }
.scope-branch  { background: #e3f6f3; color: #0f8a77; }
.scope-self    { background: #f1f2f6; color: #4b5568; }

.sticky-actions { position: sticky; bottom: 0; background: linear-gradient(to top, var(--ax-bg) 70%, transparent); padding: 1rem 0; margin-top: 1rem; }

/* ---------- Auth ---------- */
.auth-body { background: #fff; }
.auth-wrap { display: flex; min-height: 100vh; }
.auth-panel-brand { flex: 1; background: radial-gradient(circle at 20% 20%, #1e3a8a 0, var(--ax-navy) 60%); color: #fff; align-items: center; justify-content: center; padding: 3rem; }
.auth-panel-brand h1 { font-weight: 700; }
.auth-panel-brand .lead { color: #c9d4e5; max-width: 420px; }
.auth-points { list-style: none; padding: 0; margin: 2rem 0 0; color: #dbe5f5; }
.auth-points li { display: flex; gap: .6rem; align-items: center; margin-bottom: .6rem; }
.auth-points i { color: #60a5fa; }
.auth-panel-form { flex: 1; display: flex; align-items: center; justify-content: center; padding: 2rem; }
.auth-card { width: 100%; max-width: 400px; }

.error-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--ax-bg); }
.error-code { font-size: 5rem; font-weight: 800; color: var(--ax-navy); line-height: 1; }

/* ---------- Installer ---------- */
.install-wrap { min-height: 100vh; background: var(--ax-bg); display: flex; justify-content: center; padding: 3rem 1rem; }
.install-card { width: 100%; max-width: 560px; background: #fff; border: 1px solid var(--ax-border); border-radius: var(--ax-radius); box-shadow: var(--ax-shadow); padding: 2rem; align-self: flex-start; }
.install-log { background: var(--ax-bg); border-radius: 10px; padding: 1rem; font-size: .8rem; max-height: 320px; overflow: auto; }
