/* ===== BLUE STEEL — SmartMail — Full Standalone CSS ===== */
:root {
  --glass-bg: #ffffff;
  --glass-blur: none;
  --glass-border: 1px solid #dde5ef;
  --primary: #2e7dc4;
  --primary-cont: rgba(46,125,196,.08);
  --on-primary-c: #ffffff;
  --on-surface: #1e2a3a;
  --on-surf-var: #7a9ab5;
  --outline: #c8d5e8;
  --outline-var: #dde5ef;
  --elevation3: 0 4px 16px rgba(20,40,70,.1);
  --surface: #ffffff;
  --surface-var: #f4f7fb;
  --error: #dc2626;
  --success: #16a34a;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Manrope', 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
  font-size: 14px;
  background: #eef2f7;
  color: #1e2a3a;
  min-height: 100vh;
}
a { text-decoration: none; color: inherit; }

/* ===== HEADER — split: left dark (#0f2740) = logo area, right white ===== */
.header {
  position: fixed; top: 0; left: 0; right: 0; height: 48px;
  display: flex; align-items: stretch;
  z-index: 1000;
  background: transparent;
  border-bottom: none;
  box-shadow: none;
  padding: 0;
}
.header-left {
  width: 240px; flex-shrink: 0;
  background: #0f2740;
  display: flex; align-items: center; gap: 10px; padding: 0 20px;
  transition: width .2s ease;
}
.header-right {
  flex: 1;
  background: #1a3a5c;
  display: flex; align-items: center; gap: 4px; padding: 0 16px; justify-content: flex-end;
  border-bottom: 1px solid rgba(255,255,255,.08);
  box-shadow: none;
}
.brand { font-size: 16px; font-weight: 800; color: #fff; letter-spacing: .3px; display: flex; align-items: center; gap: 8px; }
.brand-ic { width: 28px; height: 28px; border-radius: 5px; background: rgba(255,255,255,.15); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 13px; }
.btn-hamburger { background: none; border: none; color: rgba(255,255,255,.5); font-size: 16px; cursor: pointer; padding: 6px 8px; border-radius: 4px; transition: background .15s; }
.btn-hamburger:hover { background: rgba(255,255,255,.1); color: #fff; }
.header-right .btn-icon { background: none; border: none; color: rgba(255,255,255,.6); font-size: 15px; cursor: pointer; padding: 6px 8px; border-radius: 6px; transition: background .15s; }
.header-right .btn-icon:hover { background: rgba(255,255,255,.1); color: #fff; }
.hdr-username { color: rgba(255,255,255,.8); font-size: 13px; padding: 0 6px; font-weight: 500; }

.settings-wrap { position: relative; }
.settings-dropdown { display: none; position: absolute; top: 100%; right: 0; padding-top: 8px; background: transparent; z-index: 3000; width: max-content; }
.settings-dropdown-inner { background: #fff; min-width: 220px; border: 1px solid #dde5ef; border-radius: 8px; box-shadow: 0 4px 24px rgba(20,40,70,.14); padding: 6px 0; }
.settings-dropdown.open { display: block; }
.settings-btn-combo { display: flex; align-items: center; gap: 2px; }
.settings-btn-combo .combo-main { font-size: 15px; }
.settings-btn-combo .combo-gear { font-size: 9px; opacity: .7; margin-top: 4px; }
.dd-title { color: #2e7dc4; font-size: 11px; text-transform: uppercase; letter-spacing: .8px; padding: 6px 16px 8px; font-weight: 700; }
.settings-dropdown a { display: flex; align-items: center; gap: 12px; padding: 9px 16px; color: #1e2a3a; font-size: 13px; transition: background .12s; }
.settings-dropdown a:hover { background: rgba(46,125,196,.07); color: #1a3a5c; }
.settings-dropdown a i { width: 16px; text-align: center; color: #2e7dc4; }
.dd-divider { height: 1px; background: #dde5ef; margin: 4px 0; }

/* ===== LAYOUT ===== */
.layout { display: flex; padding-top: 48px; min-height: 100vh; }

/* ===== SIDEBAR ===== */
.sidebar {
  position: fixed; top: 48px; left: 0;
  width: 240px; height: calc(100vh - 48px);
  background: #14304e;
  overflow-y: auto; z-index: 900;
  flex-shrink: 0;
  display: flex; flex-direction: column;
  transition: width .2s ease;
  overflow-x: hidden;
  padding-top: 8px;
}
.sidebar.collapsed { width: 52px; }
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-item span,
.sidebar.collapsed .badge,
.sidebar.collapsed .arrow-icon { display: none; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 10px 6px; margin: 2px 4px; }
/* Collapse header-left too */
.sidebar.collapsed ~ * .header-left,
body.sidebar-collapsed .header-left { width: 52px; }

.sb-search { display: flex; align-items: center; margin: 8px 10px 4px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.10); border-radius: 7px; overflow: hidden; }
.sb-search input { flex: 1; background: none; border: none; outline: none; padding: 8px 12px; color: rgba(255,255,255,.85); font-size: 12.5px; font-family: inherit; }
.sb-search input::placeholder { color: rgba(255,255,255,.30); }
.sb-search button { background: none; border: none; color: rgba(255,255,255,.35); padding: 7px 10px; cursor: pointer; font-size: 12px; }
.sb-search button:hover { color: rgba(255,255,255,.8); }
.nav-label { display: block; font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .10em; color: rgba(255,255,255,.28); padding: 18px 18px 6px; }
.nav-item { display: flex; align-items: center; gap: 13px; padding: 11px 14px; color: #cdd9e8; cursor: pointer; transition: background .12s, color .12s; font-size: 13px; font-weight: 500; border-radius: 9px; margin: 2px 8px; white-space: nowrap; }
.nav-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-item.active { background: rgba(255,255,255,.10); color: #fff; font-weight: 600; box-shadow: inset 3px 0 0 #5b9cf6; }
.nav-item i:first-child { width: 18px; text-align: center; font-size: 15px; color: #8fb4d8; flex-shrink: 0; }
.nav-item.active i:first-child { color: #7ec8f7; }
.badge { background: #111827; color: #fff; font-size: 11px; border-radius: 10px; padding: 1px 8px; margin-left: auto; font-weight: 700; }
.arrow-icon { margin-left: auto; font-size: 10px; color: rgba(255,255,255,.30); }

/* ===== PAGE WRAP ===== */
.page-wrap {
  margin-left: 240px; flex: 1; min-width: 0;
  background: #d7e5f5;
  padding: 20px 24px 24px;
  transition: margin-left .2s ease;
}
.flash { padding: 11px 18px; background: rgba(46,125,196,.08); color: #2e7dc4; font-size: 13px; border-bottom: 1px solid rgba(46,125,196,.2); }

/* ===== PAGE HEADER ===== */
.page-header {
  background: #fff;
  padding: 14px 24px;
  border-bottom: 2px solid #2e7dc4;
  display: flex; align-items: center; gap: 12px;
  flex-shrink: 0;
  border-radius: 8px 8px 0 0;
  box-shadow: 0 1px 4px rgba(20,40,70,.07);
}
.page-header h1 { font-size: 17px; font-weight: 700; color: #1a3a5c; }
.page-header-solo { background: #fff; padding: 0 24px; min-height: 52px; border-bottom: 2px solid #2e7dc4; display: flex; align-items: center; gap: 12px; flex-shrink: 0; border-radius: 8px; box-shadow: 0 1px 4px rgba(20,40,70,.07); }
.page-header-solo h1 { font-size: 17px; font-weight: 700; color: #1a3a5c; }
.btn-back { color: #2e7dc4; font-size: 17px; padding: 4px; border: none; background: none; cursor: pointer; border-radius: 6px; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; }
.btn-back:hover { background: rgba(46,125,196,.1); }

/* ===== CONTENT BOX ===== */
.content-box { background: #fff; overflow: hidden; border-top: none; border-radius: 0 0 8px 8px; box-shadow: 0 2px 8px rgba(20,40,70,.09); }

/* ===== TOOLBAR (for pages with action buttons, not search) ===== */
.toolbar { display: flex; align-items: center; justify-content: space-between; padding: 10px 18px; background: #fff; border-bottom: 1px solid #dde5ef; }
/* Standalone search bar (toolbar context) */
.search-bar { display: flex; align-items: center; border: 1px solid #dde5ef; border-radius: 6px; overflow: hidden; background: #fff; transition: border-color .15s; }
.search-bar:focus-within { border-color: #2e7dc4; }
.search-bar input { border: none; padding: 6px 14px; font-size: 13px; outline: none; width: 220px; color: #1e2a3a; background: transparent; }
.search-bar input::placeholder { color: #9ab0c4; }
.search-bar button { background: none; border: none; padding: 6px 12px; cursor: pointer; color: #9ab0c4; border-left: 1px solid #dde5ef; }
.search-bar button:hover { color: #2e7dc4; }

/* ===== PAGINATION ===== */
.pagination { display: flex; align-items: center; gap: 4px; font-size: 12px; color: #5a7a9a; }
.pg-info { padding: 0 8px; }
.pagination button { background: #fff; border: 1px solid #dde5ef; border-radius: 4px; padding: 4px 12px; cursor: pointer; color: #5a7a9a; font-size: 12px; transition: all .15s; }
.pagination button:hover:not(:disabled) { background: rgba(46,125,196,.08); color: #1a3a5c; border-color: #2e7dc4; }
.pagination button:disabled { opacity: .4; cursor: default; }
.pg-btn { background: #fff; border: 1px solid #dde5ef; border-radius: 4px; padding: 4px 12px; color: #5a7a9a; font-size: 12px; text-decoration: none; display: inline-flex; align-items: center; transition: all .15s; }
.pg-btn:hover:not(.pg-dis) { background: rgba(46,125,196,.08); color: #1a3a5c; border-color: #2e7dc4; }
.pg-btn.pg-dis { opacity: .4; pointer-events: none; }

/* ===== EMAIL GROUPS ===== */
.email-groups-wrap { background: transparent; }
.email-group { background: #fff; overflow: hidden; }
.group-header { background: #eef2f7; padding: 10px 24px; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid #dde5ef; border-top: 1px solid #dde5ef; }
.g-icon { color: #2e7dc4; font-size: 11px; }
.g-name { font-weight: 700; color: #1a3a5c; font-size: 13px; }
.g-disp { color: #5a7a9a; font-size: 12px; }
.g-email { font-size: 10px; font-weight: 700; color: #fff; background: #2e7dc4; border-radius: 100px; padding: 2px 8px; text-transform: uppercase; letter-spacing: .3px; }
.g-count { margin-left: auto; background: #2e7dc4; color: #fff; font-size: 11px; font-weight: 700; border-radius: 10px; padding: 1px 8px; }

/* ===== EMAIL ROW ===== */
.email-row { display: flex; align-items: center; gap: 12px; padding: 13px 21px; border-bottom: 1px solid #dde5ef; cursor: pointer; transition: background .15s, border-left-color .15s; background: #fff; border-left: 3px solid transparent; }
.email-row:last-child { border-bottom: none; }
.email-row:hover { background: #f4f7fb; border-left-color: #2e7dc4; }
.email-row.unread { }
.email-row.unread .e-name { }
.email-row.unread .e-subject { }

.e-star { color: #c8d5e3; cursor: pointer; font-size: 14px; width: 16px; flex-shrink: 0; }
.e-star.starred { color: #f59e0b; }

.e-av { width: 36px; height: 36px; border-radius: 50%; overflow: hidden; flex-shrink: 0; display: flex; }
.e-av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.e-av-ph { width: 36px; height: 36px; background: #d0e8f7; display: flex; align-items: center; justify-content: center; color: #1a5a8a; font-size: 14px; font-weight: 700; border-radius: 50%; }

/* Sender column: name + email side by side */
.e-sender { flex: 2; flex-shrink: 0; flex-basis: 0; min-width: 0; display: flex; flex-direction: row; align-items: baseline; gap: 6px; overflow: hidden; }
.e-name { font-size: 13px; font-weight: 600; color: #1a3a5c; white-space: nowrap; flex-shrink: 0; }
.e-email { font-size: 11px; color: #7a9ab5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; text-decoration: none; flex-shrink: 1; }
.e-email:hover { color: #2e7dc4; }

/* Middle column: subject + preview side by side */
.e-middle { flex: 3; display: flex; flex-direction: row; align-items: baseline; gap: 8px; overflow: hidden; min-width: 0; }
.e-subject { font-size: 13px; font-weight: 600; color: #2c3e50; white-space: nowrap; flex-shrink: 0; }
.e-preview { font-size: 12px; color: #7a8fa5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }

.e-meta { display: flex; align-items: center; gap: 7px; flex-shrink: 0; width: 110px; justify-content: flex-end; }
.e-time { color: #7a8fa5; font-size: 12px; white-space: nowrap; }
.e-attach { color: #a0b4c8; font-size: 12px; }
.e-cnt-badge { background: #2e7dc4; color: #fff; font-size: 10px; font-weight: 700; border-radius: 100px; padding: 1px 7px; }
.e-attach { color: #a0b4c8; font-size: 12px; }
.e-cnt-badge { background: #2e7dc4; color: #fff; font-size: 10px; font-weight: 700; border-radius: 100px; padding: 1px 7px; }

/* ===== LIST FOOTER ===== */
.list-footer { display: flex; align-items: center; justify-content: space-between; padding: 9px 18px; background: #fff; border-top: 1px solid #dde5ef; }
.btn-refresh { background: #fff; border: 1px solid #dde5ef; border-radius: 4px; padding: 5px 14px; cursor: pointer; color: #5a7a9a; font-size: 13px; transition: all .15s; }
.btn-refresh:hover { background: rgba(46,125,196,.08); color: #1a3a5c; border-color: #2e7dc4; }
.btn-send { background: none; border: none; color: #2e7dc4; cursor: pointer; font-size: 14px; padding: 4px 8px; border-radius: 4px; transition: background .15s; }
.btn-send:hover { background: rgba(46,125,196,.1); }

/* ===== EMAIL VIEW ===== */
.ev-layout { display: flex; align-items: flex-start; min-height: calc(100vh - 155px); border-radius: 0 0 8px 8px; overflow: hidden; }
.ev-left { width: 280px; flex-shrink: 0; background: #fff; border-right: 1px solid #dde5ef; overflow-y: auto; overflow-x: hidden; border-bottom-left-radius: 8px; }
.ev-right { flex: 1; overflow: hidden; background: #f4f7fb; border-bottom-right-radius: 8px; border-bottom-left-radius: 8px; }

.ev-client-card { padding: 18px 16px; }
.ev-avatar { width: 150px; height: 150px; border-radius: 50%; overflow: hidden; margin: 0 auto 10px; background: #d0e8f7; display: flex; align-items: center; justify-content: center; border: 3px solid #2e7dc4; cursor: pointer; }
.ev-avatar img { width: 100%; height: 100%; object-fit: cover; }
.ev-avatar a { display: flex; width: 100%; height: 100%; align-items: center; justify-content: center; border-radius: 50%; overflow: hidden; }
.ev-avatar a img { width: 100%; height: 100%; object-fit: cover; }
.ev-avatar-placeholder { font-size: 54px; color: #2e7dc4; }
.ev-client-name { text-align: center; font-size: 14px; font-weight: 600; color: #1e2a3a; }
.ev-client-sub { text-align: center; font-size: 12px; color: #5a7a9a; margin-bottom: 12px; font-weight: bold; }
.ev-client-email { text-align: center; font-size: 12px; color: #5a7a9a; margin-bottom: 8px; word-break: break-all; }

.ev-name-confirm-row { margin-bottom: 12px; }
.ev-name-confirm-lbl { display: block; text-align: center; font-size: 11px; color: #2e7dc4; margin-bottom: 6px; text-transform: uppercase; letter-spacing: .5px; font-weight: 600; }
.ev-name-input-wrap { display: flex; gap: 4px; align-items: center; }
.ev-name-input { flex: 1; min-width: 0; border: 2px solid #a8c4e0; border-radius: 8px; padding: 5px 8px; font-size: 18px; text-align: center; color: #1e2a3a; background: #fff; outline: none; transition: border-color .15s; }
.ev-name-input:focus { border-color: #2e7dc4; background: #f0f6fd; }
.ev-name-save-btn { background: none; border: none; color: #2e7dc4; cursor: pointer; font-size: 14px; padding: 2px 6px; border-radius: 4px; flex-shrink: 0; }
.ev-name-save-btn:hover { background: rgba(46,125,196,.1); }
.ev-name-reject-btn { color: #c0504d; }
.ev-name-reject-btn:hover { background: rgba(192,80,77,.1); }
.ev-name-display { text-align: center; font-size: 20px; font-weight: 600; color: #1e2a3a; margin-bottom: 12px; border: 2px solid #a8c4e0; border-radius: 8px; padding: 5px 8px; outline: none; background: #fff; min-height: 36px; }
.ev-name-display:focus { border-color: #2e7dc4; background: #f0f6fd; }
.ev-tg-identity { margin-bottom: 12px; }
.ev-tg-id-row { display: flex; align-items: center; gap: 6px; padding: 3px 0; }
.ev-tg-id-lbl { font-size: 11px; color: #5a7a9a; font-weight: 600; min-width: 58px; flex-shrink: 0; }
.ev-tg-id-val { font-size: 13px; color: #1e2a3a; word-break: break-all; }
.ev-tg-id-val.ev-name-display { font-size: 13px; font-weight: 600; margin-bottom: 0; text-align: left; }

.ev-fields { margin-bottom: 12px; }
.ev-field { margin-bottom: 8px; }
.ev-field { display: flex; align-items: center; padding: 5px 0; border-bottom: 1px solid #f0f5fa; margin-bottom: 0; }
.ev-field label { font-size: 10px; color: #2e7dc4; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; min-width: 90px; flex-shrink: 0; margin-bottom: 0; }
.ev-field input { flex: 1; border: none; font-size: 13px; color: #1e2a3a; background: transparent; outline: none; text-align: right; }
.ev-field input:focus { border-bottom-color: #2e7dc4; border-bottom-width: 2px; }
.ev-field--readonly span { display: block; font-size: 13px; color: #1e2a3a; padding: 4px 0; border-bottom: 1px solid #dde5ef; }

.ev-history { margin-bottom: 12px; }
.ev-hist-link { display: block; font-size: 12px; color: #5a7a9a; padding: 3px 0; }
.ev-hist-link:hover { color: #2e7dc4; }
.ev-hist-link.active { font-weight: 600; color: #2e7dc4; }

.ev-client-btns { display: flex; gap: 16px; margin-top: 12px; padding: 0 4px; }
.ev-client-btns .btn { flex: 1; text-align: center; padding: 8px 10px; }
.ev-star-btn { background: #eef2f7; color: #a0b4c8; border: 1px solid #dde5ef; flex: 0 0 36px !important; }
.ev-star-btn-on { background: rgba(245,158,11,.1) !important; color: #f59e0b !important; border-color: rgba(245,158,11,.4) !important; }

.ev-notes-section { padding-bottom: 12px; }
.ev-notes-label { font-size: 11px; color: #2e7dc4; margin-bottom: 6px; text-transform: uppercase; letter-spacing: .5px; font-weight: 600; }
.ev-notes { width: 100%; min-height: 60px; border: 1px solid #dde5ef; border-radius: 4px; padding: 8px 10px; font-size: 13px; color: #1e2a3a; background: #f8fafc; resize: none; outline: none; font-family: inherit; overflow: hidden; }
.ev-notes:focus { border-color: #2e7dc4; }

.ev-email-block { background: #fff; border-bottom: 1px solid #dde5ef; }
.ev-email-hdr { font-size: 11px; color: #5a7a9a; text-transform: uppercase; letter-spacing: .5px; padding: 11px 18px 9px; display: flex; align-items: center; border-bottom: 1px solid #dde5ef; font-weight: 700; }
.ev-from-addr { color: #2e7dc4; font-weight: 600; }
.ev-email-time { margin-left: auto; color: #7a9ab5; font-size: 11px; }
.ev-plain { white-space: pre-wrap; font-family: inherit; font-size: 14px; line-height: 1.7; color: #1e2a3a; }
.q-hi { background: rgba(255,214,10,.2); color: inherit; border-radius: 3px; padding: 1px 3px; }
.ev-email-footer { display: flex; align-items: center; gap: 8px; padding: 11px 18px; border-top: 1px solid #dde5ef; }
.ev-msg { padding: 14px 18px; }
.ev-msg-meta { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.ev-msg-meta-row { display: flex; align-items: baseline; gap: 10px; }
.ev-msg-from { font-size: 13px; }
.ev-msg-subj { font-size: 20px; font-weight: 600; color: #1e2a3a; width: 100%; }
.ev-sep-line { border-top: 1px solid #dde5ef; margin: 0; }
.ev-msg-out { background: #f8fafc; border-left: 3px solid #c8d5e3; }
.ev-msg-insert { background: rgba(255,214,10,.08); border-left: 3px solid #d4a100; }
.ev-insert-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: #7a5500; background: rgba(255,214,10,.2); border-radius: 4px; padding: 2px 8px; margin-top: 6px; }
.ev-img-block { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 8px; }
.ev-img-thumb { max-width: 220px; max-height: 220px; object-fit: cover; border-radius: 6px; cursor: pointer; border: 1px solid #dde5ef; transition: opacity .15s; }
.ev-img-thumb:hover { opacity: .85; }
.ev-docs-block { margin-top: 8px; display: flex; flex-direction: column; gap: 5px; }
.ev-doc-link { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; background: #f1f5f9; border: 1px solid #dde5ef; border-radius: 6px; font-size: 13px; color: #1e4a7a; text-decoration: none; max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-doc-link:hover { background: #e0eaf5; }

.ev-reply-block { background: #fff; margin-top: 2px; border-top: 1px solid #dde5ef; border-radius: 0 0 8px 8px; overflow: hidden; }
.ev-reply-hdr { padding: 11px 18px; display: flex; align-items: center; justify-content: space-between; font-size: 13px; color: #2e7dc4; font-weight: 700; border-bottom: 1px solid #dde5ef; }
.ev-reply-body { padding: 14px 18px; }
.ev-auto-badge { font-size:11px;font-weight:600;padding:3px 10px;border-radius:10px;background:rgba(46,125,196,.1);color:#2e7dc4; }
.ev-reply-subject { width: 100%; border: none; border-bottom: 1px solid #dde5ef; padding: 6px 0; font-size: 22px; font-weight: 600; margin-bottom: 12px; outline: none; color: #1e2a3a; font-family: inherit; background: transparent; }
.ev-reply-subject:focus { border-bottom-color: #2e7dc4; border-bottom-width: 2px; }
.ev-reply-text { width: 100%; min-height: 240px; border: 1px solid #dde5ef; border-radius: 4px; padding: 10px 14px; font-size: 14px; outline: none; font-family: inherit; color: #1e2a3a; background: #fff; margin-bottom: 12px; overflow-y: auto; white-space: pre-wrap; word-break: break-word; line-height: 1.6; box-sizing: border-box; }
.ev-reply-text:focus { border-color: #2e7dc4; }
.ev-reply-text:empty:before { content: attr(data-placeholder); color: #a0b4c8; pointer-events: none; }
.ev-reply-footer { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ev-tpl-badge { margin-left: auto; font-size: 11px; color: #7a9ab5; font-style: italic; }
.ev-tpl-badge-special { color: #f39c12; font-style: normal; font-weight: 600; }
.ev-tpl-badge-new { color: #27ae60; font-style: normal; font-weight: 600; }

.ev-pending-photos { display: flex; flex-wrap: wrap; gap: 14px; padding: 12px 0 8px 0; border-top: 1px solid #dde5ef; margin-top: 8px; }
.ev-pending-photos:empty { border: none; padding: 0; margin: 0; }
.ev-pending-photo-wrap { position: relative; display: inline-block; }
.ev-photo-remove { position: absolute; top: -7px; right: -7px; z-index: 10; width: 20px; height: 20px; border-radius: 50%; background: #dc3545; border: 2px solid #fff; color: #fff; font-size: 12px; font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: center; line-height: 1; padding: 0; }
.ev-photo-remove:hover { background: #b02a37; }
.ev-pending-photo { width: 90px; height: 90px; object-fit: cover; border-radius: 8px; cursor: pointer; border: 2px solid #dde5ef; display: block; }
.ev-pending-photo-name { font-size: 10px; color: #7a9ab5; text-align: center; margin-top: 3px; max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-doc-placeholder { width: 90px; height: 90px; display: none; align-items: center; justify-content: center; flex-direction: column; background: #f0f4f8; border-radius: 8px; border: 2px solid #dde5ef; color: #5a7fa0; font-size: 30px; cursor: default; }

.ev-reply-controls { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 12px 0 8px 0; border-top: 1px solid #dde5ef; margin-top: 8px; }
.ev-ctrl-left { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ev-ctrl-right { display: flex; align-items: center; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.ev-special-select { width: 200px; flex-shrink: 0; padding: 9px 30px 9px 12px; border: 1px solid #dde5ef; border-radius: 4px; font-size: 13px; color: #1e2a3a; background: #fff; font-family: inherit; outline: none; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath fill='%232e7dc4' d='M5 7L0 2h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; cursor: pointer; }
.ev-special-select:focus { border-color: #2e7dc4; }
.ev-special-select option { background: #fff; color: #1e2a3a; }
.ev-reply-actions { display: flex; align-items: center; gap: 10px; padding: 12px 0 4px 0; border-top: 1px solid #dde5ef; margin-top: 8px; }
.ev-file-list { font-size: 11px; color: #2e7dc4; max-width: 250px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }

/* ===== MANUAL PROCESSING ===== */
.manual-badge { display: inline-flex; align-items: center; gap: 5px; background: rgba(0,200,160,.1); color: #3a3853; font-size: 11px; border-radius: 6px; padding: 2px 8px; flex-shrink: 0; font-weight: 600; border: 1px solid rgba(0,200,160,.2); }
.manual-badge-special { background: rgba(155,89,182,.12); color: #3a3853; border-color: rgba(155,89,182,.25); }
.manual-badge-new { background: rgba(39,174,96,.1); color: #3a3853; border-color: rgba(39,174,96,.2); }
.manual-star { font-size: 13px; visibility: hidden; pointer-events: none; flex-shrink: 0; width: 13px; }
.manual-star-on { visibility: visible; color: #f59e0b; }
.manual-info { flex: 2; display: flex; align-items: center; gap: 10px; overflow: hidden; min-width: 0; }
.manual-labels { width: 128px; flex-shrink: 0; display: flex; align-items: center; gap: 6px; }
.manual-notes { color: #5a7a9a; font-size: 12px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.manual-count-badge { background: #eef2f7; color: #5a7a9a; font-size: 11px; border-radius: 100px; padding: 2px 8px; flex-shrink: 0; border: 1px solid #dde5ef; }

/* ===== OUTBOX STATUS ===== */
.ob-status-err  { font-size:11px;font-weight:600;padding:2px 8px;border-radius:10px;background:rgba(220,53,69,.1);color:#dc3545; }
.ob-status-wait { font-size:11px;font-weight:600;padding:2px 8px;border-radius:10px;background:rgba(46,125,196,.1);color:#2e7dc4; }
.ob-status-ok   { font-size:11px;font-weight:600;padding:2px 8px;border-radius:10px;background:rgba(39,174,96,.1);color:#27ae60; }
.ob-src-auto    { font-size:11px;font-weight:600;padding:2px 8px;border-radius:10px;background:rgba(46,125,196,.1);color:#2e7dc4; }
.ob-src-manual  { font-size:11px;font-weight:600;padding:2px 8px;border-radius:10px;background:rgba(243,156,18,.1);color:#e67e22; }

/* ===== COMPOSE ===== */
.compose-wrap { padding: 22px 26px; background: #fff; }
.compose-title { font-size: 15px; font-weight: 600; color: #1e2a3a; margin-bottom: 18px; padding-bottom: 12px; border-bottom: 1px solid #dde5ef; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 700; margin-bottom: 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; }
.form-ctrl { width: 100%; padding: 9px 12px; border: 1px solid #c8d5e8; border-radius: 4px; color: #1e2a3a; outline: none; transition: border-color .15s; background: #fff; font-family: inherit; }
.form-ctrl:focus { border-color: #2e7dc4; }
.form-ctrl::placeholder { color: #9ab0c4; }
select.form-ctrl { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath fill='%232e7dc4' d='M5 7L0 2h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 30px; background-color: #fff; }
select.form-ctrl option { background: #fff; color: #1e2a3a; }
textarea.form-ctrl { resize: vertical; }
.form-row { display: flex; gap: 16px; }
.form-row .form-group { flex: 1; }
.checkbox-lbl { display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: normal; color: #5a7a9a; font-size: 13px; }

/* ===== BUTTONS ===== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 18px; border-radius: 6px; border: none; cursor: pointer; font-size: 13px; font-weight: 600; text-align: center; transition: all .15s; font-family: inherit; }
.btn:hover { opacity: .88; }
.btn-primary { background: #2e7dc4; color: #fff; box-shadow: 0 1px 4px rgba(20,40,70,.15); }
.btn-primary:hover { opacity: 1; box-shadow: 0 2px 12px rgba(20,40,70,.18); }
.btn-success { background: #27ae60; color: #fff; }
.btn-secondary { background: #eef2f7; color: #1e2a3a; border: 1px solid #748292; }
.btn-secondary:hover { background: #e2eaf4; border-color: #b0c4d8; opacity: 1; }
.btn-danger { background: #dc3545; color: #fff; }
.btn-sm { padding: 5px 12px; font-size: 12px; }

/* ===== CLIENTS LIST ===== */
.client-row { display: flex; align-items: center; padding: 9px 16px; border-bottom: 1px solid #dde5ef; cursor: pointer; gap: 12px; background: #fff; transition: background .12s; }
.client-row:hover { background: #f4f7fb; }
.c-star { color: #c8d5e3; cursor: pointer; font-size: 13px; width: 14px; flex-shrink: 0; }
.c-star.active { color: #f59e0b; }
.c-star:hover { color: #f59e0b; }
.c-name { min-width: 240px; max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 500; color: #1e2a3a; padding-left: 1cm; }
.c-name.vip { color: #dc3545; font-weight: 700; }
.c-email { flex: 1; font-size: 13px; color: #2e7dc4; font-weight: 500; }
.c-photo { color: #c8d5e3; font-size: 15px; }
.c-photo.has-photo { color: #2e7dc4; }
.c-date { font-size: 11px; color: #7a9ab5; white-space: nowrap; }

/* ===== FORM SECTIONS ===== */
.section-divider { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: #2e7dc4; border-bottom: 2px solid rgba(46,125,196,.15); padding-bottom: 6px; margin: 20px 0 14px; }
.gmail-hint { background: rgba(243,156,18,.08); border: 1px solid rgba(243,156,18,.25); border-radius: 6px; padding: 12px 16px; font-size: 13px; color: #8a5a00; margin-bottom: 16px; line-height: 1.7; }
.gmail-hint i { color: #f39c12; margin-right: 5px; }

/* ===== MAILBOX CARDS ===== */
.mb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; padding: 10px 18px 18px 0; background: transparent; }
.mb-card { border: 1px solid #dde5ef; border-radius: 8px; overflow: hidden; background: #fff; box-shadow: 0 1px 4px rgba(20,40,70,.08); }
.mb-card-hdr { padding: 12px 16px; font-weight: 700; font-size: 14px; color: #fff; background: #2e7dc4; }
.mb-card-hdr.inactive { background: #c8d5e3; color: #5a7a9a; }
.mb-card-body { padding: 16px; }
.mb-card-dname { font-weight: 700; font-size: 17px; text-align: center; margin-bottom: 4px; color: #1e2a3a; }
.mb-card-email { color: #7a9ab5; font-size: 12px; text-align: center; margin-bottom: 14px; }
.mb-stats { border-top: 1px solid #dde5ef; padding-top: 10px; }
.mb-stat-row { display: flex; justify-content: space-between; padding: 4px 0; font-size: 13px; border-bottom: 1px solid #dde5ef; color: #5a7a9a; }
.stat-val { color: #2e7dc4; font-weight: 600; }
.mb-card-actions { padding: 12px 16px; display: flex; flex-direction: column; gap: 8px; border-top: 1px solid #dde5ef; }
.mb-card-actions .btn { width: 100%; }

/* ===== FORM WRAP ===== */
.form-wrap { max-width: 620px; margin: 20px auto; border: 1px solid #dde5ef; border-radius: 8px; overflow: hidden; background: #fff; box-shadow: 0 1px 4px rgba(20,40,70,.08); }
.form-wrap-hdr { background: #2e7dc4; color: #fff; padding: 13px 20px; font-size: 15px; font-weight: 600; }
.form-wrap-body { padding: 20px; background: transparent; }
.radio-group { display: flex; gap: 6px; }
.radio-btn { flex: 1; padding: 8px; border: 1px solid #dde5ef; border-radius: 4px; text-align: center; cursor: pointer; font-size: 13px; color: #5a7a9a; background: #eef2f7; transition: all .15s; font-family: inherit; }
.radio-btn.active { background: #2e7dc4; color: #fff; border-color: #2e7dc4; font-weight: 600; }

/* ===== EMPTY STATE ===== */
.empty-state { text-align: center; padding: 56px 20px; color: #a0b4c8; font-size: 14px; line-height: 2.2; }
.empty-state i { font-size: 44px; display: block; margin-bottom: 12px; color: #c8d5e3; }

/* ===== LOGIN ===== */
.login-body { background: #d7e5f5; min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-wrap { width: 400px; }
.login-card { background: #fff; padding: 36px 34px; border-radius: 12px; box-shadow: 0 4px 24px rgba(20,40,70,.12); border: 1px solid #dde5ef; text-align: center; }
.login-logo { width: 52px; height: 52px; border-radius: 10px; background: linear-gradient(135deg, #2e7dc4, #7ec8f7); margin: 0 auto 16px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 24px; }
.login-title { font-size: 20px; font-weight: 600; color: #1e2a3a; margin-bottom: 6px; }
.login-sub { font-size: 13px; color: #7a9ab5; margin-bottom: 26px; }
.login-error { background: rgba(220,53,69,.08); color: #dc3545; padding: 9px 14px; border-radius: 6px; margin-bottom: 16px; font-size: 13px; border: 1px solid rgba(220,53,69,.2); }
.login-field { position: relative; margin-bottom: 12px; }
.login-field input { width: 100%; padding: 12px 40px 12px 14px; border: 1px solid #c8d5e8; border-radius: 4px; font-size: 14px; outline: none; color: #1e2a3a; background: #fff; transition: border-color .15s; }
.login-field input:focus { border-color: #2e7dc4; }
.login-field input::placeholder { color: #9ab0c4; }
.field-ico { position: absolute; right: 13px; top: 50%; transform: translateY(-50%); color: #9ab0c4; font-size: 15px; }
.btn-login { width: 100%; padding: 12px; background: #2e7dc4; color: #fff; border: none; border-radius: 6px; font-size: 15px; font-weight: 600; cursor: pointer; transition: all .18s; font-family: inherit; box-shadow: 0 2px 12px rgba(20,40,70,.15); }
.btn-login:hover { background: #2570b0; }

/* ===== CLIENT VIEW (design_option_1 style, blue steel colors) ===== */
.cv-page { margin: 16px -24px -24px; padding: 0 24px 24px; background: #d7e5f5; min-height: calc(100vh - 120px); }
.profile-wrap { display: grid; grid-template-columns: 300px 1fr; gap: 20px; }

/* Left card */
.left-card { background: #fff; border: 1px solid #dde5ef; border-radius: 16px; padding: 28px 24px; display: flex; flex-direction: column; height: fit-content; box-shadow: 0 1px 4px rgba(20,40,70,.08); }
.avatar-wrap { display: flex; flex-direction: column; align-items: center; padding-bottom: 20px; border-bottom: 1px solid #dde5ef; margin-bottom: 16px; text-align: center; }
.avatar { width: 150px; height: 150px; border-radius: 50%; background: #d0e8f7; border: 3px solid #2e7dc4; display: flex; align-items: center; justify-content: center; font-size: 54px; color: #2e7dc4; margin-bottom: 12px; }
.avatar-img { width: 150px; height: 150px; border-radius: 50%; object-fit: cover; border: 3px solid #2e7dc4; margin-bottom: 12px; }
.avatar-name { font-size: 18px; font-weight: 700; color: #1a3a5c; }
.avatar-email { font-size: 12px; color: #7a9ab5; margin-top: 4px; }
.avatar-badges { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; justify-content: center; }
.badge-pill { padding: 3px 10px; border-radius: 20px; font-size: 10px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; }
.badge-vip { background: rgba(243,156,18,.12); color: #d4860a; border: 1px solid rgba(243,156,18,.3); }
.badge-photo { background: rgba(46,125,196,.1); color: #2e7dc4; border: 1px solid rgba(46,125,196,.25); }

.info-row { display: flex; justify-content: space-between; align-items: center; padding: 7px 0; border-bottom: 1px solid #eef2f7; gap: 8px; }
.info-label { font-size: 11px; color: #8a9eb5; text-transform: uppercase; letter-spacing: .5px; flex-shrink: 0; }
.info-input { flex: 1; min-width: 0; text-align: right; border: none; outline: none; background: transparent; font-size: 13px; color: #1e2a3a; font-weight: 500; font-family: inherit; }
.info-input:focus { color: #2e7dc4; border-bottom: 1px solid #2e7dc4; }
.info-input::placeholder { color: #b0c4d8; }
.info-val { font-size: 13px; color: #1e2a3a; font-weight: 500; }
.info-val-accent { color: #2e7dc4; font-weight: 700; }
.info-mail-icon { color: #2e7dc4; font-size: 13px; flex-shrink: 0; }

.left-actions { display: flex; gap: 8px; margin-top: 20px; padding-top: 20px; border-top: 1px solid #dde5ef; }
.lc-btn { padding: 8px 16px; border-radius: 8px; font-size: 12px; font-weight: 600; cursor: pointer; border: none; transition: all .15s; font-family: inherit; }
.lc-btn-danger { background: rgba(220,53,69,.08); color: #dc3545; border: 1px solid rgba(220,53,69,.25); }
.lc-btn-danger:hover { background: rgba(220,53,69,.18); }
.lc-btn-primary { background: rgba(46,125,196,.1); color: #2e7dc4; border: 1px solid rgba(46,125,196,.3); flex: 1; }
.lc-btn-primary:hover { background: rgba(46,125,196,.2); }

/* Right panel */
.right-panel { display: flex; flex-direction: column; gap: 16px; }
.rp-tabs { display: flex; gap: 2px; background: #eef2f7; border: 1px solid #dde5ef; border-radius: 12px; padding: 4px; width: fit-content; }
.rp-tab { padding: 8px 20px; border-radius: 9px; font-size: 13px; font-weight: 500; cursor: pointer; transition: all .15s; user-select: none; }
.rp-tab.active { background: #fff; color: #2e7dc4; font-weight: 600; box-shadow: 0 1px 3px rgba(20,40,70,.1); }
.rp-tab:hover:not(.active) { color: #1a3a5c; }
.rp-tab-compose { margin-left: auto; background: #2e7dc4; color: #fff !important; text-decoration: none; border-radius: 9px; }
.rp-panel { display: none; background: #fff; border: 1px solid #dde5ef; border-radius: 16px; padding: 24px; box-shadow: 0 1px 4px rgba(20,40,70,.06); }
.rp-panel.active { display: block; }
.panel-title { font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: #7a9ab5; margin-bottom: 18px; }

/* Correspondence */
.cp-list { display: flex; flex-direction: column; gap: 12px; }
.cp-item { display: flex; gap: 12px; align-items: flex-start; min-width: 0; overflow: hidden; }
.cp-icon { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; flex-shrink: 0; margin-top: 2px; }
.cp-icon-in { background: rgba(46,125,196,.15); color: #2e7dc4; }
.cp-icon-out { background: rgba(39,174,96,.15); color: #27ae60; }
.cp-bubble { flex: 1; min-width: 0; border-radius: 10px; padding: 10px 14px; max-width: 85%; overflow: hidden; word-break: break-word; }
.cp-bubble-in { background: #dce8f5; border: 1px solid #c0d4ea; }
.cp-bubble-out { background: #edfaf3; border: 1px solid #b8dfc8; }
.cp-header { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; flex-wrap: wrap; }
.cp-from { font-weight: 600; color: #1a3a5c; }
.cp-time { font-size: 11px; color: #8a9eb5; white-space: nowrap; }
.cp-repeat { font-size: 11px; color: #2e7dc4; white-space: nowrap; margin-left: auto; }
.cp-repeat:hover { text-decoration: underline; }
.cp-subj { font-weight: 600; color: #2c3e50; margin-bottom: 4px; }
.cp-body { font-size: 13px; line-height: 1.5; white-space: pre-wrap; }
.cp-body-html { white-space: normal; max-width: 100%; word-break: break-word; overflow-x: auto; }
.cp-body-html * { max-width: 100% !important; box-sizing: border-box; }
.cp-body-html table { width: auto !important; table-layout: fixed; }
.cp-body-html img { max-width: 100% !important; height: auto !important; }
.cp-tpl-label { font-size: 11px; color: #7a9ab5; margin-top: 8px; font-style: italic; }
.cp-attachments { font-size: 12px; margin-top: 6px; color: #2c3e50; }
.cp-empty { text-align: center; color: #8a9eb5; font-size: 13px; padding: 30px 0; line-height: 2; }

/* Images */
.cp-img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.cp-img-cell { position: relative; }
.cp-img-thumb { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; cursor: pointer; transition: opacity .15s; border: 1px solid #dde5ef; }
.cp-img-thumb:hover { opacity: .8; }
.cp-doc-placeholder { width: 100%; aspect-ratio: 1; display: none; align-items: center; justify-content: center; flex-direction: column; gap: 6px; background: #f0f4f8; border-radius: 8px; border: 1px solid #dde5ef; color: #5a7fa0; font-size: 28px; cursor: pointer; }
.cp-doc-placeholder span { font-size: 9px; color: #7a9ab5; text-align: center; max-width: 90%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-doc-placeholder:hover { background: #e0eaf5; }

/* Settings */
.cp-srow { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid #eef2f7; }
.cp-srow input[type=checkbox] { width: 16px; height: 16px; cursor: pointer; accent-color: #2e7dc4; }
.cp-select { background: #f8fafc; border: 1px solid #dde5ef; border-radius: 6px; padding: 5px 8px; color: #1e2a3a; outline: none; font-family: inherit; }
.cp-select:focus { border-color: #2e7dc4; }

/* Notes */
.cp-notes { width: 100%; min-height: 200px; resize: vertical; background: #f8fafc; border: 1px solid #dde5ef; border-radius: 8px; padding: 10px 12px; font-size: 13px; color: #1e2a3a; outline: none; font-family: inherit; line-height: 1.6; }
.cp-notes:focus { border-color: #2e7dc4; }

.cs-row { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid #dde5ef; font-size: 13px; color: #5a7a9a; }
.cs-row input[type=checkbox] { width: 16px; height: 16px; cursor: pointer; accent-color: #2e7dc4; }

/* ===== OUTBOX ROWS ===== */
.outbox-row { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid #dde5ef; font-size: 13px; color: #1e2a3a; background: #fff; }
.outbox-row:last-child { border-bottom: none; }
.outbox-row:hover { background: #f4f7fb; }
.outbox-to { font-weight: 600; color: #1a3a5c; min-width: 200px; }
.outbox-subj { flex: 1; color: #2c3e50; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.outbox-time { font-size: 11px; color: #7a9ab5; white-space: nowrap; }
.outbox-status { font-size: 11px; padding: 2px 8px; border-radius: 10px; font-weight: 600; }
.outbox-pending { background: rgba(46,125,196,.1); color: #2e7dc4; }
.outbox-sent { background: rgba(39,174,96,.1); color: #27ae60; }
.outbox-failed { background: rgba(220,53,69,.1); color: #dc3545; }

/* ===== STATS ===== */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; padding: 18px; }
.stat-card { background: #fff; border: 1px solid #dde5ef; border-radius: 8px; padding: 16px 20px; box-shadow: 0 1px 4px rgba(20,40,70,.08); }
.stat-card-val { font-size: 28px; font-weight: 700; color: #2e7dc4; }
.stat-card-lbl { font-size: 12px; color: #7a9ab5; margin-top: 4px; }

/* ===== ATTACH MODAL ===== */
.attach-modal-overlay { position: fixed; inset: 0; background: rgba(20,40,70,.35); z-index: 5000; display: flex; align-items: center; justify-content: center; }
.attach-modal-box { background: #fff; border-radius: 10px; box-shadow: 0 8px 36px rgba(20,40,70,.17); width: 520px; max-height: 80vh; display: flex; flex-direction: column; border: 1px solid #dde5ef; }
.attach-modal-hdr { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid #dde5ef; font-weight: 700; font-size: 15px; color: #1e2a3a; }
.attach-modal-body { flex: 1; overflow-y: auto; padding: 14px 18px; }
.attach-modal-footer { padding: 12px 18px; border-top: 1px solid #dde5ef; display: flex; align-items: center; gap: 10px; }
.attach-thumb-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.attach-thumb-cell { display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; border: 2px solid #dde5ef; border-radius: 8px; padding: 6px; transition: all .15s; position: relative; }
.attach-thumb-cell:hover { border-color: #2e7dc4; }
.attach-thumb-cell.selected { border-color: #2e7dc4; background: rgba(46,125,196,.06); }
.attach-thumb-cell.attach-taken { opacity: .5; cursor: default; }
.attach-thumb-cell input[type=checkbox] { position: absolute; top: 4px; left: 4px; }
.attach-thumb-img { width: 80px; height: 80px; object-fit: cover; border-radius: 4px; }
.attach-doc-placeholder { width: 80px; height: 80px; display: none; align-items: center; justify-content: center; background: #f0f4f8; border-radius: 4px; color: #5a7fa0; font-size: 30px; }
.attach-thumb-name { font-size: 10px; color: #7a9ab5; text-align: center; max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ===== SETTINGS THEMES ===== */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; padding: 18px; }
.settings-theme-card { border: 2px solid #dde5ef; border-radius: 8px; overflow: hidden; cursor: pointer; transition: all .15s; }
.settings-theme-card:hover { border-color: #2e7dc4; box-shadow: 0 2px 12px rgba(20,40,70,.1); }
.settings-theme-card.active { border-color: #2e7dc4; box-shadow: 0 0 0 3px rgba(46,125,196,.15); }
.theme-preview { height: 80px; }
.theme-name { padding: 8px 12px; font-size: 13px; font-weight: 600; color: #1e2a3a; background: #fff; border-top: 1px solid #dde5ef; }
.theme-desc { padding: 0 12px 8px; font-size: 11px; color: #7a9ab5; background: #fff; }

/* ===== BLACKLIST ===== */
.bl-card { border: 1px solid #dde5ef; border-radius: 8px; overflow: hidden; background: #fff; box-shadow: 0 1px 4px rgba(20,40,70,.08); margin-bottom: 16px; }
.bl-card-hdr { padding: 10px 16px; background: rgba(46,125,196,.07); border-bottom: 1px solid #dde5ef; font-weight: 700; color: #1a3a5c; }
.bl-label { font-size: 11px; color: #2e7dc4; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 8px; display: block; }
.bl-row { display: flex; align-items: center; gap: 12px; padding: 9px 16px; border-bottom: 1px solid #dde5ef; font-size: 13px; color: #1e2a3a; }
.bl-row:last-child { border-bottom: none; }

/* ===== ATTACH AREA ===== */
.attach-area { border: 2px dashed #c8d5e3; border-radius: 6px; padding: 12px 16px; color: #5a7a9a; font-size: 13px; cursor: pointer; transition: all .15s; }
.attach-area:hover { border-color: #2e7dc4; color: #2e7dc4; background: rgba(46,125,196,.04); }
.attach-list { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.attach-item { font-size: 13px; color: #5a7a9a; padding: 4px 0; }
.attach-item i { color: #2e7dc4; margin-right: 6px; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 9px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgb(139,166,189); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgb(100,135,165); }

/* ===== FOOTER ===== */
.footer { margin-left: 240px; height: 38px; background: #fff; color: #7a9ab5; display: flex; align-items: center; justify-content: space-between; padding: 0 24px; font-size: 12px; border-top: 1px solid #dde5ef; }

/* ===== SETTINGS — BL-LAYOUT (blacklist/citation/short_texts/blocked_domains) ===== */
.bl-layout { display: flex; gap: 24px; padding: 18px; align-items: flex-start; }
.bl-main { flex: 1; min-width: 0; }
.bl-sidebar { width: 300px; flex-shrink: 0; }
.bl-card-body { padding: 14px; }
.bl-table { width: 100%; border-collapse: collapse; }
.bl-table th { text-align: left; font-size: 12px; color: #7a9ab5; padding: 8px 12px; border-bottom: 2px solid #dde5ef; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.bl-table td { padding: 9px 12px; border-bottom: 1px solid #dde5ef; font-size: 13px; color: #1e2a3a; }
.bl-table tr:last-child td { border-bottom: none; }
.bl-table tr:hover td { background: #f4f7fb; }
.bl-chk { accent-color: #2e7dc4; width: 15px; height: 15px; cursor: pointer; }

/* ===== SETTINGS — CITATION ===== */
.citation-textarea { width: 100%; min-height: 280px; border: 1px solid #c8d5e8; border-radius: 4px; padding: 10px 12px; font-size: 13px; color: #1e2a3a; background: #fff; outline: none; font-family: inherit; resize: vertical; line-height: 1.6; }
.citation-textarea:focus { border-color: #2e7dc4; }

/* ===== SETTINGS — PERSONAL DATA ===== */
.pd-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; padding: 10px 0 0 0; }
.pd-card { background: #fff; border: 1px solid #dde5ef; border-radius: 8px; overflow: hidden; }
.pd-card-hdr { padding: 12px 16px; background: rgba(46,125,196,.07); border-bottom: 1px solid #dde5ef; font-weight: 700; color: #1a3a5c; }
.pd-card-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; height: calc(100% - 44px); }
.pd-hint { line-height: 1.6; }
.pd-textarea { width: 100%; flex: 1; min-height: 300px; border: 1px solid #c8d5e8; border-radius: 4px; padding: 10px 12px; font-size: 13px; color: #1e2a3a; background: #f8fafc; outline: none; font-family: inherit; resize: vertical; line-height: 1.6; }
.pd-textarea:focus { border-color: #2e7dc4; background: #fff; }

/* ===== SETTINGS — TABS (tpl-tabs used in templates/inserts) ===== */
.tpl-wrap { background: #fff; border-radius: 0 0 8px 8px; box-shadow: 0 2px 8px rgba(20,40,70,.09); overflow: hidden; }
.tpl-footer { height: 8px; background: #fff; border-radius: 0 0 8px 8px; }
.tpl-tabs { display: flex; border-bottom: 2px solid #dde5ef; padding: 0; background: #fff; }
.tpl-tab { padding: 10px 18px; border: none; background: none; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all .15s; font-family: inherit; font-weight: 500; }
.tpl-tab.active { color: #2e7dc4; border-bottom-color: #2e7dc4; font-weight: 600; }
.tpl-tab:hover { color: #1e2a3a; }

/* ===== SETTINGS — TEMPLATES PAGE LAYOUT ===== */
.tpl-layout { display: flex; gap: 0; min-height: 400px; }
.tpl-content { flex: 1; padding: 20px; min-width: 0; background: #f8fafc; }
.tpl-sidebar { width: 480px; flex-shrink: 0; border-left: 1px solid #dde5ef; padding: 18px; background: #f8fafc; }
.tpl-sidebar-hdr { font-size: 12px; font-weight: 700; color: #1a3a5c; margin-bottom: 14px; text-transform: uppercase; letter-spacing: .4px; }
.tpl-sidebar-form { display: flex; flex-direction: column; gap: 14px; }

/* ===== SETTINGS — KIT CARDS ===== */
.kit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.kit-card { border: 1px solid #8191a5; border-radius: 8px; overflow: hidden; background: #fff; cursor: pointer; transition: all .15s; box-shadow: 0 1px 4px rgba(20,40,70,.07); }
.kit-card:hover { box-shadow: 0 3px 12px rgba(20,40,70,.12); }
.kit-card-hdr { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; background: rgba(46,125,196,.07); border-bottom: 1px solid #dde5ef; }
.kit-card-num { font-size: 13px; font-weight: 700; color: #2e7dc4; }
.kit-card-del { background: none; border: none; color: #dc3545; font-size: 16px; cursor: pointer; padding: 0 4px; line-height: 1; }
.kit-card-img { height: 120px; overflow: hidden; background: #f0f4f9; display: flex; align-items: center; justify-content: center; }
.kit-card-img img { width: 100%; height: 100%; object-fit: cover; }
.kit-card-lang { padding: 8px 10px; font-size: 12px; font-weight: 600; color: #5a7a9a; text-transform: uppercase; letter-spacing: .5px; text-align: center; }

/* ===== SETTINGS — TEMPLATE SECTIONS ===== */
.tpl-section { border: 1px solid #8191a5; border-radius: 6px; padding: 14px; margin-bottom: 12px; background: #fff; }
.tpl-section-num { display: inline-flex; align-items: center; justify-content: center; background: #2e7dc4; color: #fff; width: 22px; height: 22px; border-radius: 50%; font-size: 11px; font-weight: 700; flex-shrink: 0; margin-bottom: 8px; }
.tpl-section-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.tpl-subject-input { flex: 1; border: 1px solid #dde5ef; border-radius: 4px; padding: 7px 10px; font-size: 13px; color: #1e2a3a; background: #fff; outline: none; font-family: inherit; }
.tpl-subject-input:focus { border-color: #2e7dc4; }
.tpl-body-textarea { width: 100%; min-height: 120px; border: 1px solid #dde5ef; border-radius: 4px; padding: 8px 10px; font-size: 13px; color: #1e2a3a; background: #f8fafc; outline: none; font-family: inherit; resize: vertical; line-height: 1.6; }
.tpl-body-textarea:focus { border-color: #2e7dc4; background: #fff; }
.tpl-bottom-btns { display: flex; gap: 8px; padding: 8px 0 16px; }
.tpl-attach-btn { background: #eef2f7; border: 1px solid #c8d5e8; border-radius: 4px; padding: 6px 12px; font-size: 12px; color: #5a7a9a; cursor: pointer; font-family: inherit; transition: all .15s; }
.tpl-attach-btn:hover { border-color: #2e7dc4; color: #2e7dc4; background: rgba(46,125,196,.05); }
.tpl-scroll-btn { width: 24px; height: 22px; background: #eef2f7; border: 1px solid #dde5ef; border-radius: 3px; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 11px; color: #7a9ab5; }
.tpl-scroll-btn:hover { background: #e0e8f4; color: #2e7dc4; }
.extra-tpl-item { border: 1px solid #8191a5; border-radius: 6px; padding: 12px; margin-bottom: 10px; background: #fff; }
.extra-tpl-textarea { width: 100%; min-height: 100px; border: 1px solid #dde5ef; border-radius: 4px; padding: 8px 10px; font-size: 13px; color: #1e2a3a; background: #f8fafc; outline: none; font-family: inherit; resize: vertical; line-height: 1.6; flex: 1; }
.extra-tpl-textarea:focus { border-color: #2e7dc4; background: #fff; }

/* ===== SETTINGS — LANGUAGE DROPDOWN ===== */
.lang-dropdown { position: relative; display: inline-block; }
.lang-btn { background: #eef2f7; border: 1px solid #c8d5e8; border-radius: 4px; padding: 6px 12px; font-size: 13px; color: #1a3a5c; cursor: pointer; font-family: inherit; font-weight: 600; display: flex; align-items: center; gap: 4px; }
.lang-btn:hover { border-color: #2e7dc4; }
.lang-drop-menu { display: none; position: absolute; top: calc(100% + 4px); right: 0; background: #fff; border: 1px solid #dde5ef; border-radius: 6px; box-shadow: 0 4px 16px rgba(20,40,70,.12); z-index: 1000; min-width: 100px; padding: 4px 0; max-height: 260px; overflow-y: auto; }
.lang-drop-menu.open { display: block; }
.lang-drop-item { display: block; padding: 8px 14px; font-size: 13px; color: #1e2a3a; transition: background .12s; }
.lang-drop-item:hover { background: rgba(46,125,196,.06); color: #2e7dc4; }
.lang-drop-item.active { color: #2e7dc4; font-weight: 600; }

/* ===== SETTINGS — ATTACHMENTS PAGE ===== */
.att-layout { display: flex; }
.att-kit-sidebar { width: 220px; flex-shrink: 0; border: 1px solid #dde5ef; border-radius: 8px; padding: 14px; background: #f8fafc; margin-right: 16px; margin-top: 10px; }
.att-kit-item { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; border-radius: 6px; cursor: pointer; font-size: 13px; color: #1e2a3a; margin-bottom: 4px; transition: background .12s; }
.att-kit-item:hover { background: rgba(46,125,196,.06); }
.att-kit-item.active { background: rgba(46,125,196,.1); color: #2e7dc4; font-weight: 600; }
.att-kit-del { background: none; border: none; color: #dc3545; font-size: 16px; cursor: pointer; padding: 0 4px; opacity: .5; }
.att-kit-del:hover { opacity: 1; }
.att-kit-name-input { width: 100%; padding: 8px 10px; border: 1px solid #c8d5e8; border-radius: 4px; font-size: 13px; color: #1e2a3a; background: #fff; outline: none; font-family: inherit; }
.att-kit-name-input:focus { border-color: #2e7dc4; }
.att-gallery-main { flex: 1; min-width: 0; }
.att-kit-num { font-size: 18px; font-weight: 700; color: #1e2a3a; margin-bottom: 14px; }
.att-section-hdr { font-size: 12px; font-weight: 700; color: #7a9ab5; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 10px; }
.att-photo-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.att-photo-cell { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 100px; }
.att-photo-thumb { width: 100px; height: 100px; object-fit: cover; border-radius: 6px; border: 1px solid #dde5ef; background: #f0f4f9; }
.att-file-icon { width: 100px; height: 100px; border-radius: 6px; border: 1px solid #dde5ef; background: #f0f4f9; display: flex; align-items: center; justify-content: center; color: #7a9ab5; font-size: 26px; }
.att-photo-info { display: flex; align-items: center; gap: 4px; width: 100%; }
.att-photo-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.att-photo-chk { flex-shrink: 0; }
.att-upload-box { border: 1px solid #dde5ef; border-radius: 8px; padding: 18px; background: #f8fafc; margin-top: 10px; }
.att-upload-title { font-size: 14px; font-weight: 600; color: #1e2a3a; margin-bottom: 8px; }
.att-upload-info { font-size: 12px; color: #7a9ab5; line-height: 1.7; margin-bottom: 14px; }
.att-upload-form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.att-choose-btn { display: inline-flex; align-items: center; gap: 6px; background: #2e7dc4; color: #fff; border: none; border-radius: 6px; padding: 7px 16px; font-size: 13px; font-weight: 500; cursor: pointer; transition: background .15s; }
.att-choose-btn:hover { background: #2568a8; }
.att-file-label { font-size: 13px; color: #5a7a9a; }

/* Compose photo preview */
.attach-preview-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.attach-preview-item { position: relative; width: 90px; }
.attach-preview-img { width: 90px; height: 90px; object-fit: cover; border-radius: 6px; border: 1px solid #dde5ef; display: block; }
.attach-preview-ico { width: 90px; height: 90px; border-radius: 6px; border: 1px solid #dde5ef; background: #f0f4f9; display: flex; align-items: center; justify-content: center; color: #7a9ab5; font-size: 24px; }
.attach-preview-del { position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%; background: #dc3545; border: none; color: #fff; font-size: 14px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; z-index: 1; }
.attach-preview-name { font-size: 10px; color: #5a7a9a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 3px; text-align: center; }

/* ===== MOBILE: always compact sidebar ===== */
@media (max-width: 768px) {
  .sidebar { width: 52px !important; }
  .sidebar .nav-label,
  .sidebar .nav-item span,
  .sidebar .badge,
  .sidebar .arrow-icon { display: none !important; }
  .sidebar .nav-item { justify-content: center !important; padding: 10px 6px !important; margin: 2px 4px !important; }
  .page-wrap { margin-left: 52px !important; }
  .sb-search { display: none !important; }
}
