@font-face {
    font-family: "Be Vietnam Pro";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/vi-400.woff2") format("woff2");
    unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
    font-family: "Be Vietnam Pro";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/latin-400.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: "Be Vietnam Pro";
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url("../fonts/vi-500.woff2") format("woff2");
    unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
    font-family: "Be Vietnam Pro";
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url("../fonts/latin-500.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: "Be Vietnam Pro";
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url("../fonts/vi-600.woff2") format("woff2");
    unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
    font-family: "Be Vietnam Pro";
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url("../fonts/latin-600.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: "Be Vietnam Pro";
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("../fonts/vi-700.woff2") format("woff2");
    unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
    font-family: "Be Vietnam Pro";
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("../fonts/latin-700.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
:root {
    --ink: #16324a;
    --side: #0c4d86;
    --blue: #1d7af0;
    --blue-dark: #0b5fbe;
    --red: #e10600;
    --red-dark: #b10500;
    --paper: #f3f8fc;
    --card: #ffffff;
    --line: #d7e6f2;
    --muted: #5d7386;
    --danger: #e10600;
    --warn: #9a3412;
    --ok: #157a3a;
    --shadow: 0 8px 24px rgba(12, 77, 134, .08);
}
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: "Be Vietnam Pro", "Segoe UI", Arial, sans-serif;
    font-size: 13px;
    color: var(--ink);
    background: var(--paper);
}
a { color: var(--blue-dark); text-decoration: none; }
.shell { display: flex; min-height: 100vh; }
.side {
    width: 250px;
    background: var(--side);
    color: #f5f5f5;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}
.brand {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 22px 18px 16px;
    color: inherit;
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.brand strong, .brand small { display: block; }
.brand small { color: #a1a1aa; font-size: 12px; margin-top: 2px; }
.brand-mark {
    width: 40px; height: 40px; border-radius: 10px;
    display: grid; place-items: center;
    background: var(--red); color: #fff; font-weight: 700;
}
.side nav { display: flex; flex-direction: column; padding: 14px 10px; gap: 4px; }
.side nav a {
    color: #d4d4d8; padding: 8px 12px; border-radius: 8px; font-weight: 500; font-size: 13px;
}
.side nav a.active, .side nav a:hover { background: var(--blue); color: white; }
.side-foot {
    margin-top: auto; padding: 16px 18px 20px;
    display: flex; justify-content: space-between; gap: 8px;
    border-top: 1px solid rgba(255,255,255,.08); font-size: 13px;
}
.side-foot a { color: #ffd0cc; }
.main { flex: 1; padding: 28px 32px 48px; min-width: 0; }
.page-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-end; margin-bottom: 20px; }
.page-head h1 { margin: 0 0 4px; font-size: 20px; letter-spacing: -.03em; }
.page-head p { margin: 0; color: var(--muted); }
.row-actions, .filters, .btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.card {
    background: var(--card); border: 1px solid var(--line); border-radius: 14px;
    box-shadow: var(--shadow); padding: 18px;
}
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stat strong { display: block; font-size: 20px; margin-top: 4px; }
.stat span { color: var(--muted); font-size: 13px; }
.grid-2 { display: grid; grid-template-columns: 1.4fr .8fr; gap: 16px; }
.grid-form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.cust-form .grid-form { grid-template-columns: repeat(3, 1fr); gap: 8px 10px; }
.cust-form p { margin: 0; }
.cust-form label { font-size: 11px; margin-bottom: 3px; color: #5d7386; }
.cust-form input, .cust-form select, .cust-form textarea { padding: 6px 8px; font-size: 13px; border-radius: 6px; }
.cust-form textarea { min-height: 58px; }
.date-parts { display: grid; grid-template-columns: .7fr 1fr .9fr; gap: 4px; }
.date-parts select, .term-parts select { padding: 6px 4px; font-size: 13px; }
.term-parts { display: grid; gap: 3px; }
.term-end { font-size: 11px; color: var(--muted); min-height: 14px; }
.svc-card { border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin-bottom: 10px; background: #fff; }
.svc-specs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }
.svc-specs p { margin: 0; }
.domain-row { display: grid; grid-template-columns: 1.15fr .9fr 1.35fr .7fr .75fr auto; gap: 8px; align-items: end; margin-bottom: 8px; }
.domain-row p { margin: 0; min-width: 0; }
.domain-row .term-parts { display: flex; align-items: center; gap: 6px; }
.domain-row .term-parts select { width: 88px; flex: none; }
.domain-row .term-end { white-space: nowrap; }
.domain-remove { background: none; border: 0; color: var(--red); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; padding: 6px 0; }
.form-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.form-tabs button { border: 1px solid #d7e6f2; background: #fff; color: #16324a; border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.form-tabs button.active { background: #1d7af0; color: #fff; border-color: #1d7af0; }
.form-panel { display: none; }
.form-panel.active { display: block; }
.span-3 { grid-column: span 3; }
.form-save { display: flex; justify-content: space-between; gap: 12px; align-items: end; flex-wrap: wrap; margin-top: 12px; padding-top: 10px; border-top: 1px solid #d7e6f2; }
.price-row { display: grid; grid-template-columns: repeat(6, minmax(80px, 1fr)); gap: 8px; }
.vps-catalog { margin-bottom: 12px; }
.vps-catalog .btn { align-self: start; }
.span-2 { grid-column: span 2; }
label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
input, select, textarea {
    width: 100%; border: 1px solid #d4d4d8; background: white; color: var(--ink);
    border-radius: 8px; padding: 10px 12px; font: inherit;
}
textarea { min-height: 120px; resize: vertical; }
.section-title { margin: 8px 0 0; font-size: 16px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 13px; }
th { font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.btn, button.btn {
    display: inline-flex; align-items: center; justify-content: center;
    border: 0; border-radius: 8px; padding: 10px 14px; font: inherit; font-weight: 600;
    background: var(--blue); color: white; cursor: pointer;
}
.btn:hover { background: var(--blue-dark); }
.btn.secondary { background: #0c4d86; color: white; }
.btn.danger { background: var(--red); }
.btn.small { padding: 6px 10px; font-size: 13px; }
.badge { display: inline-flex; border-radius: 999px; padding: 3px 8px; font-size: 12px; font-weight: 600; }
.badge.ok { background: #e8f6ee; color: var(--ok); }
.badge.warn { background: #fff1e8; color: var(--warn); }
.badge.danger { background: #ffe4e2; color: var(--danger); }
.badge.muted { background: #f4f4f5; color: var(--muted); }
.flash { padding: 12px 14px; border-radius: 10px; margin-bottom: 16px; }
.flash.ok { background: #e8f6ee; color: var(--ok); }
.flash.err { background: #ffe4e2; color: var(--danger); }
.login-wrap {
    min-height: 100vh; display: grid; place-items: center; padding: 24px;
    background: linear-gradient(160deg, #0c4d86, #1d7af0 55%, #e10600);
}
.login-card { width: min(440px, 100%); }
.login-card h1 { margin: 8px 0; }
.muted { color: var(--muted); }
.timeline { display: flex; flex-direction: column; gap: 12px; }
.timeline article { border-left: 3px solid var(--blue); padding: 4px 0 4px 12px; }
.search { min-width: 220px; }
.quote-table input { padding: 8px; }
.total-box { margin-top: 12px; display: grid; gap: 6px; justify-content: end; text-align: right; }
.print-sheet { width: 820px; margin: 24px auto; background: white; padding: 36px; color: #141414; }
.print-head { display: flex; justify-content: space-between; gap: 20px; border-bottom: 3px solid #1d7af0; padding-bottom: 12px; }
.print-actions { text-align: center; margin-top: 16px; }
.contract-body { white-space: pre-wrap; line-height: 1.65; }
.pay-code { display: inline-block; padding: 4px 8px; border-radius: 8px; background: #0c4d86; color: #fff; font-weight: 700; letter-spacing: .04em; }
.pay-box { margin: 16px 0; padding: 14px 16px; border: 1px solid #1d7af0; background: #f3f8fc; }
.legend { display: flex; gap: 8px; margin-bottom: 12px; }
.stack-form { display: grid; gap: 6px; min-width: 160px; }
.renew-table tr.level-hot td { background: #fff1f0; }
.renew-table tr.level-soon td { background: #fff6f0; }
.renew-table tr.level-ok td { background: #f7f7f8; }
.preview-bar { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 14px 20px; background: #0c4d86; color: #f5f5f5; }
.preview-bar span { display: block; color: #d4d4d8; font-size: 13px; margin-top: 2px; }
.preview-frame { width: 100%; height: calc(100vh - 72px); border: 0; background: #f3f3f4; }
.pack-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin: 0 0 16px; border-bottom: 1px solid var(--line); }
.pack-tabs a { color: var(--muted); font-weight: 600; font-size: 13px; padding: 8px 12px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.pack-tabs a.active { color: var(--blue-dark); border-bottom-color: var(--blue); }
.pack-tabs b { margin-left: 4px; font-size: 11px; font-weight: 600; color: var(--muted); }
.pack-tabs a.active b { color: var(--blue); }
.pack-section { margin-bottom: 18px; }
.pack-section > h2, .cat-head h2 { margin: 0 0 8px; font-size: 13px; font-weight: 600; color: var(--ink); }
.pack-section > h2 span, .cat-head h2 span { color: var(--muted); font-weight: 600; margin-left: 4px; }
.pack-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; align-items: stretch; }
.pack-card { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.pack-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pack-kind { font-size: 11px; font-weight: 600; color: var(--blue-dark); background: #e8f3fd; border-radius: 4px; padding: 2px 6px; }
.pack-term { font-size: 11px; color: var(--muted); }
.pack-card h3 { margin: 0; font-size: 13px; line-height: 1.35; font-weight: 600; }
.pack-prices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; background: #f3f8fc; border-radius: 8px; padding: 8px; }
.pack-prices.single { grid-template-columns: 1fr; }
.pack-prices span { display: block; font-size: 11px; color: var(--muted); font-weight: 500; }
.pack-prices strong { font-size: 13px; }
.pack-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; margin: 0; }
.pack-meta dt { font-size: 10px; color: var(--muted); font-weight: 500; }
.pack-meta dd { margin: 0; font-size: 12px; font-weight: 600; }
.pack-specs { margin: 0; padding: 0; list-style: none; display: grid; gap: 3px; }
.pack-specs li { position: relative; padding-left: 10px; font-size: 12px; line-height: 1.35; color: #3d5568; }
.pack-specs li::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: var(--blue); position: absolute; left: 0; top: 6px; }
.pack-note { margin: 0; font-size: 12px; line-height: 1.4; color: #3d5568; }
.pack-actions { display: flex; gap: 12px; align-items: center; margin-top: auto; padding-top: 8px; border-top: 1px solid var(--line); font-size: 12px; font-weight: 600; }
.pack-actions form { margin: 0; }
.pack-actions button { background: none; border: 0; padding: 0; color: var(--red); font: inherit; font-weight: 600; cursor: pointer; }
.pack-actions a:focus-visible, .pack-actions button:focus-visible, .pack-tabs a:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.cat-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin-bottom: 8px; }
.cat-head .pack-actions { margin: 0; padding: 0; border: 0; }
.cat-add { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; }
.cat-add input { max-width: 280px; }
.pack-empty { margin: 0; padding: 16px; border: 1px dashed var(--line); border-radius: 10px; background: #fff; color: var(--muted); }
.pack-form { grid-template-columns: repeat(3, 1fr); gap: 8px 10px; }
.pack-form p { margin: 0; }
.pack-form label { font-size: 11px; margin-bottom: 3px; color: var(--muted); }
.pack-form input, .pack-form select, .pack-form textarea { padding: 6px 8px; font-size: 13px; border-radius: 6px; }
.pack-form textarea { min-height: 64px; }
.pack-editor h2 { margin-top: 0; }
.fact-grid, .domain-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; margin: 0; }
.fact-grid.one { grid-template-columns: 1fr; }
.fact-grid div, .domain-facts div { min-width: 0; }
.fact-grid dt, .domain-facts dt { font-size: 11px; color: var(--muted); font-weight: 500; }
.fact-grid dd, .domain-facts dd { margin: 1px 0 0; font-size: 13px; font-weight: 600; }
.domain-card { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-top: 10px; }
.domain-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.domain-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.domain-title strong { font-size: 14px; }
.domain-tools { display: flex; gap: 12px; align-items: center; }
.domain-tools form { margin: 0; }
.domain-tools a, .domain-tools button { background: none; border: 0; padding: 0; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.domain-tools button { color: var(--red); }
.domain-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 10px; padding: 8px 10px; background: #f3f8fc; border-radius: 8px; }
.domain-renew { display: grid; grid-template-columns: 72px 120px minmax(0, 1fr) auto; gap: 8px; align-items: end; margin-top: 10px; }
.domain-renew p { margin: 0; min-width: 0; }
.domain-renew label { font-size: 11px; margin-bottom: 3px; color: var(--muted); }
.domain-renew input { padding: 6px 8px; font-size: 13px; }
.domain-add-title { margin: 14px 0 8px; font-size: 13px; }
.domain-history { margin-top: 8px; }
.domain-history th, .domain-history td { font-size: 12px; padding: 6px 8px; }
h2 { font-size: 15px; }
@media print { .preview-bar { display: none; } .preview-frame { height: auto; } }
@media print {
    .print-actions, .no-print { display: none !important; }
    body { background: white; }
    .print-sheet { margin: 0; width: auto; box-shadow: none; }
}
@media (max-width: 980px) {
    .shell { display: block; }
    .side { width: auto; height: auto; position: static; }
    .side nav { flex-direction: row; overflow: auto; }
    .stats, .grid-2, .grid-form, .cust-form .grid-form, .pack-form, .price-row, .fact-grid, .domain-facts, .domain-renew, .domain-row { grid-template-columns: 1fr; }
    .span-3 { grid-column: auto; }
    .span-2 { grid-column: auto; }
    .main { padding: 18px; }
}
