/* Pamposh Payroll PHP — handcrafted styles to match the WinForms theme.
 * The base reset + grid utilities are loaded via Tailwind CDN; this file
 * carries the brand-specific tokens, panels, buttons, and components.
 */

:root {
    --primary: #3C75F5;
    --primary-hover: #2D5FD7;
    --primary-light: #50B4FF;
    --sidebar-bg: #141B2D;
    --sidebar-bg-accent: #1C2438;
    --sidebar-hover: #242F4B;
    --sidebar-active: #3C75F5;
    --sidebar-text: #BEC8DC;
    --sidebar-text-active: #FFFFFF;
    --bg: #F3F6FC;
    --card-bg: #FFFFFF;
    --card-border: #E1E6F0;
    --success: #28B463;
    --warning: #F5A823;
    --danger:  #E84141;
    --purple:  #9B50DC;
    --muted:   #78849E;
    --text-primary: #1C243C;
    --text-secondary: #64708A;
    --header-bg: #F5F7FC;
    --grid-line: #E8ECF4;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; font-family: 'Segoe UI', 'Inter', system-ui, sans-serif; color: var(--text-primary); background: var(--bg); }
body { font-size: 14px; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ------- App Shell ------- */
.app-shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar { background: var(--sidebar-bg); color: var(--sidebar-text); display: flex; flex-direction: column; }
.sidebar .brand { padding: 16px 20px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid rgba(255,255,255,0.06); }
.sidebar .brand-tile {
    width: 50px; height: 50px; border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    display: flex; align-items: center; justify-content: center;
    font-family: 'Segoe UI Black', sans-serif; font-weight: 900; font-size: 22px; color: white;
}
.sidebar .brand-text .name { font-size: 14px; font-weight: 600; color: white; }
.sidebar .brand-text .sub { font-size: 11px; color: #A0AECD; }
.sidebar nav { flex: 1; overflow-y: auto; padding: 8px 0; }
.sidebar nav .section { padding: 14px 24px 6px; font-size: 10px; font-weight: 700; letter-spacing: 0.5px; color: #6E7D9B; text-transform: uppercase; }
.sidebar nav a.nav-link {
    display: flex; align-items: center; gap: 14px;
    padding: 11px 24px; color: var(--sidebar-text); text-decoration: none;
    transition: background 0.12s;
    font-size: 13.5px;
}
.sidebar nav a.nav-link .icon { width: 22px; text-align: center; opacity: 0.9; font-size: 16px; }
.sidebar nav a.nav-link:hover { background: var(--sidebar-hover); color: white; }
.sidebar nav a.nav-link.active {
    background: var(--sidebar-active); color: white;
    border-radius: 0 12px 12px 0; margin-right: 12px;
    box-shadow: 0 6px 16px rgba(60,117,245,0.30);
}
.sidebar .footer {
    border-top: 1px solid rgba(255,255,255,0.06);
    padding: 14px 18px;
    background: var(--sidebar-bg);
}
.sidebar .footer .user-name { font-size: 12px; color: #BEC8DC; }
.sidebar .footer .user-role { font-size: 11px; color: #92A0BD; margin-top: 2px; }
.sidebar .footer .logout {
    display: inline-block; margin-top: 8px;
    padding: 5px 14px; border-radius: 6px;
    background: rgba(232,65,65,0.18); color: #FF8585;
    font-size: 11.5px; text-decoration: none;
}
.sidebar .footer .logout:hover { background: rgba(232,65,65,0.30); }

/* ------- Main column ------- */
.main { display: flex; flex-direction: column; min-width: 0; }
.topbar { background: var(--bg); border-bottom: 1px solid var(--card-border); padding: 16px 26px; }
.topbar h1 { font-size: 19px; font-weight: 600; margin: 0; }
.topbar .sub { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.content { padding: 22px 26px 32px; flex: 1; }

/* ------- Cards / panels ------- */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 1px 2px rgba(20,27,45,0.03);
}
.card + .card { margin-top: 14px; }
.card .card-title { font-size: 14px; font-weight: 600; color: var(--text-primary); margin: 0 0 12px; }

/* ------- Stat tiles ------- */
.stat-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; margin-bottom: 18px; }
.stat-card {
    background: white; border: 1px solid var(--card-border); border-radius: 14px;
    padding: 16px; position: relative;
}
.stat-card .title { font-size: 10.5px; font-weight: 700; color: var(--text-secondary); letter-spacing: 0.5px; text-transform: uppercase; }
.stat-card .value { font-size: 28px; font-weight: 700; color: var(--text-primary); margin: 6px 0 0; }
.stat-card .sub { font-size: 11px; color: var(--text-secondary); margin-top: 4px; }
.stat-card .icon {
    position: absolute; top: 16px; right: 16px;
    width: 36px; height: 36px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 16px;
}
.stat-card.primary .icon { background: var(--primary); }
.stat-card.success .icon { background: var(--success); }
.stat-card.warning .icon { background: var(--warning); }
.stat-card.purple  .icon { background: var(--purple); }
.stat-card.danger  .icon { background: var(--danger); }
.stat-card.muted   .icon { background: var(--muted); }

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

/* ------- Buttons ------- */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 9px 18px; border-radius: 9px; border: 0;
    font-size: 13px; font-weight: 600; cursor: pointer;
    transition: background 0.12s, transform 0.05s;
}
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--primary); color: white; }
.btn.primary:hover { background: var(--primary-hover); }
.btn.success { background: var(--success); color: white; }
.btn.success:hover { filter: brightness(0.95); }
.btn.danger { background: var(--danger); color: white; }
.btn.warning { background: var(--warning); color: white; }
.btn.purple  { background: var(--purple); color: white; }
.btn.soft { background: rgba(60,117,245,0.10); color: var(--primary); }
.btn.soft:hover { background: rgba(60,117,245,0.18); }
.btn.soft.danger { background: rgba(232,65,65,0.10); color: var(--danger); }
.btn.soft.success { background: rgba(40,180,99,0.12); color: var(--success); }
.btn.soft.purple  { background: rgba(155,80,220,0.12); color: var(--purple); }
.btn.ghost { background: transparent; color: var(--text-secondary); }
.btn.ghost:hover { background: var(--bg); }
.btn.sm { padding: 6px 12px; font-size: 12px; }

/* ------- Forms ------- */
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-bottom: 14px; }
.field { display: flex; flex-direction: column; }
.field label { font-size: 11px; color: var(--text-secondary); margin-bottom: 5px; font-weight: 600; }
.field input[type=text], .field input[type=password], .field input[type=email],
.field input[type=number], .field input[type=date], .field input[type=tel],
.field select, .field textarea {
    border: 1px solid var(--card-border); background: white;
    border-radius: 8px; padding: 9px 11px; font-size: 13px; color: var(--text-primary);
    font-family: inherit;
    transition: border-color 0.12s, box-shadow 0.12s;
}
.field input:focus, .field select:focus, .field textarea:focus {
    outline: 0; border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(60,117,245,0.15);
}
.field .hint { font-size: 11px; color: var(--text-secondary); margin-top: 4px; }

/* ------- Tables ------- */
.data-table { width: 100%; border-collapse: collapse; }
.data-table thead th {
    background: var(--header-bg); border-bottom: 1px solid var(--grid-line);
    padding: 10px 12px; text-align: left; font-size: 11px;
    font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px;
}
.data-table tbody td { padding: 11px 12px; border-bottom: 1px solid var(--grid-line); font-size: 13px; vertical-align: middle; }
.data-table tbody tr:hover { background: rgba(60,117,245,0.04); }
.data-table tbody tr.selected { background: rgba(60,117,245,0.10); }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table .net { font-weight: 600; color: var(--success); }
.table-wrap { overflow-x: auto; border-radius: 12px; border: 1px solid var(--card-border); background: white; }

/* ------- Badges ------- */
.badge {
    display: inline-block; padding: 3px 9px; border-radius: 20px;
    font-size: 11px; font-weight: 700;
}
.badge.success { background: rgba(40,180,99,0.15); color: var(--success); }
.badge.warning { background: rgba(245,168,35,0.15); color: var(--warning); }
.badge.danger { background: rgba(232,65,65,0.15); color: var(--danger); }
.badge.muted { background: rgba(120,132,158,0.18); color: var(--muted); }
.badge.purple { background: rgba(155,80,220,0.15); color: var(--purple); }

/* ------- Toolbar ------- */
.toolbar {
    display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between;
    gap: 14px; margin-bottom: 14px;
}
.toolbar .left { display: flex; flex-wrap: wrap; gap: 14px; align-items: end; }
.toolbar .right { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.toolbar .field { min-width: 160px; }

/* ------- Flash messages ------- */
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; font-size: 13px; border: 1px solid; }
.flash.success { background: #E8F5E9; border-color: #B3E4C0; color: #1F7A3A; }
.flash.danger  { background: #FCE6E6; border-color: #F2B4B4; color: #B43030; }
.flash.warning { background: #FEF6E0; border-color: #F2D87A; color: #886415; }
.flash.info    { background: #E8EEFB; border-color: #B6C7F2; color: #2D4D9C; }

/* ------- Tabs ------- */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--card-border); margin-bottom: 16px; }
.tabs button, .tabs a {
    background: transparent; border: 0; padding: 11px 18px; font-size: 13px;
    color: var(--text-secondary); cursor: pointer; font-weight: 600; border-bottom: 3px solid transparent;
    margin-bottom: -2px;
}
.tabs button.active, .tabs a.active { color: var(--primary); border-bottom-color: var(--primary); }
.tabs button:hover, .tabs a:hover { color: var(--text-primary); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ------- Login page ------- */
.login-wrap { display: grid; grid-template-columns: 420px 1fr; min-height: 100vh; }
.login-brand {
    background: linear-gradient(135deg, var(--sidebar-bg), #14306E);
    color: white; padding: 60px 50px;
    display: flex; flex-direction: column;
}
.login-brand .logo {
    width: 88px; height: 88px; border-radius: 18px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    display: flex; align-items: center; justify-content: center; color: white;
    font-family: 'Segoe UI Black', sans-serif; font-weight: 900; font-size: 38px;
    margin-bottom: 36px;
}
.login-brand h1 { font-size: 26px; font-weight: 600; margin: 0 0 4px; }
.login-brand .tagline { color: #C4D2EC; font-size: 13px; margin-bottom: 36px; }
.login-brand .features { color: #B6CAEC; font-size: 12.5px; line-height: 1.9; flex: 1; }
.login-brand .footer { font-size: 10.5px; color: #809CC5; }

.login-right { display: flex; align-items: center; justify-content: center; padding: 40px; background: var(--bg); }
.login-card { width: 100%; max-width: 540px; background: white; border-radius: 18px; padding: 8px; box-shadow: 0 12px 30px rgba(20,27,45,0.08); }

/* ------- Drop zone (Import Excel) ------- */
.dropzone {
    border: 2px dashed var(--primary); border-radius: 14px;
    padding: 36px 28px; text-align: center; color: var(--primary);
    background: rgba(60,117,245,0.04); transition: background 0.14s;
}
.dropzone.dragging { background: rgba(60,117,245,0.14); }
.dropzone .big { font-size: 18px; font-weight: 600; color: var(--text-primary); margin: 10px 0 4px; }
.dropzone .hint { font-size: 12px; color: var(--text-secondary); }

/* ------- Misc ------- */
.row-actions { display: flex; gap: 6px; }
.muted { color: var(--text-secondary); }
.title-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.modal-overlay {
    position: fixed; inset: 0; background: rgba(20,27,45,0.45); display: flex; align-items: center; justify-content: center;
    z-index: 100;
}
.modal { background: white; border-radius: 16px; padding: 22px; width: 100%; max-width: 720px; max-height: 90vh; overflow-y: auto; }
.modal h3 { margin-top: 0; }
.modal .actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }

/* Severity row coloring for documents/alerts */
tr.sev-expired td:first-child { border-left: 3px solid var(--danger); }
tr.sev-critical td:first-child { border-left: 3px solid var(--danger); }
tr.sev-warning td:first-child { border-left: 3px solid var(--warning); }
tr.sev-info td:first-child { border-left: 3px solid var(--purple); }
tr.sev-valid td:first-child { border-left: 3px solid var(--success); }

.text-expired, .text-critical { color: var(--danger); font-weight: 600; }
.text-warning { color: var(--warning); font-weight: 600; }
.text-info { color: var(--purple); font-weight: 600; }
.text-valid { color: var(--success); font-weight: 600; }
