/* ============================================
   Getnomik Payroll Suite — Main Stylesheet
   Premium Dark Admin UI
   ============================================ */

:root {
    --sidebar-width: 260px;
    --topbar-height: 64px;

    /* Core palette */
    --bg-deep:      #0d0f14;
    --bg-surface:   #13161e;
    --bg-card:      #181c27;
    --bg-hover:     #1e2233;
    --bg-input:     #1a1e2a;

    /* Borders */
    --border:       rgba(255,255,255,0.07);
    --border-light: rgba(255,255,255,0.04);

    /* Brand accent */
    --accent:       #c9a84c;
    --accent-dark:  #a8882e;
    --accent-glow:  rgba(201,168,76,0.15);
    --accent-rgb:   201,168,76;

    /* Status colors */
    --green:        #2dcc8f;
    --green-bg:     rgba(45,204,143,0.12);
    --red:          #e85d75;
    --red-bg:       rgba(232,93,117,0.12);
    --blue:         #5b8dee;
    --blue-bg:      rgba(91,141,238,0.12);
    --orange:       #f0965a;
    --orange-bg:    rgba(240,150,90,0.12);

    /* Text */
    --text-primary:   #e8eaf0;
    --text-secondary: #8891aa;
    --text-muted:     #545d75;

    /* Typography */
    --font-body:    'DM Sans', sans-serif;
    --font-display: 'Playfair Display', serif;

    /* Radius */
    --radius-sm:  6px;
    --radius:     10px;
    --radius-lg:  16px;
    --radius-xl:  22px;

    /* Shadows */
    --shadow-sm:  0 2px 8px rgba(0,0,0,0.3);
    --shadow:     0 4px 24px rgba(0,0,0,0.4);
    --shadow-lg:  0 12px 48px rgba(0,0,0,0.5);
}

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

html { font-size: 15px; scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    background: var(--bg-deep);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ── Sidebar ── */
.sidebar {
    position: fixed;
    top: 0; left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    overflow-y: auto;
    overflow-x: hidden;
    transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* Brand */
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px 20px 20px;
    border-bottom: 1px solid var(--border-light);
}

.brand-icon {
    width: 40px; height: 40px;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; color: #0d0f14;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(var(--accent-rgb), 0.3);
}

.brand-text { display: flex; flex-direction: column; }
.brand-name { font-family: var(--font-display); font-size: 1.05rem; font-weight: 700; color: var(--text-primary); letter-spacing: 0.01em; }
.brand-sub { font-size: 0.68rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.1em; margin-top: -1px; }

/* Nav */
.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-section-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    padding: 14px 10px 6px;
    font-weight: 600;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 12px;
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
    position: relative;
    white-space: nowrap;
}

.sidebar-nav .nav-link i {
    width: 18px;
    text-align: center;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.sidebar-nav .nav-link:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    transform: translateX(2px);
}

.sidebar-nav .nav-link.active {
    background: var(--accent-glow);
    color: var(--accent);
    font-weight: 600;
    border: 1px solid rgba(var(--accent-rgb), 0.2);
}

.sidebar-nav .nav-link.active i { color: var(--accent); }

.sidebar-nav .nav-link-danger:hover { background: var(--red-bg); color: var(--red); }

/* Sidebar footer */
.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-light);
}

.admin-info { display: flex; align-items: center; gap: 10px; }

.admin-avatar {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.85rem; font-weight: 700; color: #0d0f14;
    flex-shrink: 0;
}

.admin-details { display: flex; flex-direction: column; }
.admin-name { font-size: 0.84rem; font-weight: 600; color: var(--text-primary); }
.admin-role { font-size: 0.7rem; color: var(--text-muted); }

/* ── Main Wrapper ── */
.main-wrapper {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.3s cubic-bezier(0.4,0,0.2,1);
}

/* ── Topbar ── */
.topbar {
    height: var(--topbar-height);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 16px;
    position: sticky; top: 0;
    z-index: 100;
}

.topbar-toggle {
    background: none; border: none;
    color: var(--text-secondary);
    font-size: 1.1rem; cursor: pointer;
    padding: 6px; border-radius: var(--radius-sm);
    transition: color 0.2s;
    display: none;
}
.topbar-toggle:hover { color: var(--text-primary); }

.topbar-title {
    flex: 1;
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
}

.topbar-actions { display: flex; align-items: center; gap: 16px; }

.topbar-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex; align-items: center; gap: 6px;
}

.topbar-logout {
    width: 34px; height: 34px;
    background: var(--red-bg);
    color: var(--red);
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.2s;
}
.topbar-logout:hover { background: var(--red); color: white; }

/* ── Page Content ── */
.page-content {
    flex: 1;
    padding: 28px 28px 40px;
}

/* ── Cards ── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border);
    padding: 18px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.card-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex; align-items: center; gap: 8px;
    margin: 0;
}

.card-title i { color: var(--accent); font-size: 0.85rem; }

.card-body { padding: 22px; }

/* Stat Cards */
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 80px; height: 80px;
    border-radius: 50%;
    background: var(--accent-glow);
    transform: translate(20px, -20px);
}

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

.stat-icon {
    width: 44px; height: 44px;
    border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem;
    margin-bottom: 16px;
}

.stat-icon.gold    { background: var(--accent-glow); color: var(--accent); }
.stat-icon.green   { background: var(--green-bg);    color: var(--green); }
.stat-icon.blue    { background: var(--blue-bg);     color: var(--blue); }
.stat-icon.orange  { background: var(--orange-bg);   color: var(--orange); }

.stat-value {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.1;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 500;
}

/* ── Tables ── */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius);
}

.table {
    margin: 0;
    color: var(--text-primary);
}

.table thead th {
    background: var(--bg-hover);
    border-bottom: 1px solid var(--border);
    border-top: none;
    color: var(--text-muted);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
    padding: 12px 16px;
    white-space: nowrap;
}

.table tbody tr {
    border-bottom: 1px solid var(--border-light);
    transition: background 0.15s;
}

.table tbody tr:hover { background: var(--bg-hover); }

.table tbody td {
    padding: 13px 16px;
    border: none;
    font-size: 0.88rem;
    vertical-align: middle;
    color: var(--text-secondary);
}

.table tbody td:first-child { color: var(--text-primary); font-weight: 500; }

.table tbody tr:last-child { border-bottom: none; }

/* ── Badges ── */
.badge-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-status::before {
    content: '';
    width: 5px; height: 5px;
    border-radius: 50%;
    background: currentColor;
}

.badge-paid, .badge-active { background: var(--green-bg); color: var(--green); }
.badge-pending { background: var(--orange-bg); color: var(--orange); }
.badge-inactive { background: var(--red-bg); color: var(--red); }
.badge-bank { background: var(--blue-bg); color: var(--blue); }
.badge-upi { background: var(--accent-glow); color: var(--accent); }
.badge-cash { background: var(--green-bg); color: var(--green); }

/* ── Forms ── */
.form-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 6px;
}

.form-control, .form-select {
    background: var(--bg-input) !important;
    border: 1px solid var(--border) !important;
    color: var(--text-primary) !important;
    border-radius: var(--radius) !important;
    padding: 10px 14px !important;
    font-family: var(--font-body) !important;
    font-size: 0.88rem !important;
    transition: border-color 0.2s, box-shadow 0.2s !important;
}

.form-control:focus, .form-select:focus {
    border-color: rgba(var(--accent-rgb), 0.5) !important;
    box-shadow: 0 0 0 3px var(--accent-glow) !important;
    outline: none !important;
}

.form-control::placeholder { color: var(--text-muted) !important; }

.form-control:read-only { background: var(--bg-hover) !important; color: var(--text-secondary) !important; }

/* ── Buttons ── */
.btn-primary-gold {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: #0d0f14;
    border: none;
    border-radius: var(--radius);
    padding: 10px 22px;
    font-family: var(--font-body);
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex; align-items: center; gap: 8px;
    transition: all 0.2s;
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary-gold:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(var(--accent-rgb), 0.35);
    color: #0d0f14;
}

.btn-ghost {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    border-radius: var(--radius);
    padding: 8px 16px;
    font-family: var(--font-body);
    font-size: 0.84rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex; align-items: center; gap: 6px;
    transition: all 0.2s;
    text-decoration: none;
    white-space: nowrap;
}

.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.btn-sm-action {
    width: 30px; height: 30px;
    border-radius: var(--radius-sm);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 0.75rem;
    border: none; cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-sm-action.edit    { background: var(--blue-bg);   color: var(--blue); }
.btn-sm-action.delete  { background: var(--red-bg);    color: var(--red); }
.btn-sm-action.view    { background: var(--green-bg);  color: var(--green); }
.btn-sm-action.download{ background: var(--accent-glow); color: var(--accent); }

.btn-sm-action:hover { filter: brightness(1.2); transform: scale(1.08); }

/* ── Alerts ── */
.alert-getnomik {
    border-radius: var(--radius);
    border: none;
    padding: 12px 16px;
    font-size: 0.88rem;
    display: flex; align-items: center; gap: 10px;
}

.alert-success-dark { background: var(--green-bg);  color: var(--green); }
.alert-danger-dark  { background: var(--red-bg);    color: var(--red); }
.alert-info-dark    { background: var(--blue-bg);   color: var(--blue); }

/* ── Page Headers ── */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-header-left { }

.page-header h1 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.page-header p {
    font-size: 0.84rem;
    color: var(--text-muted);
    margin: 2px 0 0;
}

/* ── Login Page ── */
.login-wrapper {
    min-height: 100vh;
    background: var(--bg-deep);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.login-bg-pattern {
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 20% 20%, rgba(var(--accent-rgb), 0.06) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(91,141,238,0.06) 0%, transparent 50%);
    pointer-events: none;
}

.login-card {
    width: 100%; max-width: 420px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 40px;
    box-shadow: var(--shadow-lg);
    position: relative;
    z-index: 1;
}

.login-header { text-align: center; margin-bottom: 32px; }

.login-logo {
    width: 56px; height: 56px;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    border-radius: var(--radius-lg);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1.4rem; color: #0d0f14;
    margin-bottom: 16px;
    box-shadow: 0 8px 24px rgba(var(--accent-rgb), 0.35);
}

.login-title { font-family: var(--font-display); font-size: 1.4rem; color: var(--text-primary); margin-bottom: 4px; }
.login-subtitle { font-size: 0.82rem; color: var(--text-muted); }

/* ── Employee ID Badge ── */
.emp-id-badge {
    display: inline-block;
    padding: 3px 8px;
    background: var(--accent-glow);
    color: var(--accent);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    font-family: monospace;
    letter-spacing: 0.05em;
}

/* ── Divider ── */
.section-divider {
    height: 1px;
    background: var(--border);
    margin: 24px 0;
}

/* ── Net Salary Display ── */
.net-salary-display {
    background: linear-gradient(135deg, rgba(var(--accent-rgb),0.12), rgba(var(--accent-rgb),0.05));
    border: 1px solid rgba(var(--accent-rgb), 0.25);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    text-align: center;
}

.net-salary-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.net-salary-value {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
}

/* ── Search Filters ── */
.filter-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 20px;
}

.filter-bar .form-control,
.filter-bar .form-select {
    flex: 1;
    min-width: 140px;
    max-width: 220px;
}

/* ── Sidebar Overlay for mobile ── */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 999;
    backdrop-filter: blur(2px);
}

/* ── Responsive ── */
@media (max-width: 991px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay.show { display: block; }

    .main-wrapper { margin-left: 0; }

    .topbar-toggle { display: flex; }

    .page-content { padding: 20px 16px 32px; }

    .topbar-date { display: none; }
}

@media (max-width: 576px) {
    .stat-value { font-size: 1.3rem; }
    .login-card { padding: 28px 22px; }
}

/* ── Tooltip style for copy ── */
.copy-toast {
    position: fixed;
    bottom: 24px; right: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--green);
    padding: 10px 18px;
    border-radius: var(--radius);
    font-size: 0.84rem;
    z-index: 9999;
    box-shadow: var(--shadow);
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s;
    pointer-events: none;
}

.copy-toast.show { opacity: 1; transform: translateY(0); }

/* ── Loading spinner ── */
.spinner-gold {
    width: 20px; height: 20px;
    border: 2px solid var(--accent-glow);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
