/* Weweniza Control Center — shared navy/gold theme */
:root {
    --navy: #0A1228;
    --navy-light: #16214a;
    --gold: #D9AD4D;
    --gold-light: #f0d999;
    --grey-bg: #f4f5f7;
    --white: #ffffff;
    --danger: #c0392b;
    --success: #2e7d32;
    --warning: #b8860b;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Segoe UI', Arial, sans-serif;
    background: var(--grey-bg);
    color: #222;
}

.layout { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
    width: 240px;
    background: var(--navy);
    color: var(--white);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}
.sidebar .brand {
    padding: 22px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.sidebar .brand .title {
    color: var(--gold);
    font-weight: 700;
    font-size: 15px;
    line-height: 1.3;
}
.sidebar .brand .sub {
    color: #b7bccb;
    font-size: 11px;
    margin-top: 4px;
}
.sidebar nav { flex: 1; padding: 10px 0; }
.sidebar nav a {
    display: block;
    padding: 11px 20px;
    color: #d7dae5;
    text-decoration: none;
    font-size: 14px;
    border-left: 3px solid transparent;
}
.sidebar nav a:hover,
.sidebar nav a.active {
    background: var(--navy-light);
    color: var(--gold);
    border-left-color: var(--gold);
}
.sidebar .user-box {
    padding: 16px 18px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 12px;
    color: #b7bccb;
}
.sidebar .user-box .name { color: var(--white); font-weight: 600; font-size: 13px; }
.sidebar .user-box a { color: var(--gold); text-decoration: none; }

/* Main content */
.main { flex: 1; display: flex; flex-direction: column; }
.topbar {
    background: var(--white);
    padding: 14px 28px;
    border-bottom: 1px solid #e3e5ea;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.topbar h1 { font-size: 19px; margin: 0; color: var(--navy); }
.content { padding: 24px 28px; flex: 1; }

/* Cards */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.card {
    background: var(--white);
    border-radius: 8px;
    padding: 18px;
    border-top: 3px solid var(--gold);
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.card .label { font-size: 12px; color: #777; text-transform: uppercase; letter-spacing: .5px; }
.card .value { font-size: 24px; font-weight: 700; color: var(--navy); margin-top: 6px; }

/* Tables */
table { width: 100%; border-collapse: collapse; background: var(--white); border-radius: 8px; overflow: hidden; }
table th, table td { padding: 10px 14px; text-align: left; font-size: 13px; border-bottom: 1px solid #eef0f3; }
table th { background: var(--navy); color: var(--gold); font-weight: 600; }
table tr:hover { background: #fafafa; }

/* Forms */
.panel { background: var(--white); border-radius: 8px; padding: 20px; margin-bottom: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
label { display: block; font-size: 13px; margin-bottom: 4px; color: #444; font-weight: 600; }
input, select, textarea {
    width: 100%; padding: 8px 10px; margin-bottom: 14px; border: 1px solid #d5d8de; border-radius: 5px; font-size: 14px;
}
.btn {
    display: inline-block; padding: 9px 18px; border-radius: 5px; border: none;
    background: var(--gold); color: var(--navy); font-weight: 700; cursor: pointer; font-size: 14px; text-decoration: none;
}
.btn:hover { background: var(--gold-light); }
.btn-secondary { background: var(--navy); color: var(--white); }
.btn-danger { background: var(--danger); color: var(--white); }

.badge { padding: 3px 9px; border-radius: 12px; font-size: 11px; font-weight: 700; }
.badge-waiting { background: #fdecea; color: var(--danger); }
.badge-progress { background: #fff6e0; color: var(--warning); }
.badge-done { background: #e6f4ea; color: var(--success); }

.alert { padding: 12px 16px; border-radius: 6px; margin-bottom: 16px; font-size: 14px; }
.alert-danger { background: #fdecea; color: var(--danger); border: 1px solid #f5c6c1; }
.alert-success { background: #e6f4ea; color: var(--success); border: 1px solid #b7dfc0; }

.login-wrap {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--navy), var(--navy-light));
}
.login-box {
    background: var(--white); padding: 36px 32px; border-radius: 10px; width: 340px;
    border-top: 4px solid var(--gold); box-shadow: 0 8px 30px rgba(0,0,0,0.3);
}
.login-box h2 { color: var(--navy); margin-top: 0; font-size: 18px; }
.login-box .sub { color: #888; font-size: 12px; margin-bottom: 20px; }

/* ============================================================
   Mobile responsiveness — point-of-sale friendly on phones
   Sidebar collapses into a horizontal scrollable top strip,
   form controls and buttons grow to comfortable tap size.
   ============================================================ */
@media (max-width: 768px) {
    .layout { flex-direction: column; }

    .sidebar {
        width: 100%;
        flex-direction: column;
    }
    .sidebar .brand {
        padding: 10px 14px;
        display: flex;
        align-items: center;
    }
    .sidebar .brand img { width: 32px !important; height: 32px !important; }
    .sidebar .brand .title { font-size: 13px; }
    .sidebar .brand .sub { font-size: 10px; }

    .sidebar nav {
        display: flex;
        flex: none;
        padding: 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-top: 1px solid rgba(255,255,255,0.1);
    }
    .sidebar nav a {
        padding: 12px 16px;
        font-size: 13px;
        white-space: nowrap;
        flex-shrink: 0;
        border-left: none;
        border-bottom: 3px solid transparent;
    }
    .sidebar nav a:hover,
    .sidebar nav a.active {
        border-left: none;
        border-bottom-color: var(--gold);
    }
    .sidebar .user-box {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 10px 14px;
    }

    .topbar { padding: 12px 16px; }
    .topbar h1 { font-size: 17px; }
    .content { padding: 14px; }

    .panel { padding: 14px; }

    /* Bigger, easier-to-hit form controls for one-handed phone use at the bar */
    label { font-size: 14px; margin-bottom: 6px; }
    input, select, textarea {
        font-size: 16px;      /* stops iOS Safari auto-zoom on focus */
        padding: 13px 14px;
        margin-bottom: 16px;
        min-height: 46px;
    }
    textarea { min-height: 90px; }

    input[type="radio"],
    input[type="checkbox"] {
        width: 22px;
        height: 22px;
        min-height: 0;
        margin: 0 8px 0 0;
        vertical-align: middle;
    }

    /* Primary action buttons (Record Sale, Add Item, Record Expense, etc.) —
       full-width and thumb-sized. Small inline-styled utility buttons
       (Settle, Edit, Delete, Add) keep their own compact inline sizing. */
    .btn {
        display: block;
        width: 100%;
        padding: 15px 20px;
        font-size: 16px;
        text-align: center;
    }

    /* Tables scroll horizontally instead of squeezing text unreadably small */
    .panel > table,
    .content > table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    table th, table td { padding: 8px 10px; font-size: 12px; }

    .cards { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
    .card { padding: 14px; }
    .card .value { font-size: 19px; }

    /* ------------------------------------------------------------
       Record a Sale (point of sale) — keep every line on screen,
       no horizontal scrolling for the bartender.
       Item goes full-width on its own row; Qty + Remove share a
       compact second row instead of cramming three fields sideways.
       ------------------------------------------------------------ */
    .sale-line {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }
    .sale-line .line-item-wrap {
        min-width: 0;
        width: 100%;
    }
    .qty-remove-row {
        display: flex !important;
        width: 100%;
        gap: 12px;
        align-items: flex-end;
    }
    .line-qty-wrap {
        flex: 0 0 110px;
        min-width: 0;
        margin-bottom: 0;
    }
    .line-remove-wrap {
        flex: 1;
        margin-bottom: 16px !important;
        text-align: right;
    }
    .remove-line {
        width: auto !important;
        display: inline-block !important;
        padding: 12px 20px !important;
        font-size: 15px;
    }
    #addLineBtn {
        display: block !important;
        width: 100% !important;
        text-align: center;
        padding: 14px 20px !important;
        font-size: 16px;
    }
}
