:root {
    --brand: #ff6a00;
    --brand-dark: #e45d00;
    --success: #1b5e20;
    --success-bg: #e8f5e9;
    --error: #b00020;
    --error-bg: #ffe3e3;
    --muted: #667085;
    --line: #e7e7e7;
    --panel: #ffffff;
    --bg: #f4f6f9;
    --text: #111827;
    --shadow: 0 10px 30px rgba(17, 24, 39, 0.08);
    --radius: 14px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, sans-serif;
    color: var(--text);
    background: var(--bg);
}

a {
    color: var(--brand);
    text-decoration: none;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

input,
select,
button {
    font: inherit;
}

.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #ff6a00, #ffb347);
}

.login-shell,
.single-page-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px 16px;
}

.login-box,
.single-card,
.panel,
.welcome-card,
.stat-card {
    background: var(--panel);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.login-box {
    width: 380px;
    max-width: 100%;
    padding: 36px;
    text-align: center;
}

.login-logo {
    width: 110px;
    max-width: 100%;
    margin-bottom: 12px;
}

.login-box h1 {
    color: var(--brand);
    font-size: 20px;
    margin-bottom: 24px;
}

.login-footer {
    margin-top: 16px;
    font-size: 12px;
    color: #666;
}

.stack-form input,
.stack-form select,
.stack-form button {
    width: 100%;
}

.stack-form input,
.stack-form select {
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 14px;
    background: #fff;
}

.field-label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 600;
}

.password-box {
    position: relative;
}

.password-box input {
    padding-right: 78px;
}

.ghost-button {
    position: absolute;
    right: 8px;
    top: 8px;
    width: auto;
    border: 0;
    background: transparent;
    color: var(--brand);
    font-weight: 700;
    cursor: pointer;
}

.remember-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    font-size: 14px;
}

.remember-row input {
    margin: 0;
    width: auto;
}

.primary-button,
.action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 8px;
    border: 0;
    cursor: pointer;
    font-weight: 700;
}

.primary-button,
.action-button {
    background: var(--brand);
    color: #fff;
}

.primary-button:hover,
.action-button:hover {
    background: var(--brand-dark);
}

.action-button-alt {
    background: #25d366;
}

.action-button-alt:hover {
    background: #1daa53;
}

.full-width {
    width: 100%;
}

.alert {
    padding: 12px 14px;
    border-radius: 8px;
    margin-bottom: 14px;
}

.alert-success {
    background: var(--success-bg);
    color: var(--success);
}

.alert-error {
    background: var(--error-bg);
    color: var(--error);
}

.ticker {
    background: var(--brand);
    color: #fff;
    padding: 9px;
    font-weight: 700;
}

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

.sidebar {
    width: 235px;
    background: #fff;
    padding: 24px 18px;
    box-shadow: 2px 0 14px rgba(0, 0, 0, 0.08);
}

.brand {
    text-align: center;
    margin-bottom: 22px;
}

.brand img {
    max-width: 120px;
    max-height: 80px;
}

.sidebar a {
    display: block;
    color: var(--text);
    padding: 13px 14px;
    margin: 9px 0;
    border-radius: 9px;
    font-weight: 700;
}

.sidebar a:hover,
.sidebar a.active {
    background: var(--brand);
    color: #fff;
}

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

.page-header,
.panel-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 22px;
}

.page-header h1,
.panel-top h1 {
    margin-bottom: 6px;
    font-size: 32px;
}

.page-header p,
.panel-top p,
.subtle-text {
    color: var(--muted);
}

.welcome-card {
    padding: 14px 18px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 22px;
}

.stat-card {
    padding: 20px;
    border-left: 5px solid var(--brand);
}

.stat-card h3 {
    margin-bottom: 10px;
    color: #555;
    font-size: 15px;
}

.stat-number {
    font-size: 28px;
    font-weight: 700;
}

.panel {
    padding: 20px;
}

.narrow-panel {
    max-width: 880px;
}

.panel-header {
    margin-bottom: 14px;
}

.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.compact-row {
    align-items: center;
}

.centered-row {
    justify-content: center;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
}

th {
    background: var(--brand);
    color: #fff;
}

.align-right {
    text-align: right;
}

.align-center {
    text-align: center;
}

.actions-cell {
    white-space: nowrap;
}

.single-card {
    width: 100%;
    max-width: 760px;
    padding: 28px;
}

.medium-card {
    max-width: 560px;
}

.large-card {
    max-width: 780px;
}

.centered-card {
    text-align: center;
}

.centered-text {
    text-align: center;
}

.top-gap {
    margin-top: 18px;
}

.calc-grid {
    background: #fff3e0;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 14px;
}

.calc-status {
    margin-top: 10px;
    font-weight: 700;
}

.calc-status-good {
    color: #1f7a1f;
}

.calc-status-bad {
    color: var(--error);
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
    padding: 14px;
    background: #fff3e8;
    border-radius: 10px;
    margin-bottom: 16px;
}

.invoice-detail-table td:first-child {
    width: 220px;
}

.section-title {
    margin-top: 24px;
}

@media (max-width: 900px) {
    .layout {
        display: block;
    }

    .sidebar {
        width: 100%;
        height: auto;
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .filters-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .page-header,
    .panel-top {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 560px) {
    .login-box,
    .single-card,
    .main-content {
        padding: 18px;
    }

    .stats-grid,
    .filters-grid {
        grid-template-columns: 1fr;
    }

    th,
    td {
        font-size: 12px;
        padding: 10px;
    }
}