/* my.fonect.uz — sodda zamonaviy CRM (Bitrix24/Notion uslubi) */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --accent: #2f7df6;
  --accent-deep: #1e63d0;
  --ink: #0f1e33;
  --bg: #f4f6fa;
  --card: #ffffff;
  --line: #e5e9f0;
  --text: #1c2b3f;
  --dim: #7b8aa0;
  --ok: #14a05a;
  --warn: #e08b00;
  --err: #de3f3f;
  --r: 12px;
}
html { -webkit-text-size-adjust: 100%; }
body { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); font-size: 15px; }
a { color: var(--accent); text-decoration: none; }
b, strong { font-weight: 700; }
.dim { color: var(--dim); }

/* ---- Shell ---- */
.shell { display: flex; min-height: 100vh; }
.side {
  width: 232px; flex-shrink: 0; background: #0e1a2e; color: #c6d2e4;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.side__brand { display: flex; align-items: center; gap: 9px; padding: 18px 18px 14px; color: #fff; font-weight: 800; font-size: 19px; letter-spacing: -0.02em; }
.side__brand svg { width: 26px; height: 26px; color: var(--accent); }
.side__brand i { font-style: normal; color: var(--accent); }
.side__nav { flex: 1; padding: 6px 10px; }
.side__group { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: #5c6f8c; padding: 14px 10px 5px; }
.side__link {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px;
  color: #c6d2e4; font-weight: 600; font-size: 14px; margin-bottom: 1px;
  border: 0; background: none; width: 100%; cursor: pointer; text-align: left; font-family: inherit;
}
.side__link svg { width: 19px; height: 19px; flex-shrink: 0; opacity: 0.85; }
.side__link:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.side__link.is-on { background: var(--accent); color: #fff; }
.side__foot { padding: 10px; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.side-overlay { display: none; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top {
  display: flex; align-items: center; gap: 14px; padding: 14px 24px;
  background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20;
}
.top__title { font-size: 19px; font-weight: 800; letter-spacing: -0.02em; flex: 1; }
.top__date { color: var(--dim); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.top__burger { display: none; border: 0; background: none; cursor: pointer; padding: 6px; }
.top__burger span { display: block; width: 20px; height: 2.2px; background: var(--ink); margin: 4px 0; border-radius: 2px; }
.content { padding: 22px 24px 40px; max-width: 1280px; width: 100%; }

/* ---- Cards ---- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin-bottom: 16px; }
.cards--2 { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; margin-bottom: 16px; }
.cards .card { margin-bottom: 0; }
.card__h { font-size: 15.5px; font-weight: 800; margin-bottom: 13px; letter-spacing: -0.01em; }
.card--warn { border-color: #f3d9a4; background: #fffaf0; }
.stat__l { font-size: 13px; color: var(--dim); font-weight: 600; }
.stat__n { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; margin-top: 5px; font-variant-numeric: tabular-nums; }
.stat__s { font-size: 12.5px; color: var(--dim); margin-top: 4px; }

/* ---- Table ---- */
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--dim); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr:hover td { background: #f8fafd; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---- Forms ---- */
.form label, .auth__form label { display: block; font-size: 13px; font-weight: 700; color: var(--dim); margin-bottom: 12px; }
.form input, .form select, .form textarea, .auth__form input {
  display: block; width: 100%; margin-top: 5px; padding: 10px 12px; font-size: 15px;
  border: 1.5px solid var(--line); border-radius: 9px; background: #fff; color: var(--text); font-family: inherit;
}
.form input:focus, .form select:focus, .form textarea:focus, .auth__form input:focus { outline: none; border-color: var(--accent); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 14px; }
.form-grid .wide { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 10px; align-items: center; margin-top: 4px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 9px; font-size: 14.5px; font-weight: 700;
  border: 1.5px solid transparent; cursor: pointer; font-family: inherit;
}
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-deep); }
.btn--ghost { background: #fff; border-color: var(--line); color: var(--text); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn--danger { background: #fff; border-color: #f0c2c2; color: var(--err); }
.btn--danger:hover { background: var(--err); border-color: var(--err); color: #fff; }
.btn--xs { padding: 5px 11px; font-size: 13px; border-radius: 7px; }
.btn--full { width: 100%; }

/* ---- Bits ---- */
.flash { margin: 14px 24px 0; padding: 11px 15px; border-radius: 10px; font-weight: 600; font-size: 14px; }
.auth .flash { margin: 0 0 14px; }
.flash--ok { background: #e6f7ee; color: #0d7a43; border: 1px solid #bce6cf; }
.flash--err { background: #fdecec; color: #b32b2b; border: 1px solid #f2c6c6; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; }
.pill--on { background: #e6f7ee; color: #0d7a43; }
.pill--off { background: #f2f4f8; color: var(--dim); }
.pill--warn { background: #fdf3e0; color: #a36a00; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.kv:last-child { border-bottom: 0; }
.kv span { color: var(--dim); }
.opgrid { display: flex; flex-wrap: wrap; gap: 8px; }
.opchip { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 13.5px; font-weight: 600; background: #fff; }
.opchip__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--op, var(--accent)); }
.opchip--warn { border-color: #f3d9a4; background: #fff8ec; }
.empty { text-align: center; padding: 60px 20px; color: var(--dim); }
.empty h2 { color: var(--text); margin-bottom: 8px; }
.list-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.list-head h2 { font-size: 17px; font-weight: 800; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; margin-bottom: 14px; }
.filters label { font-size: 12px; font-weight: 700; color: var(--dim); }
.filters input, .filters select { display: block; margin-top: 4px; padding: 8px 10px; font-size: 14px; border: 1.5px solid var(--line); border-radius: 8px; background: #fff; font-family: inherit; }

/* ---- Auth ---- */
.auth-body { background: linear-gradient(160deg, #0e1a2e, #14263f); }
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.auth__card { background: #fff; border-radius: 16px; padding: 34px 30px; width: 100%; max-width: 400px; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.5); }
.auth__brand { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 21px; margin-bottom: 20px; letter-spacing: -0.02em; }
.auth__brand svg { width: 28px; height: 28px; color: var(--accent); }
.auth__brand i { font-style: normal; color: var(--accent); }
.auth h1 { font-size: 22px; letter-spacing: -0.02em; }
.auth__sub { color: var(--dim); font-size: 14px; margin: 6px 0 18px; }

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .side { position: fixed; left: -250px; z-index: 40; transition: left 0.22s ease; box-shadow: 0 0 60px rgba(0,0,0,0.4); }
  .side.is-open { left: 0; }
  .side-overlay.is-on { display: block; position: fixed; inset: 0; background: rgba(10, 18, 32, 0.5); z-index: 35; }
  .top__burger { display: block; }
  .content { padding: 16px 14px 32px; }
  .flash { margin: 12px 14px 0; }
  .top { padding: 12px 14px; }
}
