* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #f4f5f7;
    color: #222;
}

/* ---------- Login page ---------- */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: #1f2a44;
}

.login-box {
    background: #fff;
    padding: 40px;
    border-radius: 8px;
    width: 340px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    text-align: center;
}

.login-box h1 { margin: 0 0 4px; font-size: 22px; }
.login-box h2 { margin: 0 0 20px; font-size: 15px; color: #666; font-weight: normal; }

.login-box form {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.login-box label {
    margin-top: 12px;
    margin-bottom: 4px;
    font-size: 14px;
}

.login-box input {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

.login-box button {
    margin-top: 20px;
    padding: 10px;
    background: #1f2a44;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 15px;
}

.login-box button:hover { background: #14203a; }

.error-msg {
    background: #ffe1e1;
    color: #a30000;
    padding: 8px;
    border-radius: 4px;
    font-size: 13px;
}

/* ---------- Main app shell ---------- */
.topbar {
    background: #1f2a44;
    color: #fff;
    padding: 14px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.topbar-brand { font-size: 20px; font-weight: bold; }
.topbar-user { font-size: 13px; }
.topbar-user a { color: #cdd6ea; }

.page-wrapper {
    display: flex;
    min-height: calc(100vh - 52px);
}

.sidebar {
    width: 250px;
    background: #fff;
    border-right: 1px solid #e0e0e0;
    padding: 16px 0;
}

.sidebar ul { list-style: none; margin: 0; padding: 0; }

.sidebar li a {
    display: block;
    padding: 10px 20px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
}

.sidebar li a:hover { background: #f0f2f5; }

.sidebar .section-title {
    padding: 14px 20px 4px;
    font-size: 12px;
    text-transform: uppercase;
    color: #999;
    font-weight: bold;
}

.sidebar details { margin: 0; }
.sidebar details summary {
    display: block;
    padding: 8px 20px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 400;
    line-height: normal;
    color: #333;
    cursor: pointer;
    list-style: none;
}
.sidebar details summary::-webkit-details-marker { display: none; }
.sidebar details summary::marker { content: ""; }
.sidebar details summary::before {
    content: "\25B8";
    display: inline-block;
    width: 14px;
    color: #999;
}
.sidebar details[open] summary::before { content: "\25BE"; }
.sidebar details summary:hover { background: #f0f2f5; }
.sidebar details ul { list-style: none; margin: 0; padding: 0; }
.sidebar details ul li a { padding-left: 38px; }

.main-content {
    flex: 1;
    padding: 24px;
}

.main-content h1 { margin-top: 0; }

/* ---------- Dashboard stat cards ---------- */
.stats-grid {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.stat-card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    min-width: 220px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.stat-label { font-size: 13px; color: #777; margin-bottom: 8px; }
.stat-value { font-size: 24px; font-weight: bold; color: #1f2a44; }

/* ---------- Generic forms/tables (used by later parts) ---------- */
.form-card {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    max-width: 480px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.form-card label { display: block; margin-top: 12px; font-size: 14px; }
.form-card input, .form-card select {
    width: 100%;
    padding: 8px;
    margin-top: 4px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.form-card button {
    margin-top: 20px;
    padding: 10px 18px;
    background: #1f2a44;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

table.data-table { width: 100%; border-collapse: collapse; background: #fff; }
table.data-table th, table.data-table td {
    padding: 10px;
    border-bottom: 1px solid #eee;
    text-align: left;
    font-size: 14px;
}
table.data-table th { background: #f8f9fb; }
table.data-table th.num, table.data-table td.num { text-align: right; }

/* ---------- Excel-style gridded table (Daily Cash Transaction Report) ---------- */
table.grid-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
table.grid-table th, table.grid-table td {
    border: 1px solid #333;
    padding: 5px 8px;
    text-align: left;
    line-height: 1.5;
    height: 1.5em;
}
table.grid-table th { background: #f0f2f5; font-weight: bold; }
table.grid-table th.num, table.grid-table td.num { text-align: right; }

@media print {
    table.grid-table { font-size: 11px; }
    table.grid-table th, table.grid-table td { padding: 3px 6px; }
}

/* ---------- Print support ---------- */
.print-header { display: none; }

@media print {
    .topbar, .sidebar, .no-print { display: none !important; }
    .page-wrapper { display: block; }
    .main-content { padding: 0; }
    body { background: #fff; }
    .print-header {
        display: block;
        margin-bottom: 20px;
        border-bottom: 2px solid #1f2a44;
        padding-bottom: 10px;
    }
    .print-header h1 { margin: 0; font-size: 20px; color: #1f2a44; }
    .print-header h2 { margin: 4px 0 0; font-size: 15px; font-weight: normal; }
    .print-header p { margin: 4px 0 0; font-size: 13px; color: #555; }
    .form-card { box-shadow: none; border: 1px solid #ccc; }
}
