:root {
    --bg: #f4f6fb;
    --surface: #ffffff;
    --primary: #2b6cb0;
    --primary-dark: #1f4f8b;
    --text: #1f2937;
    --muted: #6b7280;
    --border: #d1d5db;
    --shadow: 0 18px 30px rgba(15, 23, 42, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(180deg, #eef4ff 0%, #f8fafc 100%);
    color: var(--text);
}

.page-wrapper {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 24px;
}

.login-card {
    width: min(480px, 100%);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 36px;
    box-shadow: var(--shadow);
}

.brand h1 {
    margin: 0 0 8px;
    font-size: 2rem;
}

.brand p {
    margin: 0;
    color: var(--muted);
}

.form-group {
    display: grid;
    gap: 8px;
    margin-top: 20px;
}

label {
    font-size: 0.95rem;
    font-weight: 600;
}

input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #f8fafc;
    font-size: 1rem;
    color: var(--text);
}

input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(66, 153, 225, 0.12);
}

.btn-primary {
    width: 100%;
    margin-top: 28px;
    border: none;
    border-radius: 14px;
    padding: 14px 18px;
    background: var(--primary);
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.helper-text {
    margin: 20px 0 0;
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.5;
}

.alert {
    margin-bottom: 18px;
    padding: 14px 16px;
    border-radius: 14px;
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.app-shell {
    display: flex;
    min-height: 100vh;
    background: #f4f7fb;
}

.sidebar {
    width: 280px;
    min-height: 100vh;
    max-height: 100vh;
    background: #0f172a;
    color: #e2e8f0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 28px 20px;
    position: fixed;
    left: 0;
    top: 0;
    box-shadow: 4px 0 24px rgba(15, 23, 42, 0.08);
    overflow-y: auto;
    gap: 16px;
}

.brand-mark {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background: #2563eb;
    display: grid;
    place-items: center;
    font-weight: 700;
    color: #ffffff;
    font-size: 1.1rem;
}

.brand-name,
.brand-tag {
    display: block;
}

.brand-name {
    font-size: 1.15rem;
    font-weight: 700;
}

.brand-tag {
    color: #94a3b8;
    font-size: 0.9rem;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 16px;
    text-decoration: none;
    color: #e2e8f0;
    font-weight: 500;
    transition: background 0.2s ease, color 0.2s ease;
}

.sidebar-link:hover,
.sidebar-link.active {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.sidebar-footer {
    margin-top: auto;
}

.logout-link {
    color: #f8fafc;
}

.main-area {
    margin-left: 280px;
    width: calc(100% - 280px);
    padding: 32px 40px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}

.topbar-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    width: 100%;
}

.topbar-info h1 {
    margin: 0;
    font-size: clamp(1.6rem, 2vw, 2.4rem);
    color: #0f172a;
}

.topbar-subtitle {
    display: block;
    color: #64748b;
    margin-bottom: 6px;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #334155;
}

.topbar-user strong {
    color: #0f172a;
}

.btn-logout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 22px;
    border-radius: 14px;
    background: #2563eb;
    color: #ffffff;
    text-decoration: none;
    font-weight: 700;
    transition: background 0.2s ease;
}

.btn-logout:hover {
    background: #1d4ed8;
}

.dashboard-content {
    display: grid;
    gap: 24px;
}

.page-panel {
    background: #ffffff;
    border-radius: 24px;
    padding: 28px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
    border: 1px solid rgba(15, 23, 42, 0.05);
}

.panel-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}

.panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.panel-header > div:last-child {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.panel-header > div:last-child a {
    white-space: nowrap;
}

.page-label {
    display: block;
    color: #64748b;
    font-size: 0.88rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    margin-bottom: 8px;
}

.search-panel {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.search-input {
    flex: 1;
    padding: 14px 18px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 16px;
    background: #f8fafc;
    color: #0f172a;
    min-width: 0;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
}

.data-table thead {
    background: #f8fafc;
}

.data-table th,
.data-table td {
    padding: 16px 18px;
    text-align: left;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.data-table th {
    color: #475569;
    font-size: 0.95rem;
    font-weight: 600;
}

.data-table tr:hover {
    background: rgba(37, 99, 235, 0.04);
}

.table-responsive {
    overflow-x: auto;
}

.cashier-table-responsive {
    max-width: 100%;
}

.cashier-history-table th,
.cashier-history-table td {
    padding: 12px 14px;
    white-space: nowrap;
}

.empty-row {
    text-align: center;
    color: #64748b;
    padding: 32px 0;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 0.85rem;
    text-transform: capitalize;
    letter-spacing: 0.02em;
}

.status-active {
    background: #ecfdf5;
    color: #166534;
}

.status-inactive {
    background: #f8fafc;
    color: #475569;
}

.status-open {
    background: #ecfdf5;
    color: #166534;
}

.status-closed {
    background: #eff6ff;
    color: #1e40af;
}

.status-warning {
    background: #fffbeb;
    color: #92400e;
}

.status-danger {
    background: #fee2e2;
    color: #991b1b;
}

.report-filter-panel {
    display: flex;
    align-items: end;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 22px;
}

.report-filter-panel label {
    display: grid;
    gap: 8px;
    min-width: 180px;
}

.report-filter-panel .btn-secondary {
    min-height: 52px;
}

.report-cards {
    margin-bottom: 24px;
}

.report-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

.report-section {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.report-section:first-of-type {
    border-top: none;
}

.report-cashier-table th,
.report-cashier-table td {
    padding: 12px 14px;
    white-space: nowrap;
}

.action-column {
    display: flex;
    align-items: center;
    gap: 10px;
}

.link-button {
    color: #2563eb;
    text-decoration: none;
    font-weight: 600;
}

.link-button:hover {
    text-decoration: underline;
}

.link-danger {
    color: #dc2626;
}

.tag-inactive {
    display: inline-flex;
    padding: 8px 12px;
    border-radius: 999px;
    background: #f8fafc;
    color: #475569;
    font-size: 0.85rem;
}

.form-card {
    display: grid;
    gap: 24px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.form-grid label,
.full-width {
    display: grid;
    gap: 10px;
    font-weight: 600;
    color: #0f172a;
}

input[type="text"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid rgba(15, 23, 42, 0.13);
    border-radius: 16px;
    background: #f8fafc;
    color: #0f172a;
    font-size: 1rem;
}

textarea {
    resize: vertical;
}

.settings-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.8fr) minmax(320px, 1fr);
    gap: 24px;
}

.settings-aside {
    display: grid;
    gap: 24px;
}

.settings-panel {
    background: #ffffff;
    border-radius: 24px;
    padding: 24px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 18px 30px rgba(15, 23, 42, 0.06);
}

.logo-preview {
    width: 100%;
    max-height: 240px;
    object-fit: contain;
    border-radius: 20px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: #f8fafc;
    padding: 20px;
}

.empty-logo {
    display: grid;
    place-items: center;
    min-height: 240px;
    color: #64748b;
    background: #f8fafc;
    border: 1px dashed rgba(100, 116, 139, 0.35);
    border-radius: 20px;
    text-align: center;
    padding: 24px;
}

.required {
    color: #dc2626;
    margin-left: 4px;
}

.alert-success {
    margin-bottom: 18px;
    padding: 16px 20px;
    border-radius: 18px;
    background: #ecfdf5;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.alert-error {
    margin-bottom: 18px;
    padding: 16px 20px;
    border-radius: 18px;
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-info {
    margin-bottom: 18px;
    padding: 16px 20px;
    border-radius: 18px;
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

.alert-warning {
    margin-bottom: 18px;
    padding: 16px 20px;
    border-radius: 18px;
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
}

.actions-row,
.form-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.actions-row .btn-primary,
.actions-row .btn-secondary,
.form-actions .btn-primary,
.form-actions .btn-secondary,
.panel-header-row .btn-primary,
.panel-header-row .btn-secondary {
    width: auto;
    margin-top: 0;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 14px 18px;
    border-radius: 14px;
    background: #f8fafc;
    color: #1f2937;
    border: 1px solid rgba(15, 23, 42, 0.13);
    text-decoration: none;
    font-weight: 700;
    cursor: pointer;
}

.btn-secondary:hover {
    background: #eef2f7;
}

.form-panel {
    display: grid;
    gap: 20px;
}

.form-panel label {
    display: grid;
    gap: 10px;
}

.cashier-card,
.cashier-summary,
.cashier-notes {
    display: grid;
    gap: 14px;
    margin-bottom: 22px;
    padding: 20px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 18px;
    background: #ffffff;
}

.cashier-status {
    width: fit-content;
    padding: 8px 12px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.9rem;
}

.cashier-status-open {
    background: #ecfdf5;
    color: #166534;
}

.cashier-details {
    display: grid;
    gap: 10px;
    color: #334155;
}

.cashier-summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.cashier-summary-row:last-child {
    padding-bottom: 0;
    border-bottom: none;
}

.cashier-summary-total {
    font-size: 1.05rem;
    color: #0f172a;
}

.checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 10px;
    padding-top: 28px;
}

.checkbox-label input {
    width: auto;
}

.cashier-notes p {
    margin: 0;
    line-height: 1.6;
}

.dashboard-topcards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.indicator-card {
    background: #ffffff;
    border-radius: 24px;
    padding: 28px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
    border: 1px solid rgba(15, 23, 42, 0.05);
}

.indicator-title {
    font-size: 0.95rem;
    color: #64748b;
    margin-bottom: 14px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.indicator-value {
    font-size: 2rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 10px;
}

.indicator-meta {
    color: #64748b;
    font-size: 0.95rem;
    line-height: 1.6;
}

.dashboard-shortcuts {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
}

.shortcut-card {
    background: #ffffff;
    border-radius: 24px;
    padding: 28px;
    border: 1px solid rgba(15, 23, 42, 0.05);
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.06);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 20px;
}

.shortcut-card h3 {
    margin: 0;
    font-size: 1.05rem;
}

.shortcut-card p {
    margin: 0;
    color: #475569;
    line-height: 1.7;
}

.dashboard-panel {
    background: #ffffff;
    border-radius: 24px;
    padding: 28px;
    border: 1px solid rgba(15, 23, 42, 0.05);
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.06);
}

.dashboard-visuals {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.chart-card {
    background: #ffffff;
    border-radius: 24px;
    padding: 24px;
    border: 1px solid rgba(15, 23, 42, 0.05);
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.06);
    min-height: 320px;
    display: flex;
    flex-direction: column;
}

.chart-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 18px;
}

.chart-card-header h3 {
    margin: 0;
    font-size: 1.05rem;
}

.chart-card-header p {
    margin: 0;
    color: #64748b;
    font-size: 0.95rem;
    line-height: 1.5;
}

.chart-wrapper {
    flex: 1;
    min-height: 240px;
    position: relative;
}

.chart-wrapper canvas {
    width: 100% !important;
    height: 100% !important;
}

.chart-empty {
    flex: 1;
    display: grid;
    place-items: center;
    text-align: center;
    color: #475569;
    border: 1px dashed rgba(100, 116, 139, 0.35);
    border-radius: 20px;
    background: #f8fafc;
    padding: 24px;
}

.cashier-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 10px;
}

.cashier-card-item {
    background: #f8fafc;
    border-radius: 20px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    border: 1px solid rgba(15, 23, 42, 0.05);
}

.cashier-card-item span {
    color: #64748b;
    font-size: 0.95rem;
}

.cashier-card-item strong {
    color: #0f172a;
    font-size: 1.25rem;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}

.panel-header h2 {
    margin: 0;
    font-size: 1.35rem;
}

.panel-header p {
    margin: 0;
    color: #64748b;
}

.panel-body.empty-state {
    min-height: 190px;
    display: grid;
    place-items: center;
    text-align: center;
    color: #475569;
    border: 1px dashed rgba(100, 116, 139, 0.35);
    border-radius: 20px;
    padding: 28px;
    background: #f8fafc;
}

.panel-body.empty-state strong {
    display: block;
    margin-bottom: 10px;
    font-size: 1.05rem;
    color: #0f172a;
}

.app-footer {
    margin-top: 40px;
    color: #64748b;
    font-size: 0.95rem;
    text-align: center;
}

@media (max-width: 1120px) {
    .dashboard-topcards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-shortcuts {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .report-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 860px) {
    .main-area {
        margin-left: 0;
        width: 100%;
        padding: 24px;
    }

    .sidebar {
        position: relative;
        width: 100%;
        min-height: auto;
    }

    .topbar {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 640px) {
    .dashboard-topcards,
    .dashboard-shortcuts {
        grid-template-columns: 1fr;
    }

    .sidebar {
        padding: 24px 16px;
    }

    .btn-logout {
        width: 100%;
    }

    .report-filter-panel {
        align-items: stretch;
    }

    .report-filter-panel label,
    .report-filter-panel .btn-secondary {
        width: 100%;
    }
}
