/* ==========================================
   DESIGN SYSTEM & VARIABLES (BLUE & WHITE)
   ========================================== */
:root {
    /* Color Palette */
    --primary: #1e3c72;
    --primary-light: #2a5298;
    --primary-dark: #122240;
    --primary-gradient: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    --accent: #00bcd4;
    --accent-dark: #0097a7;
    
    /* Semantic Colors */
    --success: #2e7d32;
    --success-light: #e8f5e9;
    --warning: #ef6c00;
    --warning-light: #fff3e0;
    --danger: #c62828;
    --danger-light: #ffebee;
    --info: #0277bd;
    --info-light: #e1f5fe;
    
    /* Surface Backgrounds */
    --background: #f4f7f6;
    --surface: #ffffff;
    --surface-glass: rgba(255, 255, 255, 0.85);
    --border-glass: rgba(255, 255, 255, 0.4);
    
    /* Typography */
    --text-primary: #1a237e;
    --text-secondary: #37474f;
    --text-muted: #78909c;
    --text-light: #ffffff;
    
    /* Borders & Shadows */
    --border-color: #d0d7de;
    --border-radius-sm: 8px;
    --border-radius-md: 16px;
    --border-radius-lg: 24px;
    
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
    --shadow-md: 0 8px 24px rgba(30,60,114,0.08);
    --shadow-lg: 0 16px 48px rgba(30,60,114,0.15);
    --shadow-glass: 0 8px 32px 0 rgba(31, 38, 135, 0.05);
    
    /* Dimensions */
    --header-height: 94px;
    --sidebar-width: 260px;
    --transition-speed: 0.25s;
}

/* ==========================================
   RESET & FOUNDATIONS
   ========================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--background);
    color: var(--text-secondary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.5;
    overflow-x: hidden;
}

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

.hidden {
    display: none !important;
}

/* ==========================================
   HEADER NAVIGATION
   ========================================== */
.app-header {
    height: var(--header-height);
    background: var(--surface);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.top-support-bar {
    height: 34px;
    background: var(--primary-dark);
    color: var(--text-light);
    font-size: 0.78rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.support-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.support-container a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 700;
    margin-left: 4px;
    transition: color var(--transition-speed);
}

.support-container a:hover {
    color: white;
    text-decoration: underline;
}

.support-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

@media (max-width: 600px) {
    .top-support-bar {
        height: auto;
        padding: 6px 0;
    }
    .support-container {
        flex-direction: column;
        gap: 4px;
        text-align: center;
        font-size: 0.72rem;
    }
    :root {
        --header-height: 110px;
    }
}

.header-container {
    max-width: 1400px;
    height: 60px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    margin-right: 2.5rem;
}

.brand-logo-img {
    height: 46px;
    width: auto;
    object-fit: contain;
}

.logo-icon {
    width: 42px;
    height: 42px;
    background: var(--primary-gradient);
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    box-shadow: 0 4px 10px rgba(30,60,114,0.3);
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1.2;
}

.brand-subtitle {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent-dark);
    letter-spacing: 0.5px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Language Toggle Button styling */
.lang-toggle {
    font-weight: 700;
    border-color: var(--primary);
    color: var(--primary);
    padding: 6px 12px;
    font-size: 0.85rem;
}
.lang-toggle:hover {
    background: rgba(30,60,114,0.05);
}

/* User Badge */
.user-status-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-badge {
    background: rgba(30,60,114,0.06);
    color: var(--primary);
    border: 1px solid rgba(30,60,114,0.1);
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.85rem;
}

.role-lbl {
    text-transform: uppercase;
    font-weight: 800;
    font-size: 0.75rem;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.4rem;
    color: var(--primary);
    cursor: pointer;
}

/* ==========================================
   BUTTONS
   ========================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: none;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-speed);
    padding: 10px 18px;
    font-size: 0.95rem;
}

.btn-primary {
    background: var(--primary-gradient);
    color: var(--text-light);
}
.btn-primary:hover:not(:disabled) {
    box-shadow: 0 4px 12px rgba(30,60,114,0.3);
    transform: translateY(-1px);
}

.btn-secondary {
    background: #e2e8f0;
    color: var(--primary);
}
.btn-secondary:hover:not(:disabled) {
    background: #cbd5e1;
}

.btn-success {
    background: linear-gradient(135deg, #2e7d32 0%, #1b5e20 100%);
    color: var(--text-light);
}
.btn-success:hover:not(:disabled) {
    box-shadow: 0 4px 12px rgba(46,125,50,0.3);
}

.btn-danger {
    background: linear-gradient(135deg, #c62828 0%, #b71c1c 100%);
    color: var(--text-light);
}
.btn-danger:hover:not(:disabled) {
    box-shadow: 0 4px 12px rgba(198,40,40,0.3);
}

.btn-info {
    background: linear-gradient(135deg, #0288d1 0%, #01579b 100%);
    color: var(--text-light);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}
.btn-outline:hover:not(:disabled) {
    background: rgba(0,0,0,0.02);
    border-color: var(--text-secondary);
}

.btn-logout {
    background: rgba(198, 40, 40, 0.08);
    color: var(--danger);
    border: 1px solid rgba(198, 40, 40, 0.15);
    padding: 6px 14px;
    font-size: 0.85rem;
}
.btn-logout:hover {
    background: var(--danger);
    color: var(--text-light);
}

.btn-block {
    width: 100%;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 1.05rem;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

button:disabled, .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
}

/* ==========================================
   APP CONTAINER
   ========================================== */
.app-main {
    flex: 1;
    margin-top: var(--header-height);
    width: 100%;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
    padding: 1.5rem;
}

.view-section {
    display: none;
    animation: slideUpFade 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.view-section.active {
    display: block;
}

@keyframes slideUpFade {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================
   VIEW: PUBLIC PANEL & BROADCAST NOTICES
   ========================================== */
.public-hero {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 2.5rem;
    align-items: center;
    padding: 1.5rem 0 3rem 0;
}

.badge-tag {
    background: rgba(30,60,114,0.08);
    color: var(--primary);
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 700;
    display: inline-block;
    margin-bottom: 1rem;
}

.hero-text-block h1 {
    font-size: 3rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1.15;
    margin-bottom: 1.2rem;
}

.hero-text-block p {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

/* Notice Panel */
.announcements-panel {
    padding: 1.5rem;
    height: 250px;
    display: flex;
    flex-direction: column;
}

.announcements-panel h3 {
    font-size: 1.15rem;
    color: var(--primary);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.notices-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-right: 4px;
}

.notice-item {
    background: var(--background);
    padding: 10px 14px;
    border-radius: var(--border-radius-sm);
    border-left: 4px solid var(--accent);
    font-size: 0.85rem;
}

.notice-item .date {
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.75rem;
    margin-bottom: 3px;
}

.notice-item .msg {
    color: var(--text-secondary);
    font-weight: 500;
}

/* Gateway Grid Options */
.portal-gateways-container {
    border-top: 1px solid var(--border-color);
    padding-top: 3rem;
}

.section-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 2rem;
    text-align: center;
}

.gateways-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}

.gateway-card {
    background: var(--surface);
    padding: 2rem 1.5rem;
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    text-align: center;
    transition: all var(--transition-speed);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 280px;
}

.gateway-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.gateway-icon {
    font-size: 2.2rem;
    margin-bottom: 12px;
}

.gateway-card h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 8px;
}

.gateway-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1.2rem;
    flex-grow: 1;
}

.gateway-card.highlight-register {
    background: var(--primary-gradient);
    color: var(--text-light);
    border: none;
}
.gateway-card.highlight-register h3 {
    color: var(--text-light);
}
.gateway-card.highlight-register p {
    color: rgba(255,255,255,0.85);
}
.gateway-card.highlight-register .gateway-icon {
    color: var(--accent);
}
.gateway-card.highlight-register .btn-primary {
    background: var(--surface);
    color: var(--primary);
}
.gateway-card.highlight-register .btn-primary:hover {
    background: #f1f5f9;
    box-shadow: 0 4px 12px rgba(255,255,255,0.2);
}

.admin-hidden-trigger-box {
    margin-top: 3rem;
    display: flex;
    justify-content: center;
}

/* ==========================================
   GLASS FORM STYLINGS
   ========================================== */
.form-container {
    max-width: 750px;
    margin: 1.5rem auto;
    padding: 2.5rem;
}

.glass-card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-md);
}

.form-header {
    text-align: center;
    margin-bottom: 2rem;
}

.form-header h2 {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 6px;
}

.form-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.interactive-form {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.2rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: left;
}

.form-group.full-width {
    grid-column: span 2;
}

.form-group label {
    font-weight: 600;
    color: var(--primary);
    font-size: 0.9rem;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    font-size: 1rem;
}

.input-wrapper input, .input-wrapper select,
.form-group input, .form-group select {
    width: 100%;
    padding: 10px 14px 10px 42px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    outline: none;
    background: var(--surface);
    color: var(--text-secondary);
    transition: all var(--transition-speed);
}

/* Fields without wrapper icons */
.form-group input:not([type]), 
.form-group input[type="text"]:not(.input-wrapper input),
.form-group input[type="number"]:not(.input-wrapper input),
.form-group input[type="tel"]:not(.input-wrapper input),
.form-group input[type="date"],
.form-group select:not(.input-wrapper select) {
    padding: 10px 14px;
}

.input-wrapper input:focus, .input-wrapper select:focus,
.form-group input:focus, .form-group select:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(30,60,114,0.12);
}

.btn-toggle-password {
    position: absolute;
    right: 14px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
}

/* Custom Checkbox Support */
.checkbox-container {
    display: flex;
    align-items: center;
    position: relative;
    padding-left: 28px;
    cursor: pointer;
    font-size: 0.85rem;
    user-select: none;
    color: var(--text-secondary);
    font-weight: 600;
}
.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}
.checkmark {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    height: 18px;
    width: 18px;
    background-color: #eee;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    transition: background-color 0.2s;
}
.checkbox-container:hover input ~ .checkmark {
    background-color: #ccc;
}
.checkbox-container input:checked ~ .checkmark {
    background-color: var(--primary);
    border-color: var(--primary);
}
.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}
.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}
.checkbox-container .checkmark:after {
    left: 6px;
    top: 2px;
    width: 4px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.otp-support-box {
    margin: 6px 0;
}

/* ==========================================
   VIEW: LOGIN SCREEN WRAPPERS
   ========================================== */
.login-wrapper {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 2.5rem;
    align-items: start;
    max-width: 1100px;
    margin: 1.5rem auto;
}

.login-card {
    margin: 0;
    padding: 2rem;
}

.demo-logins-card {
    padding: 2rem;
}
.demo-logins-card h3 {
    font-size: 1.1rem;
    color: var(--primary);
    margin-bottom: 8px;
}
.demo-logins-card p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.demo-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.demo-item {
    background: var(--background);
    border: 1px solid var(--border-color);
    padding: 10px 12px;
    border-radius: var(--border-radius-sm);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all var(--transition-speed);
}
.demo-item:hover {
    border-color: var(--primary);
    background: rgba(30,60,114,0.03);
    transform: translateX(4px);
}
.demo-item .item-header {
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 3px;
}
.demo-item .item-body {
    font-family: monospace;
}

/* ==========================================
   DASHBOARD SKELETON (SIDEBAR + CONTENT)
   ========================================== */
.dashboard-layout {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    gap: 1.5rem;
    align-items: start;
    min-height: calc(100vh - var(--header-height) - 3rem);
}

.dashboard-sidebar {
    background: var(--surface);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    overflow: hidden;
    position: sticky;
    top: calc(var(--header-height) + 1.5rem);
}

.sidebar-header {
    background: var(--primary-gradient);
    padding: 1.2rem;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1rem;
}

.sidebar-menu {
    list-style: none;
    padding: 0.8rem 0;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 1.2rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all var(--transition-speed);
    border-left: 4px solid transparent;
}
.sidebar-link:hover, .sidebar-link.active {
    color: var(--primary);
    background: rgba(30,60,114,0.04);
    border-left-color: var(--primary);
}

.dashboard-content {
    background: transparent;
}

.dashboard-tab-panel {
    display: none;
}
.dashboard-tab-panel.active {
    display: block;
}

.dashboard-banner {
    background: var(--surface);
    padding: 2rem;
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}
.dashboard-banner h2 {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 4px;
}

/* Stats grids inside portals */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

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

.stat-card.mini {
    background: var(--surface);
    padding: 1.2rem;
    border-radius: var(--border-radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 14px;
}
.stat-card.mini i {
    width: 48px;
    height: 48px;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.bg-soft-primary { background: rgba(30,60,114,0.07); color: var(--primary); }
.bg-soft-success { background: rgba(46,125,50,0.07); color: var(--success); }
.bg-soft-warning { background: rgba(239,108,0,0.07); color: var(--warning); }
.bg-soft-info { background: rgba(2,119,189,0.07); color: var(--info); }

.stat-card.mini h3 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1.2;
}
.stat-card.mini p {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* Metadata summary cards */
.teacher-meta-card {
    padding: 1.5rem;
}
.card-grid-meta {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}
.card-grid-meta small {
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
}
.card-grid-meta p {
    font-weight: 700;
    color: var(--primary);
    font-size: 1.05rem;
}

/* ==========================================
   STUDENT REGISTRATION LAYOUTS
   ========================================== */
.split-layout {
    display: grid;
    grid-template-columns: 1fr 1.3fr;
    gap: 1.5rem;
}
.panel-form {
    padding: 1.5rem;
}
.panel-form h3, .panel-list h3 {
    font-size: 1.1rem;
    color: var(--primary);
    margin-bottom: 1.2rem;
    display: flex;
    align-items: center;
    gap: 6px;
}
.panel-list {
    padding: 1.5rem;
}
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* ==========================================
   DAILY ATTENDANCE & CAMERA ONLY STYLING
   ========================================== */
.timer-accelerator-banner {
    background: #fff9db;
    border: 1px solid #ffe066;
    color: #f59f00;
    padding: 10px 14px;
    border-radius: var(--border-radius-sm);
    margin-bottom: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.85rem;
    font-weight: 600;
}

.attendance-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.camera-card {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}
.camera-card h3 {
    font-size: 1.15rem;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Target viewfinder styled to look like camera */
.webcam-viewport {
    width: 100%;
    height: 250px;
    background: #000;
    border-radius: var(--border-radius-sm);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid #1e293b;
    margin: 1rem 0;
}
.webcam-viewport video, .webcam-viewport img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.webcam-placeholder {
    color: #475569;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}
.webcam-placeholder i {
    font-size: 2.5rem;
}

/* Target Camera Only Overlays */
.viewfinder-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 5;
}
.viewfinder-overlay .corner {
    position: absolute;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.4);
}
.viewfinder-overlay .corner.tl { top: 15px; left: 15px; border-right: none; border-bottom: none; }
.viewfinder-overlay .corner.tr { top: 15px; right: 15px; border-left: none; border-bottom: none; }
.viewfinder-overlay .corner.bl { bottom: 15px; left: 15px; border-right: none; border-top: none; }
.viewfinder-overlay .corner.br { bottom: 15px; right: 15px; border-left: none; border-top: none; }

.gps-indicator-box {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--success);
    background: var(--success-light);
    padding: 6px 12px;
    border-radius: 6px;
    margin: 8px 0;
    align-self: center;
}

.camera-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
}

/* Timer Countdown HUD box */
.timer-countdown-box {
    background: #0f172a;
    border-radius: var(--border-radius-sm);
    padding: 12px;
    color: var(--text-light);
    text-align: center;
    border: 1px solid #1e293b;
    margin-bottom: 12px;
}
.timer-countdown-box .timer-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--accent);
    margin-bottom: 4px;
}
.timer-countdown-box .timer-digits {
    font-size: 1.8rem;
    font-family: monospace;
    font-weight: 800;
    letter-spacing: 1px;
}

/* ==========================================
   DATA TABLES
   ========================================== */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    border-radius: var(--border-radius-sm);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.8rem;
    text-align: left;
}
.data-table th {
    background: rgba(30,60,114,0.04);
    color: var(--primary);
    font-weight: 700;
    font-size: 0.85rem;
    padding: 12px 14px;
    border-bottom: 2px solid var(--border-color);
}
.data-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.85rem;
}
.data-table tr:hover {
    background: rgba(30,60,114,0.01);
}

.attendance-thumbnail {
    width: 54px;
    height: 38px;
    border-radius: 4px;
    object-fit: cover;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: transform 0.2s;
}
.attendance-thumbnail:hover {
    transform: scale(1.15);
}

.badge {
    padding: 3px 10px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    display: inline-block;
}
.badge-success { background: var(--success-light); color: var(--success); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-danger { background: var(--danger-light); color: var(--danger); }
.badge-info { background: var(--info-light); color: var(--info); }

/* ==========================================
   SEARCH LAYOUT
   ========================================== */
.search-form-row {
    display: flex;
    gap: 10px;
}
.search-form-row input {
    flex: 1;
    padding: 10px 14px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    outline: none;
}
.search-results-box {
    background: var(--background);
    padding: 1.2rem;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
}
.search-results-box h4 {
    color: var(--primary);
    margin-bottom: 10px;
}

/* ==========================================
   MODAL DIALOG DIALOGS
   ========================================== */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(18, 34, 64, 0.5);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 1.5rem;
    animation: fadeIn 0.2s ease forwards;
}

.modal-card {
    background: var(--surface);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-lg);
    padding: 2.2rem;
    max-width: 480px;
    width: 100%;
    text-align: center;
    position: relative;
    animation: scaleUp 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes scaleUp {
    from { transform: scale(0.9) translateY(20px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

.modal-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
}
.modal-card h2 {
    color: var(--primary);
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 6px;
}
.modal-card p {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 1.2rem;
}

.credentials-box {
    background: var(--background);
    border: 1px solid var(--border-color);
    padding: 1rem;
    border-radius: var(--border-radius-sm);
    margin-bottom: 1rem;
    text-align: left;
}
.cred-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.95rem;
    margin-bottom: 6px;
}
.cred-row:last-child { margin-bottom: 0; }
.cred-row span { color: var(--text-secondary); font-weight: 500; }
.cred-row strong { color: var(--primary); font-family: monospace; }

.modal-alert {
    background: var(--info-light);
    color: var(--info);
    border-radius: var(--border-radius-sm);
    padding: 10px 12px;
    font-size: 0.8rem;
    text-align: left;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

/* Large Photo modal and zoom box */
.modal-card.modal-large {
    max-width: 780px;
    text-align: left;
    padding: 1.5rem;
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}
.modal-header h3 {
    color: var(--primary);
    font-size: 1.1rem;
}
.photo-controls-group {
    display: flex;
    align-items: center;
    gap: 8px;
}
.btn-close-modal {
    background: none;
    border: none;
    font-size: 1.3rem;
    color: var(--text-muted);
    cursor: pointer;
}
.photo-viewer-body {
    width: 100%;
    height: 480px;
    background: #000;
    overflow: auto;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}
.photo-viewer-body img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* ==========================================
   PRINT READY SLIPS & ID CARDS
   ========================================== */

/* ID Card Layout Mockup */
.id-card-layout {
    width: 300px;
    height: 460px;
    background: #ffffff;
    border: 2px solid var(--primary);
    border-radius: var(--border-radius-md);
    margin: 1.5rem auto;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    text-align: center;
}
.id-card-layout .id-header {
    background: var(--primary-gradient);
    color: var(--text-light);
    padding: 14px 10px;
}
.id-card-layout .id-header h4 {
    font-size: 0.95rem;
    font-weight: 800;
}
.id-card-layout .id-header p {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent);
    margin: 0;
}
.id-card-layout .id-photo-frame {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    border: 3px solid var(--accent);
    margin: 20px auto 12px auto;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
}
.id-card-layout .id-photo-frame i {
    font-size: 3.5rem;
    color: var(--text-muted);
}
.id-card-layout .id-photo-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.id-card-layout .id-name {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 2px;
}
.id-card-layout .id-role {
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 700;
    background: rgba(30,60,114,0.08);
    color: var(--primary);
    padding: 3px 12px;
    border-radius: 50px;
    display: inline-block;
    margin-bottom: 16px;
    align-self: center;
}
.id-card-layout .id-details-box {
    text-align: left;
    padding: 0 20px;
    font-size: 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-grow: 1;
}
.id-card-layout .id-row-meta {
    display: flex;
    justify-content: space-between;
}
.id-card-layout .id-row-meta span { color: var(--text-muted); font-weight: 600; }
.id-card-layout .id-row-meta strong { color: var(--text-secondary); }

.id-card-layout .id-barcode-stub {
    border-top: 1px dashed var(--border-color);
    padding: 10px 0;
    font-family: monospace;
    font-size: 0.65rem;
    color: var(--text-muted);
    background: #f8fafc;
}
.barcode-mockup {
    height: 24px;
    background: repeating-linear-gradient(90deg, #1e293b, #1e293b 2px, transparent 2px, transparent 6px);
    width: 180px;
    margin: 2px auto 4px auto;
}

/* Salary Slip Layout Mockup */
.salary-slip-box {
    border: 2px double var(--primary);
    padding: 2.5rem;
    background: #ffffff;
    max-width: 650px;
    margin: 1.5rem auto;
    text-align: left;
}
.salary-slip-box .slip-header {
    text-align: center;
    border-bottom: 2px solid var(--primary);
    padding-bottom: 12px;
    margin-bottom: 1.5rem;
}
.salary-slip-box .slip-header h2 {
    font-size: 1.5rem;
    color: var(--primary);
    font-weight: 800;
}
.salary-slip-box .slip-header p {
    font-size: 0.8rem;
    color: var(--text-muted);
}
.salary-slip-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1.2rem;
    margin-bottom: 1.2rem;
}
.salary-slip-row {
    display: flex;
    justify-content: space-between;
}
.salary-slip-row span { color: var(--text-muted); font-weight: 500; }
.salary-slip-row strong { color: var(--text-secondary); }

.slip-calculations-table {
    width: 100%;
    margin-top: 1rem;
    font-size: 0.9rem;
}
.slip-calculations-table th {
    border-bottom: 2px solid var(--border-color);
    padding: 8px 0;
    color: var(--primary);
}
.slip-calculations-table td {
    padding: 8px 0;
    border-bottom: 1px dashed var(--border-color);
}
.slip-total-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 1.5rem;
    padding-top: 12px;
    border-top: 2px solid var(--primary);
    font-size: 1.15rem;
    color: var(--primary);
}

/* ==========================================
   APP FOOTER
   ========================================== */
.app-footer {
    background: var(--surface);
    border-top: 1px solid var(--border-color);
    padding: 1.2rem;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: auto;
}

/* ==========================================
   TOAST NOTIFICATION ENGINE
   ========================================== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.toast {
    background: var(--surface);
    color: var(--text-secondary);
    border-radius: var(--border-radius-sm);
    box-shadow: var(--shadow-lg);
    border-left: 6px solid var(--primary);
    padding: 12px 18px;
    min-width: 280px;
    max-width: 380px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.toast.toast-success { border-left-color: var(--success); }
.toast.toast-danger { border-left-color: var(--danger); }
.toast.toast-warning { border-left-color: var(--warning); }
.toast.toast-info { border-left-color: var(--info); }
.toast-message { font-weight: 600; font-size: 0.85rem; }

/* ==========================================
   PRINT STYLES (NO PRINT MODIFIERS)
   ========================================== */
@media print {
    body {
        background: white !important;
        color: black !important;
    }
    .app-header, .app-footer, .dashboard-sidebar, .modal-backdrop:not(.print-ready-card), 
    .no-print, .modal-header, .timer-accelerator-banner, .toast-container {
        display: none !important;
    }
    .app-main {
        margin: 0 !important;
        padding: 0 !important;
    }
    .modal-backdrop.print-ready-card {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        background: transparent !important;
        backdrop-filter: none !important;
        display: block !important;
        z-index: 9999 !important;
        padding: 0 !important;
    }
    .modal-card.print-ready-card {
        box-shadow: none !important;
        border: none !important;
        margin: 0 auto !important;
        max-width: 100% !important;
        width: 100% !important;
        padding: 0 !important;
    }
    .id-card-layout, .salary-slip-box {
        box-shadow: none !important;
        margin: 0 auto !important;
        page-break-inside: avoid;
    }
}

/* ==========================================
   MOBILE & RESPONSIVENESS
   ========================================== */
@media (max-width: 767px) {
    .public-hero {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .hero-text-block h1 {
        font-size: 2.3rem;
    }
    .dashboard-layout {
        grid-template-columns: 1fr;
    }
    .dashboard-sidebar {
        position: static;
    }
    .split-layout {
        grid-template-columns: 1fr;
    }
    .attendance-grid {
        grid-template-columns: 1fr;
    }
    .login-wrapper {
        grid-template-columns: 1fr;
    }
}

/* ==========================================
   PHOTO GALLERY GRID STYLING
   ========================================== */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.gallery-card-item {
    background: var(--surface);
    border-radius: var(--border-radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: transform var(--transition-speed);
}

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

.gallery-card-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
    text-align: left;
}

.gallery-card-header h4 {
    color: var(--primary);
    font-size: 0.95rem;
    font-weight: 800;
}

.gallery-card-header p {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.gallery-photos-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    height: 140px;
}

.gallery-photo-box {
    position: relative;
    border-radius: var(--border-radius-sm);
    overflow: hidden;
    background: #000;
    border: 1px solid var(--border-color);
    height: 100%;
}

.gallery-photo-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-photo-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 4px;
    text-align: center;
}

.gallery-photo-placeholder {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 600;
    background: #e2e8f0;
    text-align: center;
    padding: 6px;
}

.gallery-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    border-top: 1px dashed var(--border-color);
    padding-top: 8px;
}

/* CSV Upload Dropzone Highlights */
.import-dropzone.dragover {
    border-color: var(--primary) !important;
    background: rgba(30, 60, 114, 0.08) !important;
    transform: scale(0.99);
}

/* Header Alignment & Collision Avoidance */
.logo-section {
    flex-shrink: 0;
}
.header-actions {
    flex-shrink: 0;
}

@media (max-width: 992px) {
    #btn-header-gallery, #btn-header-impact {
        display: none !important;
    }
    .brand-title {
        font-size: 0.95rem !important;
    }
    .brand-subtitle {
        font-size: 0.72rem !important;
    }
    .brand-logo-img {
        height: 38px !important;
    }
    .logo-section {
        gap: 6px !important;
    }
}

/* Line clamping for daily activity description */
.activity-desc-text.collapsed {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Portal & Login Dropdown Menu */
.dropdown {
    position: relative;
    display: inline-block;
}
.dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 8px;
    background: var(--surface-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    box-shadow: var(--shadow-lg);
    min-width: 230px;
    z-index: 1000;
    overflow: hidden;
    transform-origin: top right;
    animation: dropdownFadeIn 0.2s ease-out;
}
.dropdown-menu.show {
    display: block;
}
.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background var(--transition-speed);
    cursor: pointer;
    text-align: left;
}
.dropdown-item:hover {
    background: rgba(30, 60, 114, 0.08);
    color: var(--primary-light);
}
.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 6px 0;
}
@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-5px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* File Upload Widgets */
.upload-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 10px;
    width: 100%;
}
.upload-box {
    border: 2px dashed rgba(255, 255, 255, 0.25);
    background: rgba(15, 36, 62, 0.6);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--text-light);
    min-height: 120px;
}
.upload-box:hover {
    border-color: var(--accent);
    background: rgba(30, 60, 114, 0.2);
    color: var(--accent);
}
.upload-box i {
    font-size: 1.6rem;
}
.upload-preview {
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    overflow: hidden;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.4);
}
.upload-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.btn-remove-file {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(0,0,0,0.7);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}
.btn-remove-file:hover {
    background: rgba(255,0,0,0.9);
}

/* Secondary Navigation Menu Bar styling */
.main-nav-bar .nav-links > li.nav-dropdown:hover .dropdown-submenu {
    display: block;
}
.dropdown-submenu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #0c1e35;
    min-width: 210px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    list-style: none;
    padding: 5px 0;
    margin: 0;
    border-top: 2px solid var(--accent);
}
.dropdown-submenu li {
    width: 100%;
}
.dropdown-submenu li a {
    color: rgba(255, 255, 255, 0.85);
    display: block;
    padding: 10px 16px;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
    text-align: left;
    transition: background 0.2s, color 0.2s;
}
.dropdown-submenu li a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}
.main-nav-bar .nav-links > li > a:hover {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}
@media (max-width: 768px) {
    .main-nav-bar {
        display: none !important;
    }
}
