/* ==========================================================================
   BIHAR TEACHER PAYROLL SYSTEM - DESIGN SYSTEM
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700&display=swap');

:root {
    /* Color Palette */
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-light: #e0e7ff;
    
    --secondary: #0f172a;
    --accent: #10b981;
    --accent-hover: #059669;
    
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --border-color: #e2e8f0;
    
    --text-main: #1e293b;
    --text-muted: #64748b;
    --text-white: #ffffff;
    
    /* Box Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-glass: 0 8px 32px 0 rgba(31, 38, 135, 0.08);
    
    /* Border Radii */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base resets */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    padding-bottom: 60px;
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    color: var(--secondary);
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-hover);
}

button, input, select, textarea {
    font-family: inherit;
}

/* ==========================================================================
   LAYOUTS & CONTAINERS
   ========================================================================== */

.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
}

.header {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: var(--text-white);
    padding: 15px 0;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-block {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-emblem {
    font-size: 24px;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
}

.logo-text h1 {
    color: var(--text-white);
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.logo-text p {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-info {
    font-size: 13px;
    text-align: right;
}

.nav-info span {
    display: block;
    color: var(--text-white);
    font-weight: 500;
}

.nav-info small {
    color: var(--text-muted);
}

/* ==========================================================================
   BUTTONS & CONTROLS
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 18px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 550;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    gap: 8px;
}

.btn-primary {
    background-color: var(--primary);
    color: var(--text-white);
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-accent {
    background-color: var(--accent);
    color: var(--text-white);
}

.btn-accent:hover {
    background-color: var(--accent-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: #f1f5f9;
    color: var(--text-main);
}

.btn-danger {
    background-color: var(--danger);
    color: var(--text-white);
}

.btn-danger:hover {
    background-color: #dc2626;
}

/* ==========================================================================
   CARDS & PANELS
   ========================================================================== */

.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: rgba(79, 70, 229, 0.15);
}

.card-title {
    font-size: 18px;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Glassmorphism for dashboards */
.glass-card {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: var(--shadow-glass);
}

/* ==========================================================================
   FORMS & INPUTS
   ========================================================================== */

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 550;
    font-size: 13px;
    color: #475569;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    background-color: #fff;
    color: var(--text-main);
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.input-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

/* ==========================================================================
   TABLES & LISTS
   ========================================================================== */

.table-responsive {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: #fff;
    margin-bottom: 24px;
}

table.payroll-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    text-align: left;
}

table.payroll-table th {
    background-color: #f8fafc;
    color: #475569;
    font-weight: 600;
    padding: 14px 16px;
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
}

table.payroll-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: middle;
    color: #334155;
    transition: var(--transition);
}

table.payroll-table tr:hover td {
    background-color: #f1f5f9;
}

table.payroll-table tr.highlight td {
    background-color: #f0fdf4;
    border-bottom-color: #bbf7d0;
}

/* ==========================================================================
   BADGES & STATUS
   ========================================================================== */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-success {
    background-color: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background-color: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background-color: #fee2e2;
    color: #991b1b;
}

.badge-info {
    background-color: #dbeafe;
    color: #1e40af;
}

/* ==========================================================================
   ALERTS & NOTIFICATIONS
   ========================================================================== */

.alert {
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 14px;
    border-left: 4px solid transparent;
}

.alert-success {
    background-color: #ecfdf5;
    color: #065f46;
    border-left-color: #10b981;
}

.alert-error {
    background-color: #fef2f2;
    color: #991b1b;
    border-left-color: #ef4444;
}

.alert-info {
    background-color: #eff6ff;
    color: #1e40af;
    border-left-color: #3b82f6;
}

/* ==========================================================================
   PORTAL LANDING PAGE
   ========================================================================== */

.portal-selection {
    min-height: calc(100vh - 150px);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 0;
}

.portal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
    width: 100%;
    max-width: 800px;
}

.portal-box {
    text-align: center;
    padding: 40px;
    cursor: pointer;
    border: 2px solid var(--border-color);
    background-color: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.portal-box:hover {
    border-color: var(--primary);
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.portal-icon {
    font-size: 48px;
    margin-bottom: 20px;
    display: inline-block;
}

.portal-box h3 {
    font-size: 20px;
    margin-bottom: 10px;
}

.portal-box p {
    color: var(--text-muted);
    font-size: 14px;
}

/* ==========================================================================
   LOGIN BOX
   ========================================================================== */

.login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 120px);
}

.login-card {
    width: 100%;
    max-width: 420px;
    padding: 32px;
}

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

.login-header h2 {
    font-size: 22px;
    margin-bottom: 6px;
}

.login-header p {
    color: var(--text-muted);
    font-size: 13px;
}

/* ==========================================================================
   DASHBOARD WIDGETS
   ========================================================================== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-widget {
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.stat-widget:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: rgba(79, 70, 229, 0.2);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
}

.stat-icon-primary { background-color: #e0e7ff; color: var(--primary); }
.stat-icon-success { background-color: #d1fae5; color: var(--success); }
.stat-icon-warning { background-color: #fef3c7; color: var(--warning); }
.stat-icon-info { background-color: #dbeafe; color: var(--info); }

.stat-info h4 {
    font-size: 24px;
    font-weight: 700;
}

.stat-info p {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 500;
}

/* ==========================================================================
   TABS INTERFACE
   ========================================================================== */

.tabs-nav {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
    gap: 10px;
    overflow-x: auto;
}

.tab-link {
    padding: 10px 18px;
    font-weight: 500;
    font-size: 14px;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    transition: var(--transition);
    white-space: nowrap;
}

.tab-link:hover {
    color: var(--primary);
}

.tab-link.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ==========================================================================
   ABSENTEE SHEET PRINT LAYOUT (OFFICIAL LOOK)
   ========================================================================== */

.official-absentee-header {
    text-align: center;
    margin-bottom: 25px;
    border-bottom: 2px solid #000;
    padding-bottom: 15px;
    display: none; /* Only visible in print or specific preview */
}

.official-absentee-header h2 {
    font-size: 22px;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.official-absentee-header h3 {
    font-size: 16px;
    margin-bottom: 10px;
}

.meta-details-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px 40px;
    text-align: left;
    margin-bottom: 15px;
    font-size: 13px;
    font-weight: 500;
}

.certification-text {
    margin-top: 25px;
    font-size: 13px;
    line-height: 1.6;
    text-align: justify;
    font-weight: 500;
}

.official-stamps-block {
    display: flex;
    justify-content: space-between;
    margin-top: 60px;
    padding: 0 20px;
}

.stamp-box {
    text-align: center;
    border-top: 1px dashed #000;
    width: 200px;
    padding-top: 8px;
    font-size: 12px;
    font-weight: bold;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ==========================================================================
   PRINT MEDIA RULES (For Clean PDF Export)
   ========================================================================== */

@media print {
    body {
        background-color: #fff;
        color: #000;
        padding-bottom: 0;
        font-size: 11px;
    }
    
    .header, .nav-menu, .btn, .nav-info, .card-title form, .no-print {
        display: none !important;
    }
    
    .container {
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    .card {
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        margin: 0 !important;
        background: transparent !important;
    }
    
    .table-responsive {
        border: none !important;
        border-radius: 0 !important;
        overflow: visible !important;
    }
    
    table.payroll-table {
        border-collapse: collapse;
        font-size: 10px !important;
    }
    
    table.payroll-table th, table.payroll-table td {
        border: 1px solid #000 !important;
        padding: 6px 8px !important;
        color: #000 !important;
        background: transparent !important;
    }
    
    .official-absentee-header {
        display: block !important;
    }
}
