﻿/* =====================================================
   ROOT VARIABLES - Green & Deep Blue Theme
   ===================================================== */
:root {
    --primary-green: #0d7a3e;
    --primary-green-light: #1a9e55;
    --primary-green-dark: #0a5c2f;
    --primary-blue: #0a2463;
    --primary-blue-light: #1a3f8a;
    --primary-blue-dark: #061b4a;
    --accent-green: #2ecc71;
    --accent-blue: #3498db;
    --bg-light: #f0f7f4;
    --bg-white: #ffffff;
    --text-dark: #1a2a3a;
    --text-muted: #5a6a7a;
    --border-color: #d0dfd9;
    --shadow: 0 4px 24px rgba(10, 36, 99, 0.12);
    --radius: 12px;
    --transition: all 0.3s ease;
}

/* =====================================================
   RESET
   ===================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', sans-serif;
    background: var(--bg-light);
    color: var(--text-dark);
    min-height: 100vh;
}

/* =====================================================
   WELCOME PAGE
   ===================================================== */
/*.welcome-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 50%, var(--primary-green-dark) 100%);
    padding: 20px;
}

.welcome-card {
    background: var(--bg-white);
    border-radius: 24px;
    padding: 50px 60px;
    max-width: 500px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 0.6s ease;
}*/
.welcome-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 50%, var(--primary-green-dark) 100%);
    padding: 20px;
}

.welcome-card {
    background: var(--bg-white);
    border-radius: 32px;
    padding: 60px 70px;
    max-width: 600px;
    width: 100%;
    text-align: center;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
    animation: fadeInUp 0.6s ease;
}
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.welcome-icon {
    font-size: 72px;
    color: var(--primary-green);
    margin-bottom: 16px;
}

.welcome-title {
    font-size: 48px;
    font-weight: 900;
    color: var(--primary-blue);
    margin-bottom: 4px;
}

.welcome-subtitle {
    font-size: 22px;
    font-weight: 600;
    color: var(--primary-green);
    margin-bottom: 4px;
}

.welcome-desc {
    font-size: 18px;
    color: var(--text-muted);
    margin-bottom: 40px;
}

.welcome-buttons {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width:100%
}

.btn-welcome {
    padding: 20px 32px;
    font-size: 22px;
    font-weight: 700;
    border-radius: 16px;
    justify-content: center;
    width: 100%;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 14px;
}

    .btn-welcome i {
        font-size: 28px;
    }

.btn-welcome-primary {
    background: var(--primary-blue);
    color: #fff;
    box-shadow: 0 6px 24px rgba(10, 36, 99, 0.35);
}

    .btn-welcome-primary:hover {
        background: var(--primary-blue-light);
        transform: translateY(-3px);
        box-shadow: 0 8px 32px rgba(10, 36, 99, 0.45);
    }

    .btn-welcome-primary:active {
        transform: translateY(0px);
    }

.btn-welcome-secondary {
    background: var(--bg-white);
    color: var(--primary-blue);
    border: 2px solid var(--primary-blue);
    box-shadow: 0 4px 16px rgba(10, 36, 99, 0.15);
}

    .btn-welcome-secondary:hover {
        background: var(--bg-light);
        transform: translateY(-3px);
        box-shadow: 0 8px 28px rgba(10, 36, 99, 0.25);
    }

    .btn-welcome-secondary:active {
        transform: translateY(0px);
    }

.welcome-footer {
    margin-top: 32px;
    color: var(--text-muted);
    font-size: 14px;
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
}

/* ===== Responsive ===== */
@media (max-width: 480px) {
    .welcome-card {
        padding: 35px 24px;
        border-radius: 24px;
    }

    .welcome-icon {
        font-size: 52px;
    }

    .welcome-title {
        font-size: 34px;
    }

    .welcome-subtitle {
        font-size: 18px;
    }

    .welcome-desc {
        font-size: 15px;
        margin-bottom: 30px;
    }

    .btn-welcome {
        padding: 16px 24px;
        font-size: 18px;
        border-radius: 14px;
    }

        .btn-welcome i {
            font-size: 22px;
        }

    .welcome-buttons {
        gap: 14px;
    }
}

@media (min-width: 481px) and (max-width: 768px) {
    .welcome-card {
        padding: 45px 40px;
    }

    .btn-welcome {
        padding: 18px 28px;
        font-size: 20px;
    }
}

/* ===== Touch Device Optimizations ===== */
@media (hover: none) and (pointer: coarse) {
    .btn-welcome {
        padding: 22px 32px;
        font-size: 24px;
        min-height: 70px;
        border-radius: 18px;
    }

        .btn-welcome i {
            font-size: 30px;
        }

    .welcome-card {
        padding: 40px 30px;
    }
}
/* =====================================================
   AUTH PAGES (Sign In / Sign Out)
   ===================================================== */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    padding: 40px 20px;
    background: var(--bg-light);
}

.auth-card {
    background: var(--bg-white);
    border-radius: 16px;
    padding: 35px 40px;
    max-width: 520px;
    width: 100%;
    box-shadow: var(--shadow);
    border-top: 4px solid var(--primary-green);
}

.auth-header {
    margin-bottom: 28px;
}

    .auth-header .back-link {
        display: inline-block;
        margin-bottom: 12px;
        color: var(--text-muted);
        text-decoration: none;
        font-size: 14px;
        transition: var(--transition);
    }

        .auth-header .back-link:hover {
            color: var(--primary-blue);
        }

    .auth-header h1 {
        font-size: 28px;
        font-weight: 800;
        color: var(--primary-blue);
    }

        .auth-header h1 i {
            color: var(--primary-green);
        }

    .auth-header p {
        color: var(--text-muted);
        font-size: 15px;
    }

.auth-footer {
    margin-top: 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
}

/* =====================================================
   DASHBOARD
   ===================================================== */
.dashboard-container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 20px;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-white);
    padding: 20px 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

    .dashboard-header h1 {
        font-size: 24px;
        font-weight: 800;
        color: var(--primary-blue);
    }

        .dashboard-header h1 i {
            color: var(--primary-green);
        }

.count-badge {
    background: var(--primary-green);
    color: #fff !important;
    padding: 6px 16px;
}

/* =====================================================
   STATS GRID
   ===================================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: var(--transition);
}

    .stat-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 28px rgba(10, 36, 99, 0.15);
    }

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #fff;
}

    .stat-icon.pending {
        background: #f39c12;
    }

    .stat-icon.approved {
        background: #2ecc71;
    }

    .stat-icon.in {
        background: var(--primary-blue);
    }

    .stat-icon.out {
        background: #e74c3c;
    }

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-dark);
    line-height: 1.2;
}

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

/* =====================================================
   FORM
   ===================================================== */
.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 16px;
}

    .form-group label {
        font-size: 13px;
        font-weight: 600;
        color: var(--text-dark);
        margin-bottom: 4px;
    }

        .form-group label .required {
            color: #e74c3c;
        }

    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 10px 14px;
        border: 1px solid var(--border-color);
        border-radius: 8px;
        font-size: 14px;
        transition: var(--transition);
        background: #fff;
        font-family: inherit;
        color: var(--text-dark);
    }

        .form-group input:focus,
        .form-group select:focus,
        .form-group textarea:focus {
            outline: none;
            border-color: var(--primary-blue);
            box-shadow: 0 0 0 3px rgba(10, 36, 99, 0.12);
        }

    .form-group textarea {
        resize: vertical;
        min-height: 80px;
    }

    .form-group .validation-summary {
        color: #e74c3c;
        font-size: 14px;
        margin-bottom: 12px;
    }

/* =====================================================
   BUTTONS
   ===================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    font-family: inherit;
}

.btn-primary {
    background: var(--primary-blue);
    color: #fff;
}

    .btn-primary:hover {
        background: var(--primary-blue-light);
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(10, 36, 99, 0.3);
    }

.btn-success {
    background: var(--primary-green);
    color: #fff;
}

    .btn-success:hover {
        background: var(--primary-green-light);
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(13, 122, 62, 0.3);
    }

.btn-secondary {
    background: var(--bg-light);
    color: var(--text-dark);
    border: 1px solid var(--border-color);
}

    .btn-secondary:hover {
        background: #e2e8e6;
    }

.btn-danger {
    background: #e74c3c;
    color: #fff;
}

    .btn-danger:hover {
        background: #c0392b;
    }

.btn-block {
    width: 100%;
    justify-content: center;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

.btn-sm {
    padding: 4px 12px;
    font-size: 12px;
}

/* =====================================================
   TOOLBAR
   ===================================================== */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-white);
    padding: 14px 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.toolbar-left {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.search-box {
    display: flex;
    align-items: center;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0 12px;
    transition: var(--transition);
}

    .search-box:focus-within {
        border-color: var(--primary-blue);
        box-shadow: 0 0 0 3px rgba(10, 36, 99, 0.12);
    }

    .search-box i {
        color: var(--text-muted);
    }

    .search-box input {
        border: none;
        padding: 10px 10px;
        font-size: 14px;
        background: transparent;
        width: 200px;
        font-family: inherit;
    }

        .search-box input:focus {
            outline: none;
        }

.toolbar select {
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    font-family: inherit;
    cursor: pointer;
}

    .toolbar select:focus {
        outline: none;
        border-color: var(--primary-blue);
    }

.toolbar-right {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* =====================================================
   TABLE
   ===================================================== */
.table-section {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 0;
    box-shadow: var(--shadow);
    overflow-x: auto;
}

    .table-section table {
        width: 100%;
        border-collapse: collapse;
        font-size: 14px;
    }

    .table-section thead {
        background: var(--primary-blue);
        color: #fff;
    }

        .table-section thead th {
            padding: 14px 16px;
            text-align: left;
            font-weight: 600;
            font-size: 12px;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            white-space: nowrap;
        }

    .table-section tbody tr {
        border-bottom: 1px solid var(--border-color);
        transition: var(--transition);
    }

        .table-section tbody tr:hover {
            background: var(--bg-light);
        }

    .table-section tbody td {
        padding: 12px 16px;
        color: var(--text-dark);
        vertical-align: middle;
    }

.loading-text {
    text-align: center;
    padding: 40px !important;
    color: var(--text-muted);
}

/* =====================================================
   STATUS BADGE
   ===================================================== */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

    .status-badge.pending {
        background: #fff3cd;
        color: #856404;
    }

    .status-badge.approved {
        background: #d4edda;
        color: #155724;
    }

    .status-badge.in {
        background: #cce5ff;
        color: #004085;
    }

    .status-badge.out {
        background: #f8d7da;
        color: #721c24;
    }

    .status-badge.declined {
        background: #f8d7da;
        color: #721c24;
    }

/* =====================================================
   TAG NUMBER
   ===================================================== */
.VIS-number {
    display: inline-block;
    background: var(--primary-blue);
    color: #fff;
    padding: 2px 12px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.5px;
}

/* =====================================================
   VISITOR SEARCH (Sign Out)
   ===================================================== */
.search-group {
    display: flex;
    gap: 10px;
}

    .search-group input {
        flex: 1;
    }

.visitor-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: var(--bg-light);
    border-radius: var(--radius);
    margin: 16px 0;
    border: 1px solid var(--border-color);
}

.visitor-avatar {
    font-size: 48px;
    color: var(--primary-blue);
}

.visitor-details h3 {
    font-size: 18px;
    color: var(--text-dark);
}

.visitor-details p {
    margin: 2px 0;
    color: var(--text-muted);
    font-size: 14px;
}

/* =====================================================
   ACTION BUTTONS
   ===================================================== */
.action-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: var(--transition);
}

    .action-btn:hover {
        transform: scale(1.1);
    }

    .action-btn.approve {
        color: var(--primary-green);
    }

        .action-btn.approve:hover {
            background: #d4edda;
        }

    .action-btn.decline {
        color: #e74c3c;
    }

        .action-btn.decline:hover {
            background: #f8d7da;
        }

    .action-btn.in {
        color: var(--primary-blue);
    }

        .action-btn.in:hover {
            background: #cce5ff;
        }

    .action-btn.out {
        color: #e67e22;
    }

        .action-btn.out:hover {
            background: #ffe5cc;
        }

    .action-btn.delete {
        color: #e74c3c;
    }

        .action-btn.delete:hover {
            background: #f8d7da;
        }

/* =====================================================
   EMPTY STATE
   ===================================================== */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

    .empty-state i {
        font-size: 48px;
        margin-bottom: 12px;
        color: var(--border-color);
    }

    .empty-state p {
        font-size: 16px;
    }

/* =====================================================
   TOAST
   ===================================================== */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--primary-blue);
    color: #fff;
    padding: 14px 24px;
    border-radius: 10px;
    font-weight: 500;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.2);
    transform: translateY(80px);
    opacity: 0;
    transition: all 0.4s ease;
    z-index: 999;
    max-width: 400px;
}

    .toast.show {
        transform: translateY(0);
        opacity: 1;
    }

    .toast.success {
        background: var(--primary-green);
    }

    .toast.error {
        background: #e74c3c;
    }

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 768px) {
    .welcome-card {
        padding: 30px 24px;
    }

    .welcome-title {
        font-size: 32px;
    }

    .auth-card {
        padding: 24px 20px;
    }

    .auth-header h1 {
        font-size: 24px;
    }

    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .toolbar-left {
        flex-direction: column;
    }

    .search-box input {
        width: 100%;
    }

    .toolbar select {
        width: 100%;
    }

    .table-section thead {
        display: none;
    }

    .table-section tbody tr {
        display: block;
        margin-bottom: 12px;
        border: 1px solid var(--border-color);
        border-radius: 8px;
        padding: 12px;
        background: #fff;
    }

    .table-section tbody td {
        display: flex;
        justify-content: space-between;
        padding: 6px 0;
        border-bottom: 1px solid var(--bg-light);
    }

        .table-section tbody td:last-child {
            border-bottom: none;
        }

        .table-section tbody td::before {
            content: attr(data-label);
            font-weight: 600;
            color: var(--text-muted);
            font-size: 12px;
            text-transform: uppercase;
        }

    .search-group {
        flex-direction: column;
    }

    .visitor-card {
        flex-direction: column;
        text-align: center;
    }

    .toast {
        bottom: 20px;
        right: 20px;
        left: 20px;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .stat-card {
        padding: 14px;
    }

    .stat-number {
        font-size: 22px;
    }
}

/* =====================================================
   PRINT
   ===================================================== */
@media print {
    .btn, .action-btn, .toolbar, .search-group, .auth-container, .welcome-container, .toast {
        display: none !important;
    }

    .dashboard-container {
        padding: 0 !important;
    }

    .dashboard-header {
        box-shadow: none !important;
        border-bottom: 2px solid #000 !important;
    }

    .table-section {
        box-shadow: none !important;
    }

        .table-section thead {
            background: #333 !important;
            color: #fff !important;
            display: table-header-group !important;
        }

        .table-section tbody tr {
            display: table-row !important;
            border: none !important;
            padding: 0 !important;
        }

        .table-section tbody td {
            display: table-cell !important;
            padding: 6px 10px !important;
            border-bottom: 1px solid #ccc !important;
        }

            .table-section tbody td::before {
                content: none !important;
            }

    .status-badge {
        border: 1px solid #000 !important;
    }

    /* Select2 container */
    .select2-container {
        box-sizing: border-box;
        display: inline-block;
        margin: 0;
        position: relative;
        vertical-align: middle;
    }

        .select2-container .select2-selection--single {
            box-sizing: border-box;
            cursor: pointer;
            display: block;
            height: 28px;
            user-select: none;
            -webkit-user-select: none;
        }

            .select2-container .select2-selection--single .select2-selection__rendered {
                display: block;
                padding-left: 8px;
                padding-right: 20px;
                overflow: hidden;
                text-overflow: ellipsis;
                white-space: nowrap;
            }

            .select2-container .select2-selection--single .select2-selection__clear {
                position: relative;
            }

        .select2-container[dir="rtl"] .select2-selection--single .select2-selection__rendered {
            padding-right: 8px;
            padding-left: 20px;
        }

        .select2-container .select2-selection--multiple {
            box-sizing: border-box;
            cursor: pointer;
            display: block;
            min-height: 32px;
            user-select: none;
            -webkit-user-select: none;
        }

            .select2-container .select2-selection--multiple .select2-selection__rendered {
                display: inline-block;
                overflow: hidden;
                padding-left: 8px;
                text-overflow: ellipsis;
                white-space: nowrap;
            }

        .select2-container .select2-search--inline {
            float: left;
        }

            .select2-container .select2-search--inline .select2-search__field {
                box-sizing: border-box;
                border: none;
                font-size: 100%;
                margin-top: 5px;
                padding: 0;
            }

                .select2-container .select2-search--inline .select2-search__field::-webkit-search-cancel-button {
                    -webkit-appearance: none;
                }

    /* Dropdown */
    .select2-dropdown {
        background-color: white;
        border: 1px solid #aaa;
        border-radius: 4px;
        box-sizing: border-box;
        display: block;
        position: absolute;
        left: -100000px;
        width: 100%;
        z-index: 1051;
    }

    .select2-results {
        display: block;
    }

    .select2-results__options {
        list-style: none;
        margin: 0;
        padding: 0;
    }

    .select2-results__option {
        padding: 6px;
        user-select: none;
        -webkit-user-select: none;
    }

        .select2-results__option[aria-selected] {
            cursor: pointer;
        }

    .select2-container--open .select2-dropdown {
        left: 0;
    }

    .select2-container--open .select2-dropdown--above {
        border-bottom: none;
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
    }

    .select2-container--open .select2-dropdown--below {
        border-top: none;
        border-top-left-radius: 0;
        border-top-right-radius: 0;
    }

    .select2-search--dropdown {
        display: block;
        padding: 4px;
    }

        .select2-search--dropdown .select2-search__field {
            padding: 4px;
            width: 100%;
            box-sizing: border-box;
        }

            .select2-search--dropdown .select2-search__field::-webkit-search-cancel-button {
                -webkit-appearance: none;
            }

        .select2-search--dropdown.select2-search--hide {
            display: none;
        }

    /* Close button */
    .select2-close-mask {
        border: 0;
        margin: 0;
        padding: 0;
        display: block;
        position: fixed;
        left: 0;
        top: 0;
        min-height: 100%;
        min-width: 100%;
        height: auto;
        width: auto;
        opacity: 0;
        z-index: 99;
        background-color: #fff;
        filter: alpha(opacity=0);
    }

    /* Hidden */
    .select2-hidden-accessible {
        border: 0 !important;
        clip: rect(0 0 0 0) !important;
        -webkit-clip-path: inset(50%) !important;
        clip-path: inset(50%) !important;
        height: 1px !important;
        overflow: hidden !important;
        padding: 0 !important;
        position: absolute !important;
        width: 1px !important;
        white-space: nowrap !important;
    }
}
