:root {
    --primary: #d2601a;
    --text: #1d3c45;
    --soft: #fff1e1;
    --white: #ffffff;
    --border: #e5e7eb;
    --danger: #b91c1c;
    --success: #166534;
    --warning: #92400e;
}

* {
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background: var(--soft);
    color: var(--text);
    margin: 0;
}

a {
    color: inherit;
}

.app-header {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 18px 28px;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
}

.app-brand strong {
    display: block;
    color: var(--primary);
    font-size: 24px;
}

.app-brand span {
    font-size: 14px;
    opacity: 0.8;
}

.app-user {
    text-align: right;
    font-size: 14px;
}

.app-main {
    max-width: 1100px;
    margin: 32px auto;
    padding: 0 22px;
}

.panel {
    background: var(--white);
    border-left: 8px solid var(--primary);
    border-radius: 16px;
    padding: 26px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.07);
}

.panel h1 {
    margin: 0 0 8px;
    color: var(--primary);
}

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

.card {
    background: var(--white);
    border-radius: 16px;
    padding: 22px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.06);
    border: 1px solid var(--border);
}

.card .number {
    font-size: 34px;
    font-weight: bold;
    color: var(--primary);
    margin-bottom: 8px;
}

.card .label {
    font-weight: bold;
}

.card .hint {
    font-size: 13px;
    opacity: 0.75;
    margin-top: 6px;
}

.actions {
    margin-top: 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.button {
    display: inline-block;
    padding: 11px 15px;
    border-radius: 10px;
    background: var(--primary);
    color: #ffffff;
    text-decoration: none;
    font-weight: bold;
    border: 0;
    cursor: pointer;
}

.button.secondary {
    background: var(--text);
}

.app-footer {
    max-width: 1100px;
    margin: 28px auto;
    padding: 0 22px;
    font-size: 13px;
    opacity: 0.75;
}

.form-card {
    max-width: 460px;
    margin: 8vh auto 0;
    background: var(--white);
    border-left: 8px solid var(--primary);
    border-radius: 14px;
    padding: 28px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.form-card h1 {
    margin-top: 0;
    color: var(--primary);
}

.subtitle {
    margin-top: -8px;
    opacity: 0.85;
}

label {
    display: block;
    margin-top: 18px;
    font-weight: bold;
}

input,
select,
textarea {
    width: 100%;
    padding: 12px;
    margin-top: 6px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 16px;
    font-family: Arial, sans-serif;
}

textarea {
    min-height: 120px;
    resize: vertical;
}

.alert {
    padding: 12px;
    border-radius: 8px;
    font-weight: bold;
}

.alert.error {
    background: #fee2e2;
    border: 1px solid var(--danger);
    color: var(--danger);
}

.alert.success {
    background: #dcfce7;
    border: 1px solid var(--success);
    color: var(--success);
}

.page-title {
    margin: 0 0 8px;
    color: var(--primary);
}

.page-subtitle {
    margin-top: 0;
    opacity: 0.85;
}

.two-columns {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 22px;
    align-items: start;
    margin-top: 24px;
}

.table-wrapper {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
    font-size: 15px;
}

.data-table th,
.data-table td {
    border-bottom: 1px solid var(--border);
    padding: 12px 10px;
    text-align: left;
    vertical-align: top;
}

.data-table th {
    background: #fff7ed;
    color: var(--text);
    font-weight: bold;
}

.data-table th:last-child,
.data-table td:last-child {
    width: 1%;
    white-space: nowrap;
}

.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: bold;
    background: #e5e7eb;
    color: var(--text);
}

.badge.current {
    background: #dcfce7;
    color: var(--success);
}

.form-actions {
    margin-top: 22px;
}

.checkbox-line {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 18px;
}

.checkbox-line input {
    width: auto;
    margin: 0;
}

.empty-state {
    padding: 18px;
    background: #fff7ed;
    border: 1px dashed var(--primary);
    border-radius: 12px;
    margin-top: 12px;
}

.inline-actions {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    align-items: center;
    white-space: nowrap;
}

.inline-actions .button {
    white-space: nowrap;
}

.button.small {
    padding: 7px 10px;
    border-radius: 8px;
    font-size: 13px;
}

.button.danger {
    background: var(--danger);
}

.inline-form {
    display: inline;
    margin: 0;
}

.muted {
    opacity: 0.7;
    font-size: 13px;
}

.form-card-wide {
    background: var(--white);
    border-left: 8px solid var(--primary);
    border-radius: 16px;
    padding: 26px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.07);
}

.nowrap {
    white-space: nowrap;
}

@media (max-width: 850px) {
    .app-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .app-user {
        text-align: left;
    }

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

    .two-columns {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    .grid {
        grid-template-columns: 1fr;
    }

    .app-main {
        margin-top: 20px;
    }
}