/* ── Fonts ── */
* {
    font-family: "Poppins", sans-serif;
}

h1, h2, h3, h4, h5, h6 {
    font-family: "Rubik", sans-serif;
    font-weight: 500;
}

/* ── Base ── */
body {
    background-color: #f0f2f5;
    color: #1a1a2e;
}

a {
    color: #4361ee;
}

a:hover {
    color: #3a56d4;
}

code {
    font-size: 0.85em;
    color: #4361ee;
    background: #eef1ff;
    padding: 0.15em 0.4em;
    border-radius: 4px;
}

pre {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 0.75rem;
    font-size: 0.8rem;
    overflow-x: auto;
}

/* Allow dropdowns inside tables to overflow the scroll container */
.table-responsive {
    overflow: visible;
}

/* Overflow menu button — vertical dots, no arrow */
.btn-overflow {
    padding: 0.3rem 0.5rem;
    line-height: 1.5;
    font-size: 0.85rem;
    border-color: #ccc;
    color: #666;
}
.btn-overflow:hover {
    background: #f0f0f0;
    color: #333;
}
.btn-overflow::after {
    display: none; /* hide Bootstrap dropdown arrow */
}

textarea {
    resize: vertical;
    min-height: 100px;
}

/* ── Navbar ── */
.site-navbar {
    background: #fff;
    border-bottom: 1px solid #e9ecef;
    padding: 0.75rem 0;
}

.site-navbar .navbar-brand {
    font-family: "Rubik", sans-serif;
    font-weight: 600;
    font-size: 1.1rem;
    color: #1a1a2e;
}

.site-navbar .nav-link {
    font-size: 0.9rem;
    font-weight: 500;
    color: #495057;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
}

.site-navbar .nav-link:hover,
.site-navbar .nav-link.active {
    color: #4361ee;
    background: #eef1ff;
}

/* ── Layout ── */
.page-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem 3rem;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.page-header h1 {
    font-size: 1.6rem;
    margin: 0;
}

/* ── Cards ── */
.card {
    border: 1px solid #e9ecef;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    overflow: hidden;
}

.card + .card {
    margin-top: 1.25rem;
}

.card-header {
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.75rem 1.25rem;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.card-header h5 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
}

.card-body {
    padding: 1.25rem;
}

/* ── Tables ── */
.table {
    font-size: 0.875rem;
    margin-bottom: 0;
}

.table thead th {
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #6c757d;
    border-bottom-width: 1px;
    padding: 0.6rem 0.75rem;
}

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

.table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: rgba(0,0,0,0.015);
}

/* ── Buttons ── */
.btn {
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: 6px;
    padding: 0.4rem 0.85rem;
    margin-top: 0;
    transition: all 0.15s;
}

.btn-sm {
    font-size: 0.78rem;
    padding: 0.3rem 0.6rem;
}

.btn-primary {
    background: #4361ee;
    border-color: #4361ee;
}

.btn-primary:hover {
    background: #3a56d4;
    border-color: #3a56d4;
}

.btn-outline-primary {
    color: #4361ee;
    border-color: #4361ee;
}

.btn-outline-primary:hover {
    background: #4361ee;
    border-color: #4361ee;
}

.btn-outline-danger:hover {
    background: #dc3545;
}

/* ── Badges ── */
.badge {
    font-weight: 500;
    font-size: 0.75rem;
    padding: 0.35em 0.65em;
    border-radius: 5px;
}

/* ── Alerts ── */
.alert {
    font-size: 0.875rem;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    border: none;
}

.alert-success {
    background: #d4edda;
    color: #155724;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
}

/* ── Forms / Modals ── */
.form-label {
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 0.3rem;
}

.form-control {
    font-size: 0.875rem;
    border-radius: 6px;
    border: 1px solid #ced4da;
    padding: 0.5rem 0.75rem;
}

.form-control:focus {
    border-color: #4361ee;
    box-shadow: 0 0 0 0.2rem rgba(67,97,238,0.15);
}

.modal-content {
    border-radius: 12px;
    border: none;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
}

.modal-header {
    border-bottom: 1px solid #f0f0f0;
    padding: 1rem 1.25rem;
}

.modal-body {
    padding: 1.25rem;
}

.modal-footer {
    border-top: 1px solid #f0f0f0;
    padding: 0.75rem 1.25rem;
}

.modal-title {
    font-size: 1.1rem;
    font-weight: 600;
}

/* ── Info panel (index page) ── */
.info-panel {
    background: #eef1ff;
    border-left: 4px solid #4361ee;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}

.info-panel p {
    margin-bottom: 0.35rem;
    font-size: 0.9rem;
}

/* ── Status dot ── */
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 0.4rem;
}

.status-dot.green { background: #28a745; }
.status-dot.red { background: #dc3545; }

/* ── Footer ── */
.site-footer {
    text-align: center;
    padding: 1.5rem 0;
    font-size: 0.8rem;
    color: #adb5bd;
}

/* ── Delete form inline ── */
.delete-form {
    display: inline;
}

/* ══════════════════════════════════
   Mobile (<768px)
   ══════════════════════════════════ */
@media (max-width: 767.98px) {
    .page-wrapper {
        padding: 1rem 0.75rem 2rem;
    }

    .page-header h1 {
        font-size: 1.3rem;
    }

    /* Navbar tightening */
    .site-navbar {
        padding: 0.5rem 0;
    }

    .site-navbar .navbar-brand {
        font-size: 1rem;
    }

    /* Card tightening */
    .card {
        border: none;
        border-radius: 8px;
        box-shadow: 0 1px 2px rgba(0,0,0,0.06);
    }

    .card-body {
        padding: 0.75rem;
    }

    .card-header {
        padding: 0.6rem 0.75rem;
    }

    /* Responsive stacking tables */
    .table-responsive:has(.table-stack) {
        overflow: visible;
    }

    table.table-stack {
        border: none;
    }

    table.table-stack thead {
        display: none;
    }

    table.table-stack tbody {
        border: none;
    }

    table.table-stack tbody tr {
        display: block;
        margin-bottom: 0.6rem;
        border: 1px solid #e9ecef;
        border-radius: 8px;
        padding: 0.25rem 0;
        background: #fff;
    }

    table.table-stack tbody tr:last-child {
        margin-bottom: 0;
    }

    table.table-stack tbody td {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        padding: 0.4rem 0.75rem;
        border: none;
        border-bottom: 1px solid #f0f0f0;
        gap: 0.5rem;
        background: transparent;
        font-size: 0.85rem;
    }

    table.table-stack tbody td:last-child {
        border-bottom: none;
    }

    table.table-stack tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 0.78rem;
        color: #6c757d;
        flex-shrink: 0;
        min-width: 75px;
    }

    table.table-stack tbody td .btn {
        margin-top: 0;
    }

    /* Tighter alerts */
    .alert {
        padding: 0.6rem 0.85rem;
        font-size: 0.82rem;
    }

    /* Modal fullscreen-ish on small screens */
    .modal-dialog {
        margin: 0.5rem;
    }
}

/* ══════════════════════════════════
   Tablet (768–991px)
   ══════════════════════════════════ */
@media (min-width: 768px) and (max-width: 991.98px) {
    .page-wrapper {
        padding: 1.5rem 1rem 2.5rem;
    }
}
