* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Inter, Arial, sans-serif;
    background: #f4f7fb;
    color: #111827;
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 270px;
    background: linear-gradient(180deg, #0f172a, #111827);
    color: #fff;
    padding: 22px;
    position: fixed;
    inset: 0 auto 0 0;
    display: flex;
    flex-direction: column;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 34px;
}

.brand-icon {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: linear-gradient(135deg, #38bdf8, #6366f1);
    display: grid;
    place-items: center;
    font-size: 24px;
    font-weight: 800;
}

.brand h2 {
    margin: 0;
    font-size: 22px;
}

.brand span {
    color: #94a3b8;
    font-size: 13px;
}

.menu {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.menu a {
    text-decoration: none;
    color: #cbd5e1;
    padding: 13px 14px;
    border-radius: 12px;
    font-size: 15px;
}

.menu a:hover,
.menu a.active {
    background: rgba(255,255,255,0.11);
    color: #fff;
}

.sidebar-footer {
    margin-top: auto;
    border-top: 1px solid rgba(255,255,255,0.12);
    padding-top: 18px;
}

.user-mini {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 14px;
}

.avatar {
    width: 40px;
    height: 40px;
    background: #2563eb;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-weight: 800;
}

.user-mini small {
    display: block;
    color: #94a3b8;
    margin-top: 3px;
}

.logout-btn {
    display: block;
    text-align: center;
    background: #ef4444;
    color: white;
    text-decoration: none;
    padding: 11px;
    border-radius: 12px;
}

.main-content {
    margin-left: 270px;
    padding: 28px;
    width: calc(100% - 270px);
}

.topbar {
    background: white;
    border-radius: 20px;
    padding: 22px 26px;
    margin-bottom: 26px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 12px 30px rgba(15,23,42,0.06);
}

.topbar h1 {
    margin: 0;
    font-size: 24px;
}

.topbar p {
    margin: 6px 0 0;
    color: #64748b;
}

.pill {
    background: #eef2ff;
    color: #3730a3;
    padding: 10px 14px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 13px;
}

.cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(180px, 1fr));
    gap: 18px;
}

.card {
    background: white;
    padding: 24px;
    border-radius: 20px;
    box-shadow: 0 12px 30px rgba(15,23,42,0.06);
    border: 1px solid #eef2f7;
}

.card h3 {
    margin: 0 0 12px;
    color: #64748b;
    font-size: 14px;
}

.card b {
    font-size: 34px;
    color: #0f172a;
}

.form-card {
    background: white;
    max-width: 1050px;
    padding: 26px;
    border-radius: 22px;
    box-shadow: 0 12px 30px rgba(15,23,42,0.06);
    border: 1px solid #eef2f7;
}

.form-card h3 {
    margin: 24px 0 12px;
    font-size: 17px;
    color: #0f172a;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 10px;
}

input, select, textarea {
    width: 100%;
    padding: 13px 14px;
    margin: 7px 0;
    border: 1px solid #dbe3ef;
    border-radius: 12px;
    background: #fff;
    font-size: 14px;
    outline: none;
}

input:focus, select:focus, textarea:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37,99,235,0.10);
}

button,
.btn {
    background: #2563eb;
    color: white;
    border: none;
    padding: 13px 20px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 700;
    text-decoration: none;
    display: inline-block;
}

button:hover,
.btn:hover {
    background: #1d4ed8;
}

.pax-row {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1.2fr;
    gap: 12px;
}

.table-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 12px 30px rgba(15,23,42,0.06);
    border: 1px solid #eef2f7;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background: #f8fafc;
    text-align: left;
    color: #475569;
    font-size: 13px;
    padding: 14px;
}

td {
    padding: 14px;
    border-top: 1px solid #eef2f7;
    font-size: 14px;
}

.badge {
    padding: 7px 11px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.badge.pending {
    background: #fff7ed;
    color: #c2410c;
}

.badge.completed {
    background: #dcfce7;
    color: #166534;
}

.badge.busted {
    background: #fee2e2;
    color: #991b1b;
}

.duplicate-row {
    background: #fffbeb;
}

.login-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle at top left, #38bdf8, transparent 35%),
        linear-gradient(135deg, #0f172a, #1e293b);
}

.login-card {
    width: 410px;
    background: rgba(255,255,255,0.96);
    padding: 36px;
    border-radius: 24px;
    box-shadow: 0 30px 80px rgba(0,0,0,0.32);
}

.login-card h2 {
    margin: 0 0 6px;
    font-size: 28px;
}

.login-card p {
    color: #64748b;
    margin-bottom: 22px;
}

.alert {
    background: #fee2e2;
    color: #991b1b;
    padding: 12px;
    border-radius: 12px;
    margin-bottom: 12px;
}

@media (max-width: 900px) {
    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
    }

    .app-shell {
        flex-direction: column;
    }

    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 18px;
    }

    .cards {
        grid-template-columns: 1fr;
    }

    .pax-row {
        grid-template-columns: 1fr;
    }

    .topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}
/* Inline action forms.
   delete_sale.php / restore_sale.php became POST endpoints (CSRF protection),
   so their buttons are now forms. This keeps them sitting inline exactly like
   the old <a class="btn"> links did. */
.inline-form{
    display:inline;
    margin:0;
    padding:0;
}
.inline-form button{
    font:inherit;
    cursor:pointer;
}
.actions .inline-form{
    display:inline-block;
}
