﻿/* ================================
   GLOBAL RESET + BASE
================================ */
html, body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f7fb;
}

html {
    overflow-y: scroll;
    scrollbar-gutter: stable;
}

a, .btn-link {
    color: #006bb7;
    text-decoration: none;
}

/* ================================
   TOP MENU BAR
================================ */
.menu-bar {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    background-color: #0d6efd;
    padding: 6px 0;
}

.menu-link {
    color: white;
    font-size: 18px;
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
}

    .menu-link:hover {
        text-decoration: underline;
    }

    .menu-link.active {
        border-bottom: 2px solid white;
        font-weight: 700;
    }

/* ================================
   FILTER BAR (GLOBAL)
================================ */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 20px;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    min-width: 180px;
}

    .filter-group label {
        font-weight: 600;
        margin-bottom: 4px;
    }

    .filter-group select {
        padding: 8px;
        border: 1px solid #ccc;
        border-radius: 6px;
        background: white;
    }

/* ================================
   TABLES (GLOBAL)
================================ */
.incident-table-wrapper {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.incident-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

    .incident-table th {
        background: #2f3b52;
        color: white;
        padding: 10px;
        text-align: left;
    }

    .incident-table td {
        padding: 2px 6px;
        border-bottom: 1px solid #eee;
    }

.empty-row {
    text-align: center;
    padding: 20px;
    font-style: italic;
}

/* ================================
   BUTTONS (GLOBAL)
================================ */
.btn {
    padding: 8px 14px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.btn-primary {
    background: #1f6feb;
    color: white;
}

.btn-success {
    background: #2e7d32;
    color: white;
}

.btn-small {
    padding: 5px 10px;
    font-size: 12px;
}

/* ================================
   PAGE TITLES (GLOBAL)
================================ */
.page-title {
    font-size: 26px;
    font-weight: 700;
    margin: 20px 0;
    text-align: center;
}

/* ================================
   DISABLED CARD (GLOBAL)
================================ */
.disabled-card {
    opacity: 0.45;
    pointer-events: none;
    cursor: default;
    filter: grayscale(100%);
    user-select: none;
}

/* ================================
   GUARD CHECK-IN MODULE (NEW)
================================ */

.checkin-container {
    display: flex;
    gap: 20px;
    padding: 20px;
    align-items: flex-start;
    justify-content: center;
}

.checkin-card, .history-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.checkin-card {
    width: 320px;
}

.history-card {
    flex: 1;
    min-width: 500px;
}

.shift-info {
    margin: 10px 0;
    font-size: 14px;
}

.button-row {
    display: flex;
    gap: 10px;
    margin: 15px 0;
}

.btn-in {
    background: #2e7d32;
    color: white;
    padding: 8px 12px;
    border: none;
    border-radius: 5px;
}

.btn-out {
    background: #c62828;
    color: white;
    padding: 8px 12px;
    border: none;
    border-radius: 5px;
}

.message {
    margin-top: 10px;
    font-weight: 600;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

    .history-table th {
        text-align: left;
        background: #2f3b52;
        color: white;
        padding: 8px;
    }

    .history-table td {
        padding: 6px;
        border-bottom: 1px solid #eee;
    }

.muted {
    color: #777;
}

/* ================================
   MODAL (GLOBAL FIXED — FINAL)
================================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.modal-box {
    background: #ffffff !important;
    padding: 25px;
    border-radius: 10px;
    width: 900px;
    max-width: 95%;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
    max-height: 90vh;
    overflow-y: auto;
}

/* TITLE INSIDE POPUP */
.company-header h4 {
    margin: 0 0 15px 0;
    font-size: 22px;
    font-weight: 700;
    color: #2f3b52;
}

/* GRID FOR FORM FIELDS */
.form-grid {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 12px 18px;
    margin-bottom: 20px;
}

/* LABELS */
.label {
    font-weight: 600;
    font-size: 13px;
    padding-top: 6px;
}

/* INPUTS */
.form-control {
    width: 100%;
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid #ccc;
    font-size: 13px;
    box-sizing: border-box;
}

/* CHECKBOX ALIGNMENT */
.form-grid input[type="checkbox"] {
    margin-top: 8px;
}

/* ACTION BUTTONS */
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}
