:root {
  --bg: #f3f6fa;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --ink: #172033;
  --muted: #718096;
  --line: #e5eaf1;
  --blue: #2167e8;
  --blue-dark: #1855c8;
  --sidebar: #17233d;
  --shadow: 0 10px 30px rgba(37, 50, 82, .08);
  --radius: 14px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { margin: 0; min-height: 100%; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--ink); background: var(--bg); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.app-shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 24px 14px 18px; background: linear-gradient(180deg, #172641, #111b30); color: #fff; z-index: 10; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 11px 24px; color: #fff; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: linear-gradient(135deg, #38a5ff, #2763ea); font-weight: 850; box-shadow: 0 7px 18px rgba(33, 103, 232, .35); }
.brand-copy { font-size: 18px; letter-spacing: -.45px; }
.brand-copy em { color: #54b8ff; font-style: normal; font-weight: 750; }
.nav-list, .sidebar-section { display: grid; gap: 4px; }
.sidebar-label { margin: 0 12px 7px; color: #8290a9; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.nav-item { display: flex; align-items: center; gap: 11px; width: 100%; padding: 11px 12px; border: 0; border-radius: 9px; color: #aeb9cb; background: transparent; text-align: left; transition: .18s ease; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,.07); }
.nav-item.active { color: #fff; background: rgba(54, 124, 247, .25); box-shadow: inset 3px 0 #52a9ff; }
.nav-icon { width: 22px; color: #7db5ff; font-size: 18px; text-align: center; }
.sidebar-spacer { flex: 1; }
.user-card { display: flex; align-items: center; gap: 10px; margin-top: 18px; padding: 13px 10px 0; border-top: 1px solid rgba(255,255,255,.09); }
.avatar { display: grid; place-items: center; flex: 0 0 34px; width: 34px; min-width: 34px; height: 34px; aspect-ratio: 1 / 1; border-radius: 50%; color: #113163; background: #bfddff; font-weight: 800; }
.user-card b, .user-card small { display: block; }
.user-card b { font-size: 13px; }.user-card small { margin-top: 2px; color: #7f8da5; font-size: 11px; }
.user-card > span:nth-child(2) { min-width: 0; }
.logout-button { margin-left: auto; padding: 5px; border: 0; color: #8290a9; background: transparent; font-size: 18px; }.logout-button:hover { color: #fff; }
.profile-avatar, .avatar { display: grid; place-items: center; overflow: hidden; border-radius: 50%; background: var(--avatar-bg, #bfddff); }.profile-avatar img, .avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-avatar { width: 38px; height: 38px; font-size: 20px; }.profile-avatar.large { width: 72px; height: 72px; font-size: 38px; box-shadow: 0 0 0 5px #f0f4f9; }

.auth-screen { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 20% 10%, #edf5ff, transparent 35%), linear-gradient(145deg, #f7faff 0%, #edf2f8 100%); }
.auth-screen::before { position: fixed; inset: 0; opacity: .23; background-image: linear-gradient(#bdd0e6 1px, transparent 1px), linear-gradient(90deg, #bdd0e6 1px, transparent 1px); background-size: 44px 44px; content: ""; mask-image: linear-gradient(to bottom right, black, transparent 68%); }
.login-card { position: relative; width: min(420px, 100%); padding: 34px; border: 1px solid rgba(210,220,233,.9); border-radius: 20px; background: rgba(255,255,255,.95); box-shadow: 0 26px 80px rgba(24,42,72,.15); }
.login-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 32px; }.login-brand .brand-copy { color: var(--ink); }.login-card h1 { margin-bottom: 8px; }.login-hint { margin: 0 0 22px; color: var(--muted); font-size: 13px; line-height: 1.55; }.login-form { display: grid; gap: 15px; }.wide { width: 100%; }.login-demo { margin: 20px 0 0; padding-top: 17px; border-top: 1px solid var(--line); color: #8a95a5; font-size: 11px; text-align: center; }.form-error { margin: 0; color: #d94343; font-size: 11px; font-weight: 700; }
.remember-field { display: flex; align-items: center; gap: 8px; margin-top: -4px; color: #69778a; font-size: 11px; cursor: pointer; }.remember-field input { accent-color: var(--blue); }

.workspace { min-width: 0; padding: 27px 30px 40px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.eyebrow { margin: 0 0 4px; color: #8b97aa; font-size: 11px; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
h1, h2 { margin: 0; letter-spacing: -.04em; }
h1 { font-size: 27px; } h2 { font-size: 21px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.search-box { display: flex; align-items: center; gap: 8px; width: min(310px, 30vw); height: 42px; padding: 0 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: #8e99aa; }
.search-box input { min-width: 0; flex: 1; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 13px; }
kbd { padding: 2px 6px; border: 1px solid #e2e7ef; border-radius: 5px; color: #9aa4b3; background: #f6f8fb; font-size: 10px; }
.primary-button, .ghost-button, .danger-button, .icon-button { border-radius: 9px; font-weight: 700; transition: .18s ease; }
.primary-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 42px; padding: 0 16px; border: 0; color: #fff; background: var(--blue); box-shadow: 0 7px 16px rgba(33,103,232,.18); }
.primary-button:hover { background: var(--blue-dark); transform: translateY(-1px); }
.ghost-button { min-height: 38px; padding: 0 13px; border: 1px solid var(--line); color: #59677c; background: #fff; }
.ghost-button:hover { border-color: #cdd6e3; color: var(--ink); }
.danger-button { min-height: 38px; padding: 0 13px; border: 1px solid #ffd7d7; color: #d33434; background: #fff6f6; }
.icon-button { position: relative; display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid var(--line); color: #637087; background: #fff; font-size: 22px; }
.icon-button i { position: absolute; top: 8px; right: 8px; width: 7px; height: 7px; border: 2px solid #fff; border-radius: 50%; background: #ff5b5b; }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 19px; }
.stat-card { display: flex; align-items: center; gap: 13px; min-width: 0; padding: 16px; border: 1px solid #e8edf3; border-radius: 13px; background: var(--surface); box-shadow: 0 5px 16px rgba(28, 45, 75, .035); }
.stat-icon { display: grid; place-items: center; flex: 0 0 38px; height: 38px; border-radius: 11px; font-size: 17px; font-weight: 800; }
.stat-icon.blue { color: #236be7; background: #e9f1ff; }.stat-icon.amber { color: #db8b00; background: #fff4d9; }.stat-icon.green { color: #138f62; background: #dff8ed; }.stat-icon.violet { color: #7452d6; background: #eee9ff; }
.stat-card p, .stat-card strong, .stat-card small { display: block; overflow: hidden; margin: 0; text-overflow: ellipsis; white-space: nowrap; }
.stat-card p { margin-bottom: 3px; color: var(--muted); font-size: 11px; }.stat-card strong { font-size: 18px; }.stat-card small { margin-top: 2px; color: #9aa4b2; font-size: 10px; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.view-tabs { display: flex; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: #e9edf3; }
.view-tab { padding: 7px 13px; border: 0; border-radius: 6px; color: #7a8799; background: transparent; font-size: 12px; font-weight: 700; }
.view-tab.active { color: #26344a; background: #fff; box-shadow: 0 2px 7px rgba(44,57,84,.12); }
.toolbar-actions { display: flex; align-items: center; gap: 7px; }
.select-wrap { display: flex; align-items: center; gap: 5px; height: 38px; padding: 0 9px; border: 1px solid var(--line); border-radius: 9px; color: #8692a3; background: #fff; }
.select-wrap select { max-width: 160px; border: 0; outline: 0; color: #59677c; background: transparent; font-size: 12px; }

.view-panel { display: none; }.view-panel.active { display: block; }
.kanban { display: grid; grid-template-columns: repeat(7, minmax(238px, 1fr)); gap: 11px; padding-bottom: 12px; overflow-x: auto; scrollbar-color: #cbd5e2 transparent; }
.kanban-column { min-height: 530px; border: 1px solid #e3e9f0; border-radius: var(--radius); background: #eaf0f6; overflow: hidden; }
.column-header { position: relative; padding: 15px 14px 12px; background: rgba(255,255,255,.72); border-top: 3px solid var(--stage); border-bottom: 1px solid #dfe6ee; }
.column-header::before { position: absolute; top: 15px; left: 0; width: 3px; height: 31px; border-radius: 0 3px 3px 0; background: var(--stage); content: ""; }
.column-title-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.column-title-row b { font-size: 12px; }.column-count { padding: 2px 7px; border-radius: 9px; color: #69778b; background: #e8edf3; font-size: 10px; font-weight: 800; }
.column-sum { display: block; margin-top: 7px; color: #647288; font-size: 13px; font-weight: 750; }
.column-body { display: grid; align-content: start; gap: 9px; min-height: 455px; padding: 10px; }
.column-body.drag-over { background: rgba(33,103,232,.08); outline: 2px dashed rgba(33,103,232,.35); outline-offset: -5px; }
.tender-card { position: relative; padding: 13px; border: 1px solid #dfe5ec; border-radius: 10px; background: #fff; box-shadow: 0 4px 12px rgba(35,50,78,.06); cursor: grab; transition: .17s ease; }
.tender-card:hover { border-color: #c8d4e2; box-shadow: 0 8px 20px rgba(35,50,78,.1); transform: translateY(-1px); }
.tender-card:active { cursor: grabbing; }.tender-card.dragging { opacity: .45; transform: rotate(2deg); }
.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.platform-badge { display: inline-block; max-width: 145px; overflow: hidden; padding: 3px 6px; border-radius: 5px; color: #48627e; background: #edf3f9; font-size: 9px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; text-transform: uppercase; }
.card-menu { border: 0; color: #9da7b5; background: none; font-size: 18px; line-height: 14px; }
.tender-card h3 { margin: 10px 0 4px; overflow: hidden; font-size: 13px; line-height: 1.35; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tender-number { margin: 0 0 11px; color: #8390a2; font-size: 10px; }
.card-amount { font-size: 16px; letter-spacing: -.02em; }
.card-meta { display: grid; gap: 6px; margin-top: 11px; padding-top: 10px; border-top: 1px solid #edf0f4; }
.meta-row { display: flex; align-items: flex-start; gap: 7px; color: #6f7c8f; font-size: 10px; line-height: 1.35; }.meta-icon { flex: 0 0 13px; color: #9ba7b7; text-align: center; }
.deadline { display: inline-flex; align-items: center; gap: 5px; width: fit-content; margin-top: 10px; padding: 4px 7px; border-radius: 5px; color: #167653; background: #e2f7ee; font-size: 9px; font-weight: 800; }
.card-footer { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; }.card-footer .profile-avatar { width: 27px; height: 27px; border: 2px solid #fff; font-size: 14px; box-shadow: 0 1px 5px rgba(35,50,78,.18); cursor: help; }
.deadline.soon { color: #b26300; background: #fff0d2; }.deadline.overdue { color: #cf3c3c; background: #ffe5e5; }
.empty-column { padding: 18px 10px; color: #99a4b3; border: 1px dashed #ced7e2; border-radius: 9px; text-align: center; font-size: 11px; }

.table-card, .calendar-card { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); overflow: hidden; }
table { width: 100%; border-collapse: collapse; } th, td { padding: 14px 16px; border-bottom: 1px solid #edf0f4; text-align: left; vertical-align: middle; }
th { color: #8792a3; background: #f8fafc; font-size: 10px; letter-spacing: .05em; text-transform: uppercase; }
td { font-size: 12px; }.table-title { display: block; margin-bottom: 3px; font-weight: 750; }.table-sub { color: #8b96a7; font-size: 10px; }.table-action { border: 0; color: var(--blue); background: none; font-weight: 700; }
.stage-pill { display: inline-block; padding: 5px 8px; border-radius: 12px; color: var(--pill); background: color-mix(in srgb, var(--pill) 13%, white); font-size: 10px; font-weight: 800; }
.empty-state { padding: 70px 20px; color: #8592a4; text-align: center; }.empty-state span { display: block; font-size: 35px; }.empty-state b { display: block; margin: 8px 0; color: #3f4c61; }

.calendar-header { display: flex; align-items: center; justify-content: center; gap: 18px; padding: 16px; border-bottom: 1px solid var(--line); }.calendar-header h2 { min-width: 200px; font-size: 17px; text-align: center; text-transform: capitalize; }
.calendar-weekdays, .calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); }.calendar-weekdays { color: #8c97a7; background: #f8fafc; font-size: 10px; font-weight: 800; text-align: center; text-transform: uppercase; }.calendar-weekdays span { padding: 10px; }
.calendar-day { min-height: 112px; padding: 9px; border-top: 1px solid #edf0f4; border-right: 1px solid #edf0f4; background: #fff; }.calendar-day:nth-child(7n) { border-right: 0; }.calendar-day.outside { background: #fafbfd; color: #b5beca; }.calendar-day.today .day-number { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; color: #fff; background: var(--blue); }
.day-number { display: block; margin-bottom: 6px; font-size: 11px; font-weight: 800; }.calendar-event { display: block; width: 100%; margin: 3px 0; padding: 5px 6px; overflow: hidden; border: 0; border-left: 3px solid var(--event); border-radius: 4px; color: #35445a; background: #f0f4f8; font-size: 9px; text-align: left; text-overflow: ellipsis; white-space: nowrap; }

.modal { width: min(680px, calc(100vw - 28px)); max-height: calc(100vh - 32px); padding: 0; border: 0; border-radius: 16px; color: var(--ink); box-shadow: 0 30px 80px rgba(16,28,49,.28); }
.modal::backdrop { background: rgba(13, 25, 44, .56); backdrop-filter: blur(3px); }.modal form { display: flex; flex-direction: column; max-height: calc(100vh - 32px); }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; padding: 21px 23px 16px; border-bottom: 1px solid var(--line); }.close-button { border: 0; color: #7c8899; background: none; font-size: 28px; line-height: 1; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 19px 23px; overflow-y: auto; }.field { display: grid; gap: 6px; }.field.span-2 { grid-column: span 2; }.field span { color: #68768a; font-size: 11px; font-weight: 700; }.field input, .field select, .field textarea { width: 100%; padding: 10px 11px; border: 1px solid #dce3eb; border-radius: 8px; outline: 0; color: var(--ink); background: #fff; font-size: 13px; }.field input:focus, .field select:focus, .field textarea:focus { border-color: #74a6f5; box-shadow: 0 0 0 3px rgba(33,103,232,.09); }.field textarea { resize: vertical; }
.modal-footer { display: flex; align-items: center; gap: 9px; padding: 15px 23px; border-top: 1px solid var(--line); background: #fbfcfd; }.modal-spacer { flex: 1; }
.input-action { display: flex; }.input-action input { border-radius: 8px 0 0 8px; }.input-action button { padding: 0 10px; border: 1px solid #dce3eb; border-left: 0; border-radius: 0 8px 8px 0; color: var(--blue); background: #f5f8fc; font-size: 11px; font-weight: 750; }.check-field { display: flex; align-items: center; gap: 8px; color: #5f6c7e; font-size: 12px; }.single-column { grid-template-columns: 1fr; }.force-password-copy { display: flex; align-items: center; gap: 14px; padding: 18px 23px 0; color: #647288; font-size: 12px; line-height: 1.5; }.force-password-copy p { margin: 0; }.security-icon { display: grid; place-items: center; flex: 0 0 42px; height: 42px; border-radius: 12px; color: #19765a; background: #e1f7ee; font-size: 23px; }.password-modal { width: min(480px, calc(100vw - 28px)); }

.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin: 6px 0 20px; }.section-heading h2 { font-size: 24px; }.section-heading p:not(.eyebrow) { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.staff-grid { display: grid; grid-template-columns: repeat(3, minmax(240px, 1fr)); gap: 14px; }.staff-card { padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 5px 16px rgba(28,45,75,.035); }.staff-card-top { display: flex; align-items: center; gap: 12px; }.staff-card-top .profile-avatar { flex: 0 0 48px; width: 48px; height: 48px; font-size: 26px; }.staff-card h3 { margin: 0 0 4px; font-size: 14px; }.staff-card p { margin: 0; color: var(--muted); font-size: 11px; }.staff-meta { display: grid; gap: 7px; margin: 16px 0; padding: 12px 0; border-block: 1px solid #edf0f4; color: #6d7a8d; font-size: 11px; }.staff-meta span { display: flex; justify-content: space-between; gap: 10px; }.staff-meta b { color: #39475b; font-weight: 700; }.staff-card-actions { display: flex; align-items: center; justify-content: space-between; }.role-badge, .status-badge { padding: 4px 7px; border-radius: 9px; font-size: 9px; font-weight: 800; }.role-badge { color: #365dc3; background: #e8efff; }.status-badge { color: #16815b; background: #e0f6ed; }.status-badge.off { color: #8c6470; background: #f4e9ec; }
.settings-layout { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, .8fr); gap: 16px; align-items: start; }.settings-card { padding: 22px; border: 1px solid var(--line); border-radius: 15px; background: #fff; box-shadow: var(--shadow); }.settings-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 5px; }.settings-card.compact { display: grid; gap: 15px; }.settings-card.compact p { color: var(--muted); font-size: 12px; }.settings-form-grid { padding: 18px 0; }.avatar-editor { padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: #f8fafc; }.field-label { display: block; margin-bottom: 10px; color: #68768a; font-size: 11px; font-weight: 700; }.animal-picker { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 12px; }.animal-option { display: grid; place-items: center; width: 40px; height: 40px; border: 2px solid transparent; border-radius: 50%; background: var(--animal-bg); font-size: 22px; }.animal-option:hover, .animal-option.selected { border-color: var(--blue); transform: translateY(-1px); }.upload-button { display: inline-flex; align-items: center; min-height: 34px; padding: 0 11px; border: 1px solid #dce3eb; border-radius: 8px; color: #46566c; background: #fff; font-size: 11px; font-weight: 750; cursor: pointer; }.avatar-editor small { margin-left: 8px; color: #909bab; font-size: 9px; }.card-actions { display: flex; justify-content: flex-end; padding-top: 16px; }
.toast-region { position: fixed; right: 22px; bottom: 22px; display: grid; gap: 8px; z-index: 100; }.toast { padding: 12px 16px; border-radius: 9px; color: #fff; background: #1e2a3d; box-shadow: 0 10px 30px rgba(10,20,38,.25); font-size: 12px; animation: toast-in .2s ease; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 1100px) { .stats-grid { grid-template-columns: repeat(2, 1fr); }.search-box { width: 230px; }.workspace { padding: 24px 20px 35px; } }
@media (max-width: 1100px) { .staff-grid { grid-template-columns: repeat(2, minmax(230px, 1fr)); }.settings-layout { grid-template-columns: 1fr; } }
@media (max-width: 780px) {
  .app-shell { display: block; }.sidebar { position: sticky; height: auto; flex-direction: row; align-items: center; padding: 10px 12px; overflow-x: auto; }.brand { padding: 0 8px 0 0; }.brand-copy, .sidebar-spacer, .sidebar-section, .user-card, .nav-item span:last-child { display: none; }.nav-list { display: flex; }.nav-item { padding: 9px; }.nav-icon { width: 24px; }.workspace { padding: 18px 14px 30px; }.topbar { align-items: flex-start; }.topbar-actions { flex-wrap: wrap; justify-content: flex-end; }.search-box { order: 3; width: 100%; }.topbar-actions .primary-button { font-size: 0; width: 42px; padding: 0; }.topbar-actions .primary-button span { font-size: 18px; }.stats-grid { grid-template-columns: 1fr 1fr; }.toolbar { align-items: flex-start; flex-direction: column; }.toolbar-actions { width: 100%; overflow-x: auto; }.table-card { overflow-x: auto; } table { min-width: 850px; }.calendar-day { min-height: 80px; padding: 5px; }.calendar-event { padding: 4px; font-size: 0; }.calendar-event::after { content: "Торги"; font-size: 8px; }.form-grid { grid-template-columns: 1fr; }.field.span-2 { grid-column: auto; }.staff-grid { grid-template-columns: 1fr; }.section-heading { align-items: flex-start; flex-direction: column; }.settings-form-grid { grid-template-columns: 1fr; }.avatar-editor small { display: block; margin: 8px 0 0; }
}
@media (max-width: 480px) { .stats-grid { grid-template-columns: 1fr; }.stat-card { padding: 13px; }.topbar h1 { font-size: 22px; }.view-tab { padding: 7px 10px; }.calendar-weekdays span { padding: 7px 2px; }.calendar-day { min-height: 62px; } }
