
:root {
    --bg: #edf1f5;
    --surface: #ffffff;
    --surface-soft: #f7f9fc;
    --text: #172235;
    --muted: #66758a;
    --line: #d6deea;
    --primary: #1f4b99;
    --primary-dark: #163b7c;
    --accent: #2d6cdf;
    --danger: #c0392b;
    --success: #1f7a4c;
    --shadow: 0 14px 34px rgba(15, 23, 42, 0.07);
    --radius: 18px;
    --radius-sm: 12px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
    background: linear-gradient(180deg, #f6f8fb 0%, var(--bg) 100%);
    color: var(--text);
    min-height: 100vh;
    padding: 24px;
}
img { max-width: 100%; height: auto; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

.container {
    max-width: 1280px;
    margin: 0 auto;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 24px;
    box-shadow: var(--shadow);
    padding: 28px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--line);
}

.logo-wrap {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.logo-wrap img {
    width: auto;
    max-width: 240px;
    max-height: 72px;
    object-fit: contain;
    display: block;
}

.page-title { min-width: 0; }
.page-title h1,
.page-title h2,
.page-title h3 {
    margin: 0;
    color: var(--text);
    text-align: left;
    font-size: 34px;
    line-height: 1.1;
}
.page-title p {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 15px;
}
.badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #eef4ff;
    color: var(--primary-dark);
    border: 1px solid #d7e3fb;
    border-radius: 999px;
    padding: 9px 14px;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.7fr); }
.stack { display: flex; flex-direction: column; gap: 20px; }
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: 0 6px 18px rgba(15,23,42,0.03);
}
.card-muted { background: linear-gradient(180deg, #fff 0%, var(--surface-soft) 100%); }
.card-title {
    margin: 0 0 18px;
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
}
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.stat {
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 16px;
}
.stat-label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.stat-value { font-size: 27px; font-weight: 700; line-height: 1.15; }
.meta-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.meta-item {
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 14px 15px;
}
.meta-item .label {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: 6px;
}
.meta-item .value { font-size: 18px; font-weight: 700; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; align-items: end; }
.form-group { display: flex; flex-direction: column; gap: 8px; }
label { font-size: 14px; font-weight: 700; color: var(--text); }
input[type="text"], select {
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    padding: 11px 13px;
    font-size: 15px;
    color: var(--text);
    outline: none;
}
input[type="text"]:focus, select:focus {
    border-color: #9db7ee;
    box-shadow: 0 0 0 4px rgba(45,108,223,.12);
}
button, .btn, .btn-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    border-radius: 12px;
    padding: 0 16px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: .15s ease;
    border: 1px solid transparent;
}
button {
    background: linear-gradient(180deg, var(--accent) 0%, var(--primary) 100%);
    color: #fff;
    box-shadow: 0 10px 22px rgba(31,75,153,.16);
}
button:hover, .btn-primary:hover { transform: translateY(-1px); }
.btn.btn-primary,
.btn-primary {
    background: linear-gradient(180deg, #2fcb73 0%, #1f8f4b 100%);
    color: #fff;
    border-color: #1f8f4b;
    box-shadow: 0 10px 22px rgba(31, 122, 76, .22);
}
.btn.btn-primary:hover,
.btn-primary:hover {
    background: linear-gradient(180deg, #29b866 0%, #18713b 100%);
    border-color: #18713b;
}
.btn-print.is-disabled {
    opacity: .55;
    cursor: not-allowed;
    pointer-events: auto;
    box-shadow: none;
}
.btn-link {
    background: #fff;
    color: var(--primary);
    border-color: var(--line);
}
.btn-link:hover { background: #f7faff; }
.btn-danger {
    background: #fff5f4;
    color: var(--danger);
    border-color: #f0c8c3;
}
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.toolbar-top { margin-top: 0; margin-bottom: 18px; }

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 14px;
}
table { width: 100%; border-collapse: collapse; }
thead th {
    background: #eef4ff;
    color: var(--text);
    font-size: 13px;
    font-weight: 800;
    padding: 13px 14px;
    text-align: left;
    border-bottom: 1px solid var(--line);
}
tbody td {
    padding: 13px 14px;
    border-bottom: 1px solid #e8eef6;
    vertical-align: middle;
}
tbody tr:nth-child(even) td { background: #fbfcfe; }
tbody tr:hover td { background: #f6f9fd; }
tbody tr:last-child td { border-bottom: none; }
.table-total td { background: #eef4ff !important; font-weight: 800; }
.inline-form { display: inline; }
.top-nav, .back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary);
    font-weight: 700;
    margin-bottom: 20px;
}
.muted { color: var(--muted); }
.chart-card canvas { width: 100% !important; height: 340px !important; }
.footer-note { margin-top: 20px; color: var(--muted); font-size: 13px; }

@media (max-width: 920px) {
    body { padding: 14px; }
    .container { padding: 18px; border-radius: 18px; }
    .page-header { align-items: flex-start; }
    .grid-2 { grid-template-columns: 1fr; }
    .page-title h1, .page-title h2, .page-title h3 { font-size: 28px; }
    .logo-wrap { align-items: flex-start; flex-direction: column; }
    .logo-wrap img { max-width: 200px; max-height: 64px; }
    .badge { white-space: normal; }
}


.btn-print {
    background: linear-gradient(180deg, #2ecb74 0%, #1f9d57 100%) !important;
    border-color: #1f9d57 !important;
    color: #ffffff !important;
    box-shadow: 0 10px 22px rgba(31, 157, 87, .24);
}

.btn-print:hover,
.btn-print:focus {
    background: linear-gradient(180deg, #27b867 0%, #18834a 100%) !important;
    color: #ffffff !important;
}
