:root {
    --bg: #f5f3f0;
    --surface: #ffffff;
    --text: #1a2332;
    --muted: #5c6b7a;
    --primary: #f58220;
    --primary-hover: #e07518;
    --primary-light: #fff4eb;
    --success: #059669;
    --danger: #dc2626;
    --warning: #d97706;
    --border: #e8e4df;
    --radius: 12px;
    --shadow: 0 4px 24px rgba(245, 130, 32, 0.08);
    --font: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.5;
    color: var(--text);
    background: linear-gradient(160deg, var(--primary-light) 0%, var(--bg) 45%, #faf9f7 100%);
}

.container {
    width: min(960px, 100% - 2rem);
    margin-inline: auto;
}

.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    text-decoration: none;
    color: var(--text);
    font-weight: 700;
    min-width: 0;
}

.brand-logo-wrap {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    line-height: 0;
}

.brand-logo {
    display: block;
    height: 46px;
    width: auto;
    max-width: min(280px, 72vw);
    object-fit: contain;
    border-radius: 10px;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.user-chip {
    font-size: 0.875rem;
    color: var(--muted);
    max-width: 12rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.main-content {
    padding: 1.5rem 0 3rem;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
}

.card-narrow {
    max-width: 420px;
    margin-inline: auto;
}

.card-title {
    margin: 0 0 0.35rem;
    font-size: 1.5rem;
}

.card-subtitle {
    margin: 0 0 1.25rem;
    color: var(--muted);
    font-size: 0.95rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 600;
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font: inherit;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(245, 130, 32, 0.2);
}

textarea.form-control {
    min-height: 160px;
    resize: vertical;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.7rem 1.1rem;
    border: none;
    border-radius: 8px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, transform 0.1s;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-ghost {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--border);
}

.btn-ghost:hover {
    background: var(--primary-light);
    border-color: rgba(245, 130, 32, 0.35);
}

.btn-sm {
    padding: 0.45rem 0.75rem;
    font-size: 0.875rem;
}

.btn-block {
    width: 100%;
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.alert {
    padding: 0.85rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-warning {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
}

.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

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

.data-table th {
    background: #f8fafc;
    font-weight: 600;
    white-space: nowrap;
}

.data-table tbody tr:hover {
    background: #f8fafc;
}

.col-date {
    width: 11rem;
    white-space: nowrap;
}

.col-provider {
    width: 7rem;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--muted);
}

.site-footer {
    padding: 1.25rem 0 2rem;
    text-align: center;
    color: var(--muted);
    font-size: 0.85rem;
}

.meta-line {
    margin: 0 0 0.5rem;
    font-size: 0.9rem;
    color: var(--muted);
}

@media (max-width: 640px) {
    .card {
        padding: 1.15rem;
    }

    .data-table {
        font-size: 0.85rem;
    }

    .col-date,
    .col-provider {
        width: auto;
    }

    .header-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .brand-logo {
        height: 40px;
        max-width: min(260px, 85vw);
    }

    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .toolbar .btn {
        width: 100%;
    }
}
