/* =========================================================
   HAZINIY — Dizayn tizimi (Light + Dark rejim)
   ========================================================= */
:root {
  --hz-primary: #14504A;
  --hz-primary-dark: #0d3934;
  --hz-primary-light: #1c6961;
  --hz-accent: #F5DFA8;
  --hz-accent-dark: #e0c583;

  --hz-bg: #F2F1EC;
  --hz-surface: #ffffff;
  --hz-surface-2: #F7F6F2;
  --hz-border: #e4e2da;
  --hz-text: #1f2937;
  --hz-text-soft: #4b5563;
  --hz-muted: #6b7280;

  --hz-shadow: 0 2px 10px rgba(20, 80, 74, 0.07);
  --hz-shadow-lg: 0 8px 28px rgba(20, 80, 74, 0.12);
  --hz-radius: 14px;
  --hz-radius-sm: 9px;

  --hz-green: #16a34a;
  --hz-red: #dc2626;
  --hz-amber: #d97706;
  --hz-orange: #ea580c;

  --hz-sidebar-w: 236px;
}

[data-theme="dark"] {
  --hz-bg: #0f1715;
  --hz-surface: #16211e;
  --hz-surface-2: #1b2825;
  --hz-border: #263733;
  --hz-text: #eef1ef;
  --hz-text-soft: #c3cdc9;
  --hz-muted: #8b9c97;
  --hz-shadow: 0 2px 14px rgba(0, 0, 0, 0.35);
  --hz-shadow-lg: 0 10px 32px rgba(0, 0, 0, 0.45);
  --hz-primary-light: #2c8478;
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--hz-bg);
  color: var(--hz-text);
  transition: background 0.2s ease, color 0.2s ease;
}

a { color: inherit; }

/* =========================================================
   Shell layout: sidebar + topbar + content
   ========================================================= */
.hz-shell { display: flex; min-height: 100vh; }

.hz-sidebar {
  width: var(--hz-sidebar-w);
  flex-shrink: 0;
  background: var(--hz-primary);
  color: var(--hz-accent);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  transition: transform 0.25s ease;
  z-index: 40;
}

.hz-sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 8px 22px;
  border-bottom: 1px solid rgba(245, 223, 168, 0.15);
  margin-bottom: 16px;
}
.hz-sidebar-brand img { height: 34px; width: auto; }
.hz-sidebar-brand .name { font-weight: 800; font-size: 17px; letter-spacing: 0.4px; }
.hz-sidebar-brand .slogan { font-size: 11px; opacity: 0.75; }

.hz-nav-group { margin-bottom: 18px; }
.hz-nav-label {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em;
  opacity: 0.55; padding: 0 10px; margin-bottom: 6px; font-weight: 700;
}
.hz-nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 10px;
  color: var(--hz-accent); text-decoration: none;
  font-size: 13.5px; font-weight: 600; opacity: 0.82;
  margin-bottom: 2px;
}
.hz-nav-link .ic { width: 18px; text-align: center; font-size: 15px; }
.hz-nav-link:hover { background: rgba(245, 223, 168, 0.1); opacity: 1; }
.hz-nav-link.active { background: var(--hz-accent); color: var(--hz-primary-dark); opacity: 1; }

.hz-sidebar-footer {
  margin-top: auto; padding-top: 14px;
  border-top: 1px solid rgba(245, 223, 168, 0.15);
  font-size: 12px; opacity: 0.7;
}

.hz-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.hz-topbar {
  background: var(--hz-surface);
  border-bottom: 1px solid var(--hz-border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 24px;
  position: sticky; top: 0; z-index: 30;
}
.hz-topbar-left { display: flex; align-items: center; gap: 14px; }
.hz-page-title { font-size: 16px; font-weight: 700; color: var(--hz-text); }
.hz-menu-btn {
  display: none; background: none; border: none; font-size: 20px;
  cursor: pointer; color: var(--hz-text);
}
.hz-topbar-right { display: flex; align-items: center; gap: 10px; }

.hz-theme-toggle {
  width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--hz-border);
  background: var(--hz-surface-2); cursor: pointer; font-size: 16px;
  display: flex; align-items: center; justify-content: center; color: var(--hz-text);
}
.hz-theme-toggle:hover { background: var(--hz-border); }

.hz-user-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px 6px 6px; border-radius: 10px; text-decoration: none;
  color: var(--hz-text); font-size: 13px; font-weight: 600;
  background: var(--hz-surface-2); border: 1px solid var(--hz-border);
}
.hz-user-chip .avatar {
  width: 26px; height: 26px; border-radius: 50%; background: var(--hz-primary);
  color: var(--hz-accent); display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; flex-shrink: 0;
}

.hz-content { padding: 26px 28px; max-width: 1280px; width: 100%; margin: 0 auto; }

.hz-sidebar-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 35;
}

@media (max-width: 900px) {
  .hz-sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); }
  .hz-sidebar.open { transform: translateX(0); }
  .hz-sidebar-overlay.open { display: block; }
  .hz-menu-btn { display: block; }
  .hz-content { padding: 18px 16px; }
  .hz-topbar { padding: 10px 16px; }
}

/* =========================================================
   Generic components
   ========================================================= */
.hz-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.hz-card {
  background: var(--hz-surface);
  border-radius: var(--hz-radius);
  box-shadow: var(--hz-shadow);
  border: 1px solid var(--hz-border);
  padding: 18px 20px;
}
.hz-card.accent-top { border-top: 3px solid var(--hz-primary); }

.hz-card .label { color: var(--hz-muted); font-size: 12.5px; margin-bottom: 6px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; }
.hz-card .value { font-size: 28px; font-weight: 800; color: var(--hz-primary-light); }
.hz-card .sub { font-size: 12px; color: var(--hz-muted); margin-top: 4px; }

.hz-section-title {
  font-size: 16px; font-weight: 800; color: var(--hz-text);
  margin: 26px 0 14px; display: flex; align-items: center; gap: 8px;
}

.hz-panel {
  background: var(--hz-surface); border: 1px solid var(--hz-border);
  border-radius: var(--hz-radius); box-shadow: var(--hz-shadow);
  padding: 18px 20px;
}

.hz-table { width: 100%; border-collapse: collapse; background: var(--hz-surface); border-radius: var(--hz-radius); overflow: hidden; box-shadow: var(--hz-shadow); border: 1px solid var(--hz-border); }
.hz-table th, .hz-table td { text-align: left; padding: 11px 15px; border-bottom: 1px solid var(--hz-border); font-size: 13.5px; }
.hz-table th { background: var(--hz-surface-2); color: var(--hz-text-soft); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: 0.03em; }
.hz-table tr:last-child td { border-bottom: none; }
.hz-table tr:hover td { background: var(--hz-surface-2); }

.hz-empty { color: var(--hz-muted); font-size: 14px; padding: 28px; text-align: center; background: var(--hz-surface); border-radius: var(--hz-radius); border: 1px dashed var(--hz-border); }

.hz-tabs { display: flex; gap: 8px; overflow-x: auto; margin-bottom: 20px; padding-bottom: 4px; }
.hz-tab {
  white-space: nowrap; padding: 8px 16px; border-radius: 999px;
  background: var(--hz-surface); color: var(--hz-primary-light);
  text-decoration: none; font-size: 13px; font-weight: 700;
  border: 1px solid var(--hz-border);
}
.hz-tab.active { background: var(--hz-primary); color: var(--hz-accent); border-color: var(--hz-primary); }

.hz-badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; color: #fff; }
.hz-badge.present { background: var(--hz-green); }
.hz-badge.absent { background: var(--hz-red); }
.hz-badge.excused { background: var(--hz-amber); }
.hz-badge.late { background: var(--hz-orange); }
.hz-badge.debt { background: var(--hz-red); }
.hz-badge.ok { background: var(--hz-green); }
.hz-badge.neutral { background: var(--hz-muted); }

.hz-grade-pill { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 8px; font-weight: 800; font-size: 13px; color: #fff; background: var(--hz-primary); }

.hz-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--hz-primary); color: var(--hz-accent); border: none;
  padding: 10px 18px; border-radius: 10px; font-weight: 700; font-size: 13.5px;
  cursor: pointer; text-decoration: none;
}
.hz-btn:hover { background: var(--hz-primary-dark); }
.hz-btn.secondary { background: var(--hz-surface-2); color: var(--hz-text); border: 1px solid var(--hz-border); }
.hz-btn.secondary:hover { background: var(--hz-border); }
.hz-btn.danger { background: var(--hz-red); color: #fff; }

.hz-form-row { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.hz-form-row label { min-width: 110px; color: var(--hz-muted); font-size: 13px; font-weight: 600; }
.hz-form-row select, .hz-form-row input[type="date"], .hz-form-row input[type="text"],
.hz-form-row input[type="number"], .hz-form-row input[type="password"], .hz-form-row textarea {
  padding: 9px 11px; border: 1px solid var(--hz-border); border-radius: 8px; font-size: 13.5px;
  background: var(--hz-surface); color: var(--hz-text);
}
.hz-form-row textarea { width: 100%; min-height: 70px; font-family: inherit; }
.hz-field-full { flex: 1; min-width: 220px; }

.hz-journal-row {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--hz-surface); border: 1px solid var(--hz-border); border-radius: 10px;
  padding: 10px 14px; margin-bottom: 8px; box-shadow: var(--hz-shadow); gap: 12px; flex-wrap: wrap;
}
.hz-journal-row .student-name { font-weight: 700; flex: 1; min-width: 140px; }
.hz-journal-row select, .hz-journal-row input[type="number"] {
  padding: 7px 9px; border: 1px solid var(--hz-border); border-radius: 8px; font-size: 14px; width: 90px;
  background: var(--hz-surface); color: var(--hz-text);
}

.hz-save-btn {
  background: var(--hz-primary); color: var(--hz-accent); border: none;
  padding: 12px 22px; border-radius: 10px; font-weight: 700; font-size: 14px;
  cursor: pointer; margin-top: 14px;
}
.hz-save-btn:hover { background: var(--hz-primary-dark); }

.hz-success { background: #d1fae5; color: #065f46; padding: 10px 16px; border-radius: 10px; margin-bottom: 16px; font-size: 14px; }
[data-theme="dark"] .hz-success { background: #0d3b2a; color: #6ee7b7; }
.hz-error-box { background: #fee2e2; color: #991b1b; padding: 10px 16px; border-radius: 10px; margin-bottom: 16px; font-size: 14px; }
[data-theme="dark"] .hz-error-box { background: #3f1414; color: #fca5a5; }
.hz-warning-box { background: #fef3c7; color: #92400e; padding: 10px 16px; border-radius: 10px; margin-bottom: 16px; font-size: 14px; }
[data-theme="dark"] .hz-warning-box { background: #451a03; color: #fcd34d; }

.hz-child-card {
  background: var(--hz-surface); border: 1px solid var(--hz-border);
  border-radius: var(--hz-radius); box-shadow: var(--hz-shadow);
  padding: 18px 20px; margin-bottom: 16px;
  display: flex; align-items: center; gap: 14px;
  text-decoration: none; color: var(--hz-text);
}
.hz-child-avatar {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--hz-accent); color: var(--hz-primary-dark);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 18px; flex-shrink: 0;
}
.hz-child-info .name { font-weight: 700; font-size: 16px; }
.hz-child-info .meta { color: var(--hz-muted); font-size: 13px; margin-top: 2px; }

/* Kanban */
.hz-kanban { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 12px; }
.hz-kanban-col { background: var(--hz-surface-2); border: 1px solid var(--hz-border); border-radius: 12px; min-width: 230px; max-width: 230px; padding: 10px; flex-shrink: 0; }
.hz-kanban-col-title { font-weight: 700; font-size: 13px; color: var(--hz-text); margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center; }
.hz-kanban-col-title .count { background: var(--hz-primary); color: var(--hz-accent); border-radius: 999px; padding: 1px 8px; font-size: 11px; }
.hz-kanban-cards { min-height: 60px; display: flex; flex-direction: column; gap: 8px; }
.hz-kanban-card { background: var(--hz-surface); border: 1px solid var(--hz-border); border-radius: 10px; padding: 10px 12px; box-shadow: var(--hz-shadow); text-decoration: none; color: var(--hz-text); cursor: grab; display: block; }
.hz-kanban-card:active { cursor: grabbing; opacity: 0.7; }
.hz-kanban-card .name { font-weight: 700; font-size: 13px; }
.hz-kanban-card .meta { font-size: 12px; color: var(--hz-muted); margin-top: 2px; }
.hz-kanban-card .tag { display: inline-block; margin-top: 6px; background: var(--hz-accent); color: var(--hz-primary-dark); font-size: 11px; padding: 2px 8px; border-radius: 999px; }

/* Login page */
.hz-login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--hz-primary); }
.hz-login-box { background: var(--hz-surface); border-radius: var(--hz-radius); padding: 40px 36px; width: 360px; box-shadow: 0 10px 30px rgba(0,0,0,0.25); text-align: center; }
.hz-login-box img { height: 70px; margin-bottom: 12px; }
.hz-login-box h1 { font-size: 18px; color: var(--hz-primary-light); margin: 0 0 4px; }
.hz-login-box p.slogan { color: var(--hz-muted); font-size: 13px; margin: 0 0 24px; }
.hz-login-box input { width: 100%; padding: 11px 14px; margin-bottom: 12px; border: 1px solid var(--hz-border); border-radius: 10px; font-size: 14px; background: var(--hz-surface-2); color: var(--hz-text); }
.hz-login-box button { width: 100%; padding: 12px; background: var(--hz-primary); color: var(--hz-accent); border: none; border-radius: 10px; font-weight: 700; font-size: 14px; cursor: pointer; margin-top: 6px; }
.hz-login-box button:hover { background: var(--hz-primary-dark); }
.hz-error { color: var(--hz-red); font-size: 13px; margin-bottom: 10px; }

.hz-search-bar { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.hz-search-bar input, .hz-search-bar select {
  padding: 10px 12px; border: 1px solid var(--hz-border); border-radius: 9px;
  font-size: 13.5px; background: var(--hz-surface); color: var(--hz-text);
}
.hz-pagination { display: flex; gap: 6px; margin-top: 16px; flex-wrap: wrap; }
.hz-pagination a, .hz-pagination span {
  padding: 7px 12px; border-radius: 8px; text-decoration: none; font-size: 13px;
  border: 1px solid var(--hz-border); color: var(--hz-text); background: var(--hz-surface);
}
.hz-pagination .current { background: var(--hz-primary); color: var(--hz-accent); border-color: var(--hz-primary); }

/* Mobile tweaks */
@media (max-width: 640px) {
  .hz-card .value { font-size: 22px; }
  .hz-table th, .hz-table td { padding: 9px 10px; font-size: 13px; }
}

/* Eski shablonlar bilan moslik uchun (endi .hz-content shu vazifani bajaradi) */
.hz-container { width: 100%; }

/* ---- Dashboard: filial tanlash qatori (kompakt pill) ---- */
.hz-branch-row {
  display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px;
}
.hz-branch-pill {
  display: flex; align-items: center; gap: 10px;
  background: var(--hz-surface); border: 1.5px solid var(--hz-border);
  border-radius: 12px; padding: 10px 16px; text-decoration: none; color: var(--hz-text);
  flex-shrink: 0; min-width: 190px; transition: border-color 0.15s ease;
}
.hz-branch-pill:hover { border-color: var(--hz-primary-light); }
.hz-branch-pill.active { border-color: var(--hz-primary); background: var(--hz-surface-2); }
.hz-branch-pill .ic { font-size: 20px; }
.hz-branch-pill .txt { display: flex; flex-direction: column; }
.hz-branch-pill .name { font-weight: 700; font-size: 13.5px; }
.hz-branch-pill .meta { font-size: 11.5px; color: var(--hz-muted); display: flex; align-items: center; gap: 4px; }
.hz-branch-pill .debt-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--hz-red);
  display: inline-block; margin-left: 6px;
}

/* ---- Chat ---- */
.hz-chat-list { display: flex; flex-direction: column; gap: 8px; }
.hz-chat-row {
  display: flex; align-items: center; gap: 14px;
  background: var(--hz-surface); border: 1px solid var(--hz-border);
  border-radius: 12px; padding: 12px 16px; text-decoration: none; color: var(--hz-text);
}
.hz-chat-row:hover { border-color: var(--hz-primary-light); }
.hz-chat-row-info { flex: 1; min-width: 0; }
.hz-chat-row-info .name { font-weight: 700; font-size: 14px; }
.hz-chat-row-info .preview { font-size: 12.5px; color: var(--hz-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hz-chat-row-meta { text-align: right; flex-shrink: 0; }
.hz-chat-row-meta .time { font-size: 11px; color: var(--hz-muted); margin-bottom: 4px; }
.hz-chat-row-meta .unread-badge {
  background: var(--hz-primary); color: var(--hz-accent); border-radius: 999px;
  font-size: 11px; font-weight: 700; padding: 2px 7px; display: inline-block;
}

.hz-contact-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 24px; }
.hz-contact-card {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: var(--hz-surface); border: 1px solid var(--hz-border); border-radius: 10px;
  padding: 10px 14px; cursor: pointer; font-size: 14px; color: var(--hz-text);
}
.hz-contact-card:hover { border-color: var(--hz-primary-light); background: var(--hz-surface-2); }

.hz-chat-window {
  background: var(--hz-surface); border: 1px solid var(--hz-border);
  border-radius: var(--hz-radius); display: flex; flex-direction: column;
  height: 65vh; max-height: 640px;
}
.hz-chat-messages { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.hz-msg { max-width: 72%; display: flex; flex-direction: column; }
.hz-msg.me { align-self: flex-end; align-items: flex-end; }
.hz-msg.them { align-self: flex-start; align-items: flex-start; }
.hz-msg-sender { font-size: 11px; color: var(--hz-muted); margin-bottom: 2px; padding: 0 4px; }
.hz-msg-bubble {
  padding: 9px 13px; border-radius: 14px; font-size: 14px; line-height: 1.4;
  word-break: break-word; white-space: pre-wrap;
}
.hz-msg.me .hz-msg-bubble { background: var(--hz-primary); color: var(--hz-accent); border-bottom-right-radius: 4px; }
.hz-msg.them .hz-msg-bubble { background: var(--hz-surface-2); color: var(--hz-text); border-bottom-left-radius: 4px; }
.hz-msg-time { font-size: 10px; color: var(--hz-muted); margin-top: 2px; padding: 0 4px; }

.hz-chat-input-row {
  display: flex; gap: 10px; padding: 14px; border-top: 1px solid var(--hz-border);
}
.hz-chat-input-row input {
  flex: 1; padding: 10px 14px; border: 1px solid var(--hz-border); border-radius: 999px;
  background: var(--hz-surface-2); color: var(--hz-text); font-size: 14px;
}

/* Tizim (avtomatik) xabarlar — o'rtada, boshqacha rangda */
.hz-msg.system { align-self: center; align-items: center; max-width: 85%; }
.hz-msg.system .hz-msg-bubble {
  background: var(--hz-accent); color: var(--hz-primary-dark);
  border-radius: 12px; font-size: 13px; font-weight: 600; text-align: center;
}
.hz-msg.system .hz-msg-sender { color: var(--hz-primary-light); font-weight: 700; }

/* ---- Universal Drawer (slayd panel) — qo'shish/tahrirlash uchun ---- */
.hz-drawer-overlay {
  position: fixed; inset: 0; background: rgba(15, 23, 21, 0.45);
  z-index: 100; display: none; opacity: 0; transition: opacity 0.2s ease;
}
.hz-drawer-overlay.open { display: block; opacity: 1; }

.hz-drawer {
  position: fixed; top: 0; right: 0; height: 100vh; width: 420px; max-width: 92vw;
  background: var(--hz-surface); z-index: 101; box-shadow: -8px 0 30px rgba(0,0,0,0.25);
  transform: translateX(100%); transition: transform 0.25s ease;
  display: flex; flex-direction: column;
}
.hz-drawer.open { transform: translateX(0); }

.hz-drawer-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px; border-bottom: 1px solid var(--hz-border);
}
.hz-drawer-header h3 { margin: 0; font-size: 16px; font-weight: 800; }
.hz-drawer-close { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--hz-muted); }
.hz-drawer-close:hover { color: var(--hz-text); }

.hz-drawer-body { flex: 1; overflow-y: auto; padding: 20px; }
.hz-drawer-footer {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 16px 20px; border-top: 1px solid var(--hz-border);
}

.hz-drawer-body .hz-form-row { flex-direction: column; align-items: stretch; gap: 6px; }
.hz-drawer-body .hz-form-row label { min-width: auto; font-weight: 700; color: var(--hz-text); }
.hz-drawer-body input, .hz-drawer-body select, .hz-drawer-body textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--hz-border); border-radius: 8px;
  background: var(--hz-surface); color: var(--hz-text); font-size: 14px;
}

/* Sozlamalar — ichki-menyu tuzilmasi */
.hz-settings-layout { display: flex; gap: 20px; align-items: flex-start; }
.hz-settings-nav { width: 220px; flex-shrink: 0; display: flex; flex-direction: column; gap: 6px; }
.hz-settings-nav a {
  padding: 10px 14px; border-radius: 9px; text-decoration: none; font-size: 13.5px; font-weight: 600;
  background: var(--hz-surface); border: 1px solid var(--hz-border); color: var(--hz-text-soft);
}
.hz-settings-nav a.active { background: var(--hz-primary); color: var(--hz-accent); border-color: var(--hz-primary); }

/* Sozlamalar yon menyusidagi guruh sarlavhasi — bo'limlar ko'payib
   ketgani uchun ularni mavzu bo'yicha ajratamiz. */
.hz-settings-group {
  font-size: 11px; font-weight: 800; letter-spacing: .08em;
  text-transform: uppercase; color: var(--hz-text-muted);
  padding: 14px 4px 4px; margin-top: 4px;
  border-top: 1px solid var(--hz-border);
}
.hz-settings-group:first-child { margin-top: 0; padding-top: 2px; border-top: none; }
.hz-settings-nav a:hover:not(.active) { border-color: var(--hz-primary-light); }
.hz-settings-content { flex: 1; min-width: 0; }

@media (max-width: 760px) {
  .hz-settings-layout { flex-direction: column; }
  .hz-settings-nav { width: 100%; flex-direction: row; flex-wrap: wrap; }
}

/* ===================================================================
   CHAT — to'liq messenger uslublari
   Fayl/rasm yuborish, javob berish, reaksiya va xabar amallari uchun.
   =================================================================== */

.hz-chat-toolbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: 14px; padding-bottom: 12px;
  border-bottom: 1px solid var(--hz-border);
}
.hz-chat-toolbar-info { flex: 1; min-width: 120px; display: flex; flex-direction: column; }

/* Xabar ilovalari */
.hz-msg-image {
  max-width: 280px; max-height: 320px; border-radius: 10px;
  display: block; margin-bottom: 6px; cursor: zoom-in;
}
.hz-msg-file {
  display: flex; align-items: center; gap: 10px; text-decoration: none;
  padding: 9px 12px; border-radius: 10px; margin-bottom: 6px;
  background: rgba(0,0,0,.06); color: inherit;
}
.hz-msg-file:hover { background: rgba(0,0,0,.12); }
.hz-msg-file .ic { font-size: 20px; }
.hz-msg-file small { opacity: .75; }

/* Javob (iqtibos) */
.hz-msg-reply {
  border-left: 3px solid currentColor; opacity: .75;
  padding: 4px 8px; margin-bottom: 6px; font-size: 12px;
  border-radius: 4px; background: rgba(0,0,0,.05);
}
.hz-reply-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px; background: var(--hz-surface-2);
  border-top: 1px solid var(--hz-border); font-size: 13px;
}
.hz-reply-bar button {
  border: none; background: none; cursor: pointer;
  font-size: 18px; color: var(--hz-muted);
}

/* Xabar ustidagi amallar — sichqoncha olib borilganda ko'rinadi */
.hz-msg-actions {
  display: flex; gap: 8px; margin-top: 3px;
  opacity: 0; transition: opacity .15s;
}
.hz-msg:hover .hz-msg-actions { opacity: 1; }
.hz-msg-actions button {
  border: none; background: none; cursor: pointer; padding: 0;
  font-size: 11.5px; color: var(--hz-muted); text-decoration: underline;
}
.hz-msg-actions button:hover { color: var(--hz-primary); }
/* Telefonlarda "hover" yo'q — amallar doim ko'rinadi */
@media (hover: none) { .hz-msg-actions { opacity: 1; } }

/* Reaksiyalar */
.hz-msg-reactions { display: flex; gap: 4px; margin-top: 4px; flex-wrap: wrap; }
.hz-reaction {
  border: 1px solid var(--hz-border); background: var(--hz-white);
  border-radius: 12px; padding: 1px 8px; font-size: 12px; cursor: pointer;
}
.hz-reaction.mine { border-color: var(--hz-primary); background: var(--hz-surface-2); }
.hz-emoji-box {
  position: absolute; z-index: 60; display: flex; gap: 4px;
  background: var(--hz-white); border: 1px solid var(--hz-border);
  border-radius: 20px; padding: 5px 8px; box-shadow: var(--hz-shadow);
}
.hz-emoji-box button {
  border: none; background: none; cursor: pointer; font-size: 18px;
  padding: 2px 4px; border-radius: 50%;
}
.hz-emoji-box button:hover { background: var(--hz-surface-2); }

/* Fayl biriktirish tugmasi */
.hz-attach-btn {
  cursor: pointer; font-size: 20px; padding: 6px 10px;
  border-radius: 10px; user-select: none; flex-shrink: 0;
}
.hz-attach-btn:hover { background: var(--hz-surface-2); }
.hz-file-chip {
  display: flex; align-items: center; gap: 8px; font-size: 12.5px;
  padding: 7px 14px; background: var(--hz-surface-2);
  border-top: 1px solid var(--hz-border);
}
.hz-file-chip button {
  border: none; background: none; cursor: pointer;
  font-size: 16px; color: var(--hz-red);
}

.hz-msg-text { white-space: pre-wrap; word-break: break-word; }

/* Menyudagi o'qilmagan xabarlar nishoni */
.hz-nav-badge {
  display: inline-block; min-width: 18px; padding: 0 5px;
  margin-left: 6px; border-radius: 9px;
  background: var(--hz-red); color: #fff;
  font-size: 11px; font-weight: 800; line-height: 18px;
  text-align: center; vertical-align: middle;
}

/* Ovozli xabar */
.hz-msg-audio { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.hz-msg-audio audio { height: 36px; max-width: 220px; }
.hz-audio-time { font-size: 11.5px; opacity: .75; }

.hz-mic-btn {
  border: none; background: none; cursor: pointer; font-size: 20px;
  padding: 6px 10px; border-radius: 10px; flex-shrink: 0;
}
.hz-mic-btn:hover { background: var(--hz-surface-2); }

.hz-rec-bar {
  display: flex; align-items: center; gap: 10px; font-size: 13px;
  padding: 9px 14px; background: var(--hz-surface-2);
  border-top: 1px solid var(--hz-border);
}
.hz-rec-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--hz-red); animation: hz-blink 1s infinite;
}
@keyframes hz-blink { 0%,100% { opacity: 1; } 50% { opacity: .25; } }
