/* ============================================
   Minnesota Concrete Experts - Time Tracking
   Color Scheme: Red, Dark Navy, Silver, White
   ============================================ */

:root {
    --red: #C41E2A;
    --red-dark: #9B1520;
    --red-light: #E8343F;
    --dark: #1A1A2E;
    --dark-light: #2A2A3E;
    --silver: #C0C0C0;
    --silver-light: #E8E8E8;
    --white: #FFFFFF;
    --gray-100: #F8F9FA;
    --gray-200: #E9ECEF;
    --gray-600: #6C757D;
    --success: #28A745;
    --danger: #DC3545;
    --warning: #FFC107;
}

/* ---- Global ---- */
body {
    background-color: var(--gray-100);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

a {
    color: var(--red);
}

a:hover {
    color: var(--red-dark);
}

/* ---- Navbar ---- */
.bg-dark-custom {
    background: linear-gradient(135deg, var(--dark) 0%, #111 100%) !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.navbar-brand .brand-text {
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--white);
}

.navbar .nav-link {
    color: rgba(255,255,255,0.85) !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    border-radius: 6px;
    transition: all 0.2s;
    margin: 0 2px;
}

.navbar .nav-link:hover,
.navbar .nav-link.active {
    background-color: var(--red);
    color: var(--white) !important;
}

.navbar .nav-link i {
    margin-right: 4px;
}

/* ---- Login Page ---- */
.login-page {
    background: linear-gradient(135deg, var(--dark) 0%, #0d0d1a 50%, var(--dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 420px;
}

.login-card {
    background: var(--white);
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    border-top: 5px solid var(--red);
}

.login-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.login-logo {
    max-width: 200px;
    height: auto;
}

.login-header h4 {
    color: var(--dark);
    font-weight: 700;
}

.login-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-200);
}

/* ---- Buttons ---- */
.btn-primary-red {
    background-color: var(--red);
    border-color: var(--red);
    color: var(--white);
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: all 0.3s;
}

.btn-primary-red:hover {
    background-color: var(--red-dark);
    border-color: var(--red-dark);
    color: var(--white);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(196, 30, 42, 0.4);
}

.btn-dark-custom {
    background-color: var(--dark);
    border-color: var(--dark);
    color: var(--white);
}

.btn-dark-custom:hover {
    background-color: var(--dark-light);
    border-color: var(--dark-light);
    color: var(--white);
}

/* ---- Punch Clock ---- */
.punch-card {
    border: none;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.1);
    overflow: hidden;
    background: linear-gradient(180deg, var(--white) 0%, var(--gray-100) 100%);
}

.current-time {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--dark);
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.current-date {
    font-size: 1.1rem;
    color: var(--gray-600);
    font-weight: 500;
}

.elapsed-time {
    font-size: 2rem;
    font-weight: 700;
    color: var(--red);
    font-variant-numeric: tabular-nums;
}

.btn-punch {
    font-size: 1.5rem;
    padding: 1rem 3rem;
    border-radius: 50px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: all 0.3s;
    min-width: 250px;
}

.btn-punch:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

.btn-punch.btn-success {
    background: linear-gradient(135deg, #28A745, #218838);
    border: none;
}

.btn-punch.btn-danger {
    background: linear-gradient(135deg, var(--red), var(--red-dark));
    border: none;
}

/* ---- Cards ---- */
.card {
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: box-shadow 0.3s;
}

.card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.card-header {
    background-color: var(--dark);
    color: var(--white);
    border-radius: 12px 12px 0 0 !important;
    padding: 1rem 1.25rem;
    font-weight: 600;
}

.stat-card {
    border-left: 4px solid var(--red);
}

.stat-card h6 {
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1px;
}

.stat-card h3 {
    color: var(--dark);
    font-weight: 800;
}

/* ---- Tables ---- */
.table thead th {
    background-color: var(--dark);
    color: var(--white);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    padding: 0.75rem 1rem;
    white-space: nowrap;
}

.table tbody td {
    vertical-align: middle;
    padding: 0.75rem 1rem;
}

.table-hover tbody tr:hover {
    background-color: rgba(196, 30, 42, 0.05);
}

/* ---- Status Badges ---- */
.badge-active { background-color: var(--success); }
.badge-inactive { background-color: var(--gray-600); }
.badge-completed { background-color: #17A2B8; }
.badge-on-hold { background-color: var(--warning); color: #333; }
.badge-deleted { background-color: var(--danger); }
.badge-overtime { background-color: var(--red); }

/* ---- Forms ---- */
.form-control:focus,
.form-select:focus {
    border-color: var(--red);
    box-shadow: 0 0 0 0.2rem rgba(196, 30, 42, 0.25);
}

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

.input-group-text {
    background-color: var(--dark);
    color: var(--white);
    border-color: var(--dark);
}

/* ---- Section Headers ---- */
.section-header {
    background: linear-gradient(135deg, var(--dark) 0%, var(--dark-light) 100%);
    color: var(--white);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.section-header h4 {
    margin: 0;
    font-weight: 700;
}

/* ---- Filter Bar ---- */
.filter-bar {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

/* ---- Modals ---- */
.modal-header {
    background-color: var(--dark);
    color: var(--white);
    border-radius: 0;
}

.modal-header .btn-close {
    filter: invert(1);
}

/* ---- Alerts ---- */
.alert {
    border-radius: 10px;
    border: none;
    font-weight: 500;
}

/* ---- Footer ---- */
.footer {
    background: linear-gradient(135deg, var(--dark) 0%, #111 100%) !important;
    margin-top: auto;
}

/* ---- Pagination ---- */
.page-link {
    color: var(--red);
}

.page-link:hover {
    color: var(--red-dark);
    background-color: var(--silver-light);
}

.page-item.active .page-link {
    background-color: var(--red);
    border-color: var(--red);
}

/* ---- Utility ---- */
.text-red { color: var(--red) !important; }
.bg-red { background-color: var(--red) !important; }
.border-red { border-color: var(--red) !important; }

.clickable-row { cursor: pointer; }

.audit-values {
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    background: var(--gray-100);
    padding: 0.5rem;
    border-radius: 6px;
    max-height: 150px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ---- Loading spinner ---- */
.spinner-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.spinner-overlay .spinner-border {
    width: 3rem;
    height: 3rem;
    color: var(--red);
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .current-time {
        font-size: 2.5rem;
    }

    .elapsed-time {
        font-size: 1.5rem;
    }

    .btn-punch {
        font-size: 1.2rem;
        padding: 0.8rem 2rem;
        min-width: 200px;
    }

    .navbar-brand img {
        height: 32px;
    }

    .table-responsive {
        font-size: 0.85rem;
    }

    .stat-card h3 {
        font-size: 1.5rem;
    }

    .section-header {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }

    .filter-bar .row > div {
        margin-bottom: 0.5rem;
    }

    .container-fluid {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .card-body {
        padding: 1rem;
    }
}

@media (max-width: 576px) {
    .login-card {
        padding: 1.5rem;
    }

    .login-logo {
        max-width: 160px;
    }

    .punch-card .card-body {
        padding: 2rem 1rem;
    }

    .btn-punch {
        width: 100%;
        min-width: unset;
    }

    .d-none-mobile {
        display: none !important;
    }
}

/* ---- Print ---- */
@media print {
    .navbar, .footer, .btn, .filter-bar, .no-print { display: none !important; }
    .card { border: 1px solid #ccc; box-shadow: none; }
    .card-header { background-color: #333 !important; -webkit-print-color-adjust: exact; }
    body { background: white; }
}
