:root {
  --gold: #C9A84C;
  --gold-light: #E8CC8A;
  --dark: #1A1A1A;
  --bg: #F8F6F1;
  --white: #FFFFFF;
  --border: #EAE8E3;
  --text: #1A1A1A;
  --muted: #888888;
  --muted-light: #AAA;
  --danger: #B91C1C;
}

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

body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 400;
  font-feature-settings: "cv11", "ss01";
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

body, input, button, textarea, select, h1, h2, h3, h4, h5, h6, a, span, label, th, td {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, .page-title, .brand-title,
.sidebar__title, .topbar__title, .panel__title, .sidepanel__title,
.workspace-title, .dashboard-header__title, .m-hero__title,
.m-section__title, .m-case-drawer__title {
  font-family: "Lora", Georgia, serif;
  font-weight: 600;
}

code, pre, kbd, samp, .mono {
  font-family: "JetBrains Mono", monospace;
}

.muted { color: var(--muted); }
.h1 {
  margin: 0;
  font-size: 34px;
  font-weight: 600;
}

.container {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0;
}

/* App shell */
.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 220px 1fr;
}

.sidebar {
  background: var(--dark);
  color: var(--white);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  border-right: 1px solid #2A2A2A;
}

.sidebar__accent {
  height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--gold-light), var(--gold));
}

.sidebar__brand {
  padding: 28px 24px;
  border-bottom: 1px solid #2A2A2A;
}

.sidebar__title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.sidebar__subtitle {
  margin-top: 3px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--gold);
}

.sidebar__nav {
  padding: 16px 0;
  display: grid;
  gap: 2px;
}

.sidebar__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 14px;
  margin: 1px 8px;
  color: #888;
  text-decoration: none;
  border-left: 2px solid transparent;
  border-radius: 8px;
  font-size: 13px;
  transition: all 0.15s ease;
}

.sidebar__icon {
  font-size: 14px;
  opacity: 0.9;
}

.sidebar__icon--svg {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.sidebar__icon--svg svg {
  display: block;
}

.sidebar__icon--raster .sidebar__icon-img {
  display: block;
  width: 20px;
  height: 20px;
  object-fit: contain;
  opacity: 0.72;
}

.sidebar__item.is-active .sidebar__icon--raster .sidebar__icon-img {
  opacity: 1;
  filter: drop-shadow(0 0 4px rgba(201, 168, 76, 0.45));
}

.sidebar__item.is-active {
  color: var(--gold);
  border-left-color: var(--gold);
  background: rgba(201, 168, 76, 0.12);
}

.sidebar__item:hover {
  color: var(--gold);
  background: rgba(201, 168, 76, 0.08);
}

.sidebar__item:hover:not(.is-active) {
  border-left-color: rgba(201, 168, 76, 0.35);
}

.sidebar__item:hover .sidebar__icon {
  opacity: 1;
}

.sidebar__item:hover .sidebar__icon--raster .sidebar__icon-img {
  opacity: 1;
  filter: drop-shadow(0 0 4px rgba(201, 168, 76, 0.5));
}

.sidebar__firm-id {
  padding: 10px 20px 4px;
  border-top: 1px solid #2A2A2A;
}
.sidebar__firm-id-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #555;
  margin-bottom: 5px;
}
.sidebar__firm-id-code {
  display: block;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 9px;
  line-height: 1.35;
  word-break: break-all;
  color: #C9A84C;
  opacity: 0.95;
}
.sidebar__firm-id-none {
  font-size: 10px;
  line-height: 1.4;
}

.sidebar__firm-id-link {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  line-height: 1.35;
  color: #C9A84C;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.sidebar__firm-id-link:hover {
  color: #E5D4A1;
}

/* ── Χρήση AI στο sidebar (αγωγή σύνοψης χωρίς τεχνικό όρο στο UI) ── */
.sidebar__usage {
  padding: 10px 20px 12px;
  border-top: 1px solid #2A2A2A;
}
.sidebar__usage-label {
  font-size: 9px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: #555; margin-bottom: 5px;
}
.sidebar__usage-row {
  display: flex; align-items: baseline; gap: 5px;
}
.sidebar__usage-val {
  font-size: 18px; font-weight: 700; color: var(--gold); line-height: 1;
}
.sidebar__usage-unit {
  font-size: 10px; color: #666;
}
.sidebar__usage-bar {
  height: 3px; background: #2A2A2A; border-radius: 99px;
  margin: 5px 0 4px; overflow: hidden;
}
.sidebar__usage-bar-fill {
  height: 100%; background: linear-gradient(90deg, var(--gold), #8B6914);
  border-radius: 99px; min-width: 4px; transition: width .4s ease;
}
.sidebar__usage-detail {
  font-size: 9px; color: #555;
}

.sidebar__user {
  border-top: 1px solid #2A2A2A;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), #8B6914);
  color: var(--dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
  text-decoration: none;
}

.sidebar__userMeta { min-width: 0; flex: 1; }
.sidebar__username { color: var(--white); font-size: 12px; font-weight: 500; }
.sidebar__role { color: #666; font-size: 10px; margin-top: 1px; }
.sidebar__profileLink {
  display: inline-block;
  margin-top: 4px;
  font-size: 10px;
  color: var(--gold-light);
  text-decoration: none;
}
.sidebar__logout {
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: #1a1a1a;
  color: #ececec;
  border-radius: 10px;
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.sidebar__logout:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.35);
  background: #252525;
}
.sidebar__logout:focus {
  outline: none;
}
.sidebar__logout:focus-visible {
  outline: 2px solid var(--gold-light, #d4b464);
  outline-offset: 2px;
}
.sidebar__logout-icon {
  display: block;
  flex-shrink: 0;
}

.app-main {
  min-width: 0;
  display: grid;
  grid-template-rows: 56px 1fr;
}

.topbar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar__lead {
  display: flex;
  align-items: center;
  gap: 22px;
  min-width: 0;
  flex: 1;
}

.topbar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
  padding: 6px 10px;
  margin: -6px -10px;
  border-radius: 12px;
  transition: background 0.15s ease;
}

.topbar-logo:hover {
  background: rgba(201, 168, 76, 0.14);
}

.topbar-logo__icon {
  font-size: 26px;
  line-height: 1;
  filter: grayscale(0.2);
}

.topbar-logo__wordmark {
  display: flex;
  flex-direction: column;
  line-height: 1.08;
}

.topbar-logo__line {
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 700;
}

.topbar-logo__line--emph {
  font-size: 11px;
  color: var(--text);
  letter-spacing: 0.1em;
  margin-top: 3px;
}

.topbar__titles {
  min-width: 0;
}

.topbar__date {
  font-size: 10px;
  letter-spacing: 0.15em;
  color: var(--gold);
  text-transform: uppercase;
}

.topbar__title {
  margin-top: 0;
  font-size: 21px;
  font-weight: 600;
  color: var(--text);
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar__avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), #8B6914);
  color: var(--dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.content-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  min-height: 0;
  align-items: stretch;
}
  min-width: 0;
  overflow: auto;
  padding: 18px 20px 24px 24px;
}

.workspace__top { padding-bottom: 0; position: relative; }
.workspace__content { display: grid; gap: 16px; min-width: 0; padding-top: 24px; }
.workspace__content .profile-firm-link {
  color: #7B4F00;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.workspace__content .profile-firm-link:hover {
  color: #C9A84C;
}
.workspace__content > * { min-width: 0; max-width: 100%; }

.search {
  width: min(560px, 100%);
  border: 1px solid var(--border);
  background: var(--white);
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
}

.search__icon { color: var(--muted-light); font-size: 12px; }
.search__input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  outline: none;
}
.search__kbd {
  font-size: 10px;
  color: #CCC;
}
.search-results {
  position: absolute;
  z-index: 2000;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-top: 6px;
  width: min(560px, 100%);
  max-height: 360px;
  overflow: auto;
}
.search-results__section { padding: 8px; border-top: 1px solid #f1efe9; }
.search-results__section:first-child { border-top: none; }
.search-results__title { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: #9a978f; margin-bottom: 6px; }
.search-results__item { display: block; padding: 6px 8px; border-radius: 6px; color: var(--text); text-decoration: none; font-size: 12px; }
.search-results__item:hover { background: #f8f6f1; }
.search-results__empty { padding: 10px; font-size: 12px; color: #666; }

.sidepanel {
  border-left: 1px solid var(--border);
  background: var(--white);
  padding: 16px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
}
.sidepanel:hover { scrollbar-color: var(--border) transparent; }

.sidepanel__title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 12px;
}

.sidepanel__card {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--white);
  padding: 14px;
  margin-bottom: 12px;
}

.sidepanel__label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted-light);
  margin-bottom: 7px;
}

.sidepanel__value { font-size: 13px; line-height: 1.45; color: #666; }

.sidepanel__card--dark {
  background: var(--dark);
  color: #F8F6F1;
  border-color: #2A2A2A;
  position: relative;
  overflow: hidden;
}
.sidepanel__accent {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--gold), var(--gold-light), var(--gold));
}
.sidepanel__aiKicker {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 5px;
}
.sidepanel__aiTitle {
  font-size: 20px;
  margin-bottom: 8px;
}
.sidepanel__aiText {
  font-size: 12px;
  line-height: 1.6;
  color: #BBB4A7;
  margin-bottom: 12px;
}

.sidepanel__bot {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.sidepanel__bot-header {
  padding: 10px 14px;
  background: #1A1A1A;
  border-bottom: 2px solid #C9A84C;
  flex-shrink: 0;
}
.sidepanel__bot-title {
  font-size: 14px;
  font-weight: 700;
  color: #F8F6F1;
  margin: 0 0 2px;
}
.sidepanel__bot .chatbot-messages {
  flex: 1;
  min-height: 200px;
  overflow-y: auto;
}
.sidepanel__bot .chatbot-footer {
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.sidepanel__quicknav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sidepanel__quicklink {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 6px;
  border-radius: 7px;
  font-size: 13px;
  color: var(--text);
  text-decoration: none;
  transition: background .15s;
}
.sidepanel__quicklink:hover { background: var(--hover); }
.sidepanel__quicklink-icon { font-size: 15px; flex-shrink: 0; }

/* dark theme overrides */

/* Dashboard */
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 28px;
  margin-bottom: 20px;
}
.dashboard-header__date {
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
}
.dashboard-header__title {
  margin: 4px 0 6px;
  font-size: 36px;
  line-height: 1;
}
.dashboard-header__sub {
  margin: 0;
  font-size: 13px;
}

.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.stat-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--white);
  padding: 16px 18px;
}
.stat-card__label {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-light);
}
.stat-card__value {
  margin-top: 6px;
  font-size: 30px;
  line-height: 1;
}
.stat-card__sub {
  margin-top: 5px;
  font-size: 10px;
  color: #AAA;
}

.dashboard-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 16px;
}

.panel {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--white);
  padding: 14px;
}
.panel--wide { padding: 16px; }
.panel__header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 10px;
}
.panel__title {
  margin: 0;
  font-size: 21px;
  font-weight: 600;
}
.panel__sub { font-size: 11px; }

.cases-table {
  border: 1px solid #F0EDE8;
  border-radius: 9px;
  overflow: hidden;
}
.cases-table__head {
  display: grid;
  grid-template-columns: 1.2fr 1fr 110px;
  gap: 10px;
  padding: 9px 12px;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #AAA;
  border-bottom: 1px solid #F5F3EF;
}
.cases-table__row {
  width: 100%;
  display: grid;
  grid-template-columns: 1.2fr 1fr 110px;
  gap: 10px;
  border: none;
  border-bottom: 1px solid #F5F3EF;
  padding: 11px 12px;
  background: var(--white);
  text-align: left;
  cursor: pointer;
}
.cases-table__row:last-child { border-bottom: none; }
.cases-table__row:hover { background: #FAFAF8; }
.cases-table__title {
  font-weight: 500;
  color: var(--text);
}
.cases-table__status {
  font-size: 10px;
  color: #7B4F00;
  background: #FFF3CC;
  border-radius: 30px;
  padding: 3px 8px;
  justify-self: start;
  text-transform: capitalize;
}

.stack { display: grid; gap: 8px; }
.stack__item {
  border: 1px solid #F0EDE8;
  border-radius: 8px;
  background: #FAFAF8;
  padding: 11px;
}
.stack__title { font-size: 13px; font-weight: 500; }
.stack__meta { margin-top: 3px; font-size: 11px; }

/* Generic */
.workspace-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.workspace-kicker {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}
.workspace-title {
  margin: 4px 0 0;
  font-size: 32px;
}
.tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.tile {
  border: 1px solid #F0EDE8;
  border-radius: 8px;
  background: #FAFAF8;
  padding: 12px;
}
.tile__title { font-weight: 500; font-size: 13px; }
.tile__meta { margin-top: 3px; font-size: 11px; }

.card {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--white);
  padding: 16px;
}
.card--narrow { width: min(460px, 100%); margin: 34px auto; }

.form { display: grid; gap: 12px; margin-top: 10px; }
.label { display: grid; gap: 6px; font-size: 14px; }
.input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--text);
  outline: none;
}
.input:focus {
  border-color: rgba(201, 168, 76, 0.65);
  box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.2);
}
.textarea { resize: vertical; min-height: 180px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 8px;
  border: 1px solid var(--dark);
  background: var(--dark);
  color: var(--bg);
  font-size: 12px;
  font-weight: 500;
  padding: 9px 14px;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { opacity: 0.9; }
.btn--dark { background: var(--dark); border-color: var(--dark); color: var(--bg); }
.btn__gold { color: var(--gold); }
.btn--gold { background: var(--gold); border-color: var(--gold); color: var(--dark); font-weight: 700; }
.btn--ghost { background: var(--white); border-color: var(--border); color: #666; }
.btn--full { width: 100%; }

.alert {
  border-radius: 8px;
  border: 1px solid #B8DDB8;
  background: #EFF8EF;
  color: #1B5E20;
  padding: 10px 12px;
  font-size: .9rem;
}
.alert--error, .alert-err {
  border-color: #F1B6B6;
  background: #FCEDEC;
  color: #8A1F11;
}
.alert--success, .alert-ok {
  border-color: #B8DDB8;
  background: #EFF8EF;
  color: #1B5E20;
}
.hint { margin-top: 8px; font-size: 13px; color: #777; }

.audio-tools {
  padding: 14px;
  border-radius: 10px;
  border: 1px dashed #D7D2C9;
  background: #FCFBF8;
}
.audio-tools__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.audio-tools__title { font-weight: 600; font-size: 14px; }
.audio-tools__actions { display: flex; gap: 8px; flex-wrap: wrap; }

.dropzone {
  margin-top: 12px;
  padding: 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--white);
}
.dropzone--active {
  border-color: rgba(201, 168, 76, 0.7);
  box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.2);
}
.dropzone__text { font-size: 14px; }
.dropzone__sub { margin-top: 6px; font-size: 12px; }
.evidence-upload { border-top: 1px solid var(--border); padding-top: 12px; }
.evidence-upload h3 { margin: 0 0 8px; }
.evidence-list { margin: 8px 0 0; padding-left: 18px; color: #666; font-size: 12px; }
.evidence-list__item { margin-bottom: 4px; }

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.4rem 0.9rem;
  color: #666;
  text-decoration: none;
  font-size: 0.9rem;
}
.avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 999px;
  object-fit: cover;
}
.profile-avatar-view { margin-bottom: 14px; }
.profile-avatar-view__img {
  width: 96px;
  height: 96px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid var(--border);
}
.profile-avatar-view__fallback {
  width: 96px;
  height: 96px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--gold), #8B6914);
  color: var(--dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}
.login-brand { margin-bottom: 12px; }
.login-brand__title { font-size: 24px; font-family: "Lora", Georgia, serif; }
.login-brand__subtitle { color: var(--gold); text-transform: uppercase; letter-spacing: .12em; font-size: 10px; }
.app-footer {
  border-top: 1px solid var(--border);
  padding: 10px 24px 14px;
  font-size: 11px;
  color: #8b877e;
}

/* Floating legal chatbot */
.legal-chatbot {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
}

.chatbot-toggle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #1A1A1A;
  border: 2px solid #C9A84C;
  color: #C9A84C;
  font-size: 28px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.chatbot-toggle:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 24px rgba(201, 168, 76, 0.4);
}

.chatbot-panel {
  display: none;
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 380px;
  height: 550px;
  background: #FFFFFF;
  border-radius: 16px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.2);
  border: 1px solid #EAE8E3;
  overflow: hidden;
  flex-direction: column;
}
.legal-chatbot.open .chatbot-panel { display: flex; }
.legal-chatbot.open .chatbot-toggle { display: none; }

.chatbot-header {
  background: #1A1A1A;
  color: #F8F6F1;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #C9A84C;
}
.chatbot-header h3 {
  margin: 0;
  font-family: "Lora", Georgia, serif;
  font-size: 16px;
}
.chatbot-subtitle {
  margin: 2px 0 0;
  font-size: 11px;
  color: #C9A84C;
  opacity: 0.8;
}
.chatbot-close {
  background: transparent;
  border: none;
  color: #F8F6F1;
  font-size: 24px;
  cursor: pointer;
  width: 32px;
  height: 32px;
}

.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: #F8F6F1;
}

.chat-message {
  margin-bottom: 12px;
  display: flex;
}
.chat-message--user { justify-content: flex-end; }
.chat-bubble {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}
.chat-message--bot .chat-bubble {
  background: #FFFFFF;
  border: 1px solid #EAE8E3;
  color: #1A1A1A;
  white-space: normal;
}
.chat-bubble .chat-md-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88em;
  margin: 0.45rem 0;
}
.chat-bubble .chat-md-table th,
.chat-bubble .chat-md-table td {
  border: 1px solid #dde1e7;
  padding: 0.35rem 0.45rem;
  text-align: left;
  vertical-align: top;
}
.chat-bubble .chat-md-table th {
  background: #eef1f5;
  font-weight: 600;
}
.chat-bubble .chat-md-h {
  font-size: 0.95em;
  margin: 0.45rem 0 0.2rem;
  font-weight: 700;
  color: #C9A84C;
  line-height: 1.3;
}
.chat-bubble .chat-md-h--1 { font-size: 1.02em; }
.chat-bubble .chat-md-hr {
  border: none;
  border-top: 1px solid #dde1e7;
  margin: 0.45rem 0;
}
.chat-bubble .chat-md-bq {
  margin: 0.35rem 0;
  padding: 0.35rem 0.55rem;
  border-left: 3px solid #C9A84C;
  background: #fefce8;
  font-size: 0.92em;
}
.chat-bubble .chat-md-li { margin: 0.12rem 0; }
.chat-bubble strong { color: #C9A84C; }
.chat-bubble em { font-style: italic; color: #334155; }
.chat-message--user .chat-bubble {
  background: #1A1A1A;
  color: #F8F6F1;
}

.chatbot-disclaimer {
  margin-top: 8px;
  font-size: 11px;
  color: #888;
  font-style: italic;
}

.chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}
.suggestion-btn {
  background: #FFFFFF;
  border: 1px solid #C9A84C;
  color: #1A1A1A;
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s;
}
.suggestion-btn:hover { background: #C9A84C; color: #1A1A1A; }

.chatbot-footer {
  display: flex;
  gap: 8px;
  padding: 12px;
  background: #FFFFFF;
  border-top: 1px solid #EAE8E3;
}
.chatbot-footer textarea {
  flex: 1;
  border: 1px solid #EAE8E3;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 14px;
  resize: none;
  max-height: 100px;
  outline: none;
}
.chatbot-footer textarea:focus { border-color: #C9A84C; }
.chatbot-send {
  background: #1A1A1A;
  color: #C9A84C;
  border: none;
  width: 40px;
  border-radius: 8px;
  font-size: 18px;
  cursor: pointer;
}
.chat-typing {
  display: inline-block;
  color: #888;
  font-style: italic;
  font-size: 13px;
}

/* Mobile / tablet shell (≤1024px): hamburger drawer, χωρίς κάτω πλοήγηση.
   Επαναφορά layout: git tag responsive-shell-v1 */
.m-topbar,
.m-bottom-inert,
.m-userMenu,
.nav-overlay { display: none; }

@media (max-width: 1024px) {
  .content-grid {
    grid-template-columns: 1fr;
    min-height: 0;
  }
  .sidepanel { display: none; }
  .dashboard-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }

  .m-topbar {
    display: flex;
    position: sticky;
    top: 0;
    z-index: 2100;
    height: 56px;
    padding: 0 12px;
    background: var(--dark);
    border-bottom: 1px solid #2A2A2A;
    align-items: center;
    gap: 8px;
  }
  .m-topbar__logo {
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: #C9A84C;
    flex-shrink: 0;
    padding: 4px 6px;
    margin-right: 2px;
    border-radius: 10px;
    max-width: 38vw;
  }
  .m-topbar__logo:active {
    opacity: 0.85;
  }
  .m-topbar__logo-icon {
    font-size: 20px;
    line-height: 1;
  }
  .m-topbar__logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.05;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #F8F6F1;
  }
  .m-topbar__logo-text span:last-child {
    color: #C9A84C;
    font-size: 9px;
    margin-top: 1px;
  }
  .m-topbar__btn {
    width: 46px;
    height: 46px;
    border-radius: 10px;
    border: 1px solid #404040;
    background: #2A2A2A;
    color: #F8F6F1;
    flex-shrink: 0;
    cursor: pointer;
    box-shadow: 0 0 0 1px rgba(201, 168, 76, 0.12);
  }
  .m-topbar__btn:active {
    background: #333;
    border-color: rgba(201, 168, 76, 0.45);
  }
  .m-topbar__hamburger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    padding: 0;
  }
  .m-topbar__hamburger-line {
    display: block;
    width: 22px;
    height: 3px;
    border-radius: 2px;
    background: #F8F6F1;
    transition: transform 0.2s ease, opacity 0.2s ease;
    transform-origin: center;
  }
  body.nav-open .m-topbar__hamburger {
    gap: 0;
  }
  body.nav-open .m-topbar__hamburger-line:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
  }
  body.nav-open .m-topbar__hamburger-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
  }
  body.nav-open .m-topbar__hamburger-line:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
  }
  .m-topbar__title {
    flex: 1;
    text-align: center;
    color: #F8F6F1;
    font-size: clamp(15px, 3.8vw, 20px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
  }
  .m-topbar__avatar {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    border: 1px solid rgba(201, 168, 76, 0.5);
    background: rgba(201, 168, 76, 0.2);
    color: #F8F6F1;
    font-weight: 700;
    cursor: pointer;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }
  .m-userMenu {
    position: fixed;
    top: 60px;
    right: 12px;
    width: min(280px, calc(100vw - 24px));
    border-radius: 12px;
    padding: 12px;
    background: var(--dark);
    border: 1px solid #2A2A2A;
    z-index: 2200;
  }
  .m-userMenu--open { display: block; }
  .m-userMenu__name { color: #F8F6F1; font-weight: 700; }
  .m-userMenu__role { color: #B8B8B8; font-size: 12px; margin-top: 2px; }
  .m-userMenu__logoutBtn-inner {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
  }
  .m-userMenu__logoutIcon {
    display: block;
    flex-shrink: 0;
  }

  .app-shell {
    grid-template-columns: 1fr;
    /* m-topbar (56px) είναι εκτός· γέμισμα ύψους ώστε το 1fr του app-main να δουλεύει */
    min-height: calc(100dvh - 56px);
    min-height: calc(100vh - 56px);
  }
  /* Όταν το desktop topbar κρύβεται, μένουν 2 παιδιά· το παλιό "56px 1fr" έβαζε το περιεχόμενο σε γραμμή 56px. */
  .app-main {
    grid-template-rows: minmax(0, 1fr) auto;
    min-height: 0;
  }
  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(300px, 88vw);
    z-index: 2150;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: 8px 0 32px rgba(0, 0, 0, 0.35);
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
  }
  body.nav-open .sidebar { transform: translateX(0); }

  .nav-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 10, 0.48);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
    z-index: 2140;
  }
  body.nav-open .nav-overlay {
    opacity: 1;
    pointer-events: auto;
  }

  .topbar { display: none; }
  .workspace {
    padding: 14px;
    padding-bottom: calc(18px + env(safe-area-inset-bottom));
    min-height: 0;
  }
  .workspace__top { display: none; }

  .dashboard-header,
  .dashboard-stats,
  .dashboard-grid {
    display: none;
  }

  .dashboard-mobile {
    display: grid;
    gap: 12px;
  }

  .m-bottom-inert {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: calc(10px + env(safe-area-inset-bottom, 0px));
    z-index: 1200;
    background: var(--dark);
    border-top: 1px solid #2A2A2A;
    pointer-events: none;
  }

  .app-footer {
    margin-bottom: calc(6px + env(safe-area-inset-bottom, 0px));
    border-top-color: #2A2A2A;
    background: rgba(26, 26, 26, 0.04);
  }

  .legal-chatbot {
    bottom: calc(22px + env(safe-area-inset-bottom, 0px));
    right: 16px;
  }
}

@media (max-width: 768px) {
  .chatbot-panel {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 100dvh; /* dynamic viewport — συρρικνώνεται όταν ανοίγει keyboard */
    border-radius: 0;
  }
  .chatbot-toggle {
    width: 56px;
    height: 56px;
  }
  /* Το footer αφήνει χώρο για την home bar του iPhone */
  .chatbot-footer {
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  }
  /* Μεγαλύτερο textarea για ευκολότερη πληκτρολόγηση */
  .chatbot-footer textarea {
    font-size: 16px; /* αποφεύγει auto-zoom στο iOS */
    min-height: 44px;
  }
  /* Μεγαλύτερο κουμπί αποστολής */
  .chatbot-send {
    width: 48px;
    min-height: 44px;
    font-size: 20px;
  }
  /* Πιο compact header */
  .chatbot-header {
    padding: 12px 16px;
  }
  .chatbot-header h3 {
    font-size: 15px;
  }
  /* Suggestion buttons: scroll οριζόντια αντί wrap */
  .chat-suggestions {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    scrollbar-width: none;
  }
  .chat-suggestions::-webkit-scrollbar { display: none; }
  .suggestion-btn {
    flex-shrink: 0;
    white-space: nowrap;
  }
}

@media (min-width: 1025px) and (hover: hover) and (pointer: fine) {
  .mobile-only { display: none !important; }
}

/* Mobile dashboard/cards */
.dashboard-mobile { display: none; }
.m-hero {
  border: 1px solid #2A2A2A;
  border-radius: 10px;
  background: var(--dark);
  color: #F8F6F1;
  padding: 14px;
  position: relative;
}
.m-hero::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--gold), var(--gold-light), var(--gold));
}
.m-hero__kicker {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--gold);
}
.m-hero__title {
  margin: 6px 0 8px;
  font-size: 28px;
}
.m-hero__sub {
  margin: 0 0 12px;
  color: #BDB9AE;
  font-size: 12px;
}

.m-section {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--white);
  padding: 13px;
}
.m-section__head { margin-bottom: 8px; }
.m-section__title {
  margin: 0;
  font-size: 21px;
}
.m-case-list, .m-doc-list { display: grid; gap: 9px; }
.m-case-card {
  border: 1px solid #F0EDE8;
  border-radius: 9px;
  background: #FAFAF8;
  padding: 11px;
  text-align: left;
  cursor: pointer;
}
.m-case-card__top {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
}
.m-case-card__id { font-size: 10px; color: #949088; }
.m-case-card__status {
  font-size: 10px;
  border-radius: 30px;
  padding: 2px 8px;
  background: #FFF3CC;
  color: #7B4F00;
}
.m-case-card__title { font-size: 13px; font-weight: 500; }
.m-case-card__meta { margin-top: 4px; color: #8B877E; font-size: 11px; }
.m-doc-card {
  border: 1px solid #F0EDE8;
  border-radius: 9px;
  background: #FFF;
  padding: 10px 11px;
}
.m-doc-card__type { font-size: 13px; font-weight: 500; }
.m-doc-card__date { margin-top: 3px; font-size: 11px; color: #8B877E; }

.m-case-drawer-overlay,
.m-case-drawer { display: none; }

@media (max-width: 1024px) {
  .m-case-drawer-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 2250;
  }
  .m-case-drawer {
    display: block;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    transform: translateY(105%);
    transition: transform 0.22s ease;
    z-index: 2260;
    background: #FFF;
    border-top: 1px solid var(--border);
    border-radius: 16px 16px 0 0;
    padding: 10px 16px calc(20px + env(safe-area-inset-bottom)) 16px;
  }
  body.case-drawer-open .m-case-drawer-overlay {
    opacity: 1;
    pointer-events: auto;
  }
  body.case-drawer-open .m-case-drawer {
    transform: translateY(0);
  }

  .btn,
  .btn--ghost,
  .btn--dark,
  .btn--gold,
  .back-btn {
    min-height: 44px;
  }
  .workspace-title,
  .h1 {
    font-size: clamp(1.5rem, 5vw, 2rem);
    line-height: 1.2;
    overflow-wrap: anywhere;
  }
  .workspace-header,
  .dashboard-header {
    flex-wrap: wrap;
  }
}

.m-case-drawer__handle {
  width: 42px;
  height: 4px;
  border-radius: 3px;
  margin: 0 auto 10px auto;
  background: #DDD7CC;
}
.m-case-drawer__kicker {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 5px;
}
.m-case-drawer__title {
  margin: 0;
  font-size: 24px;
}

.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 4px;
  background: var(--white);
}

.lang-toggle__btn {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
  padding: 4px 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: auto;
  min-height: 32px;
  -webkit-tap-highlight-color: transparent;
  border-radius: 7px;
  transition: color 0.15s ease;
}
.lang-toggle__btn:focus {
  outline: none;
}
.lang-toggle__btn:focus-visible {
  outline: 2px solid rgba(0, 0, 0, 0.22);
  outline-offset: 1px;
}

/* Ίδιο πλαίσιο 3:2 για GR & GB — το GB (2:1) γεμίζει με meet. Φόντο πάντα στο slot ώστε η μη ενεργή σημαία να μην «χάνεται» στο λευκό pill. */
.lang-flag-slot {
  width: 32px;
  aspect-ratio: 3 / 2;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.055);
  box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  vertical-align: middle;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.lang-flag--inline {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 2px;
}

.lang-toggle__btn.is-active {
  color: var(--text);
  font-weight: 600;
}
.lang-toggle__btn.is-active .lang-flag-slot {
  background: rgba(0, 0, 0, 0.1);
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.1),
    0 0 0 1px rgba(201, 168, 76, 0.45);
}

@media (hover: hover) {
  .lang-toggle__btn:hover .lang-flag-slot {
    background: rgba(0, 0, 0, 0.085);
    box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.16);
    transform: scale(1.04);
  }
  .lang-toggle__btn.is-active:hover .lang-flag-slot {
    background: rgba(0, 0, 0, 0.115);
    box-shadow:
      inset 0 0 0 1px rgba(0, 0, 0, 0.12),
      0 0 0 1px rgba(201, 168, 76, 0.55);
  }
}
.lang-toggle__btn:active .lang-flag-slot {
  transform: scale(0.97);
}

.lang-toggle__sep {
  color: #d5d2ca;
  font-size: 10px;
  user-select: none;
  padding: 0 1px;
  opacity: 0.9;
}

.lang-toggle--mobile {
  border-color: #3A3A3A;
  background: #232323;
  padding: 3px 4px;
}

.lang-toggle--mobile .lang-toggle__btn {
  color: #AAA;
}

.lang-toggle--mobile .lang-toggle__btn:focus-visible {
  outline-color: rgba(248, 246, 241, 0.45);
}

.lang-toggle--mobile .lang-toggle__btn.is-active {
  color: #f8f6f1;
}
.lang-toggle--mobile .lang-flag-slot {
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.2);
}
.lang-toggle--mobile .lang-toggle__btn.is-active .lang-flag-slot {
  background: rgba(255, 255, 255, 0.14);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.22),
    0 0 0 1px rgba(201, 168, 76, 0.45);
}

@media (hover: hover) {
  .lang-toggle--mobile .lang-toggle__btn:hover .lang-flag-slot {
    background: rgba(255, 255, 255, 0.12);
    box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.28);
    transform: scale(1.04);
  }
  .lang-toggle--mobile .lang-toggle__btn.is-active:hover .lang-flag-slot {
    background: rgba(255, 255, 255, 0.16);
    box-shadow:
      inset 0 0 0 1px rgba(255, 255, 255, 0.26),
      0 0 0 1px rgba(201, 168, 76, 0.55);
  }
}
.lang-toggle--mobile .lang-toggle__sep {
  color: #5c5c5c;
}
@media (max-width: 1024px) {
  .dashboard-header {
    margin-top: 12px;
  }
}
.m-case-drawer__meta {
  margin-top: 6px;
  font-size: 13px;
  color: #7E7A71;
}

/* Ευρείες οθόνες: λίγο περισσότερο «αέρα» στο περιεχόμενο */
@media (min-width: 1280px) {
  .workspace {
    padding: 20px 28px 28px 32px;
  }
}
@media (min-width: 1536px) {
  .topbar {
    padding: 0 36px;
  }
  .workspace {
    padding: 24px 36px 36px 40px;
  }
}

/* ── Firm ID summary (tablet / κλικ) ───────────────────────────────────── */
button.sidebar__firm-id-code,
button.firm-id-open-btn--block {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 9px;
  line-height: 1.35;
  word-break: break-all;
  color: #C9A84C;
  opacity: 0.95;
}
button.sidebar__firm-id-code:hover,
button.firm-id-open-btn--block:hover {
  opacity: 1;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.firm-summary-modal {
  position: fixed;
  inset: 0;
  z-index: 10060;
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}
.firm-summary-modal.is-open {
  display: flex;
}
@media (min-width: 640px) {
  .firm-summary-modal {
    align-items: center;
  }
}
.firm-summary-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.48);
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
}
.firm-summary-modal__panel {
  position: relative;
  background: #faf9f7;
  border: 1px solid #e8e5de;
  border-radius: 14px;
  padding: 1.2rem 1.35rem 1.35rem;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.22);
}
.firm-summary-modal__title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 0.75rem;
  color: #1a1a1a;
}
.firm-summary-modal__row {
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 0 0 0.5rem;
  color: #333;
}
.firm-summary-modal__row strong {
  color: #1a1a1a;
}
.firm-summary-modal__mono {
  font-family: ui-monospace, monospace;
  font-size: 0.72rem;
  word-break: break-all;
  color: #7b5800;
  margin: 0.35rem 0 0;
}
.firm-summary-modal__close {
  margin-top: 1rem;
  width: 100%;
  padding: 0.65rem;
  border: none;
  border-radius: 8px;
  background: #1a1a1a;
  color: #f8f6f1;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
}
.firm-summary-modal__close:hover {
  background: #333;
}

.m-userMenu__firmid-btn {
  font-family: ui-monospace, monospace;
  font-size: 9px;
  color: #c9a84c;
  word-break: break-all;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  line-height: 1.35;
}
.m-userMenu__firmid-btn:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Scrollbars */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-thumb { background: #DDD; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #CCC; }

/* ════════════════════════════════════════════════════════════════
   THEME SYSTEM
   Αλλαγή χρωμάτων: αλλάζε μόνο τα CSS variables
   Per-firm branding: άλλαξε --firm-primary / --firm-primary-light
   ════════════════════════════════════════════════════════════════ */
:root {
  /* ── Firm brand (αλλάζει ανά γραφείο) ─── */
  --firm-primary:       #C9A84C;
  --firm-primary-light: #E2C97A;
  --firm-primary-dim:   rgba(201,168,76,.14);
  --firm-primary-glow:  rgba(201,168,76,.07);
  --firm-primary-border:rgba(201,168,76,.28);

  /* ── LIGHT theme (default) ─────────────── */
  --dk-base:    #F8F6F1;
  --dk-surface: #FFFFFF;
  --dk-card:    #FFFFFF;
  --dk-card2:   #FAFAF8;
  --dk-hover:   #F5F3EF;
  --dk-border:  #EAE8E3;
  --dk-border2: #D5D0C8;
  --dk-text:    #1A1A1A;
  --dk-sub:     #666666;
  --dk-muted:   #AAAAAA;
  --dk-green:   #1A7F4B;
  --dk-red:     #B91C1C;
  --dk-blue:    #1E5FAD;
}

/* ── DARK theme — χρώματα από το original sidebar/sidepanel ── */
html[data-theme="dark"] {
  --dk-base:    #111111;
  --dk-surface: #1A1A1A;
  --dk-card:    #222222;
  --dk-card2:   #1D1D1D;
  --dk-hover:   #2A2A2A;
  --dk-border:  #2A2A2A;
  --dk-border2: #333333;
  --dk-text:    #F8F6F1;
  --dk-sub:     #888888;
  --dk-muted:   #555555;
  --dk-green:   #2ECC71;
  --dk-red:     #E74C3C;
  --dk-blue:    #5B8DEF;
}

/* ── Legacy var aliases (χρησιμοποιούνται στον παλιό κώδικα) ── */
:root, html[data-theme="dark"] {
  --bg:     var(--dk-base);
  --white:  var(--dk-card);
  --border: var(--dk-border);
  --text:   var(--dk-text);
  --muted:  var(--dk-sub);
  --gold:   var(--firm-primary);
  --dark:   var(--dk-surface);
}

/* ── Dark rules — όλα κάτω από [data-theme="dark"] ── */
html[data-theme="dark"] body {
  background: var(--dk-base);
  color: var(--dk-text);
}

/* ── Scrollbars (dark) ───────────────────────────── */
::-webkit-scrollbar-track { background: var(--dk-surface); }
::-webkit-scrollbar-thumb { background: var(--dk-border2); }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.18); }

/* ── Sidebar ──────────────────────────────────────── */
.sidebar {
  background: var(--dk-surface);
  border-right: 1px solid var(--dk-border);
}
.sidebar__accent {
  background: linear-gradient(90deg, var(--firm-primary), var(--firm-primary-light), var(--firm-primary));
}
.sidebar__brand, .sidebar__firm-id,
.sidebar__usage, .sidebar__user {
  border-color: var(--dk-border);
}
.sidebar__usage-bar { background: var(--dk-border2); }
.sidebar__usage-label, .sidebar__usage-detail,
.sidebar__firm-id-label { color: var(--dk-muted); }
.sidebar__role { color: var(--dk-muted); }
.sidebar__username { color: var(--dk-text); }
.sidebar__item { color: var(--dk-sub); border-left-color: transparent; }
.sidebar__item:hover { background: var(--firm-primary-dim); color: var(--dk-text); border-left-color: var(--firm-primary-border); }
.sidebar__item.is-active { background: var(--firm-primary-dim); color: var(--firm-primary); border-left-color: var(--firm-primary); }

/* Section labels in sidebar */
.sidebar__nav-section {
  font-size: 9px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--dk-muted);
  padding: 14px 24px 4px;
}

/* ── Topbar ───────────────────────────────────────── */
.topbar {
  background: var(--dk-surface);
  border-bottom: 1px solid var(--dk-border);
}
.topbar__title { color: var(--dk-text); }
.topbar-logo__line--emph { color: var(--dk-text); }

/* ── Workspace / Main content ─────────────────────── */
.workspace__top { background: var(--dk-surface); border-bottom: 1px solid var(--dk-border); }
.search { background: var(--dk-card); border-color: var(--dk-border); }
.search__input { background: transparent; color: var(--dk-text); }
.search__input::placeholder { color: var(--dk-muted); }
.search:focus-within { border-color: var(--firm-primary); }

/* ── Panels / Cards ───────────────────────────────── */
.panel, .panel--wide {
  background: var(--dk-card);
  border: 1px solid var(--dk-border);
  box-shadow: 0 2px 12px rgba(0,0,0,.3);
}
.notif-panel {
  background: var(--dk-card2) !important;
  border-color: var(--dk-border) !important;
}
.notif-panel__header {
  background: var(--dk-card) !important;
  border-color: var(--dk-border) !important;
}
.notif-panel__title { color: var(--dk-text) !important; }

/* ── Tables ───────────────────────────────────────── */
table { color: var(--dk-text); }
th { color: var(--dk-muted); border-color: var(--dk-border); }
td { border-color: var(--dk-border); color: var(--dk-text); }
tr:hover td { background: var(--dk-hover); }
.table-wrap { background: var(--dk-card); border-color: var(--dk-border); }

/* ── Forms / Inputs ───────────────────────────────── */
.input, input[type="text"], input[type="email"],
input[type="password"], input[type="number"],
input[type="search"], input[type="url"],
select, textarea {
  background: var(--dk-card2) !important;
  border-color: var(--dk-border2) !important;
  color: var(--dk-text) !important;
}
.input:focus, input:focus, select:focus, textarea:focus {
  border-color: var(--firm-primary) !important;
  outline: none;
}
input::placeholder, textarea::placeholder { color: var(--dk-muted) !important; }
select option { background: var(--dk-card2); color: var(--dk-text); }
.label { color: var(--dk-sub); }

/* ── Buttons ──────────────────────────────────────── */
.btn {
  background: var(--firm-primary);
  color: #000;
  border-color: var(--firm-primary);
}
.btn:hover { background: var(--firm-primary-light); box-shadow: 0 0 16px var(--firm-primary-dim); }
.btn--ghost {
  background: transparent;
  color: var(--dk-sub);
  border-color: var(--dk-border2);
}
.btn--ghost:hover { border-color: var(--firm-primary-border); color: var(--dk-text); }
.btn--dark {
  background: var(--firm-primary);
  color: #000;
  border: none;
}

/* ── Dashboard cards ──────────────────────────────── */
.dashboard-stat-card, .m-hero {
  background: var(--dk-card) !important;
  border-color: var(--dk-border) !important;
  color: var(--dk-text) !important;
}
.m-hero { border: 1px solid var(--dk-border) !important; }
.m-section__title, .workspace-title { color: var(--dk-text); }
.workspace-kicker { color: var(--firm-primary); }

/* ── Login / Signup pages ─────────────────────────── */
.login-card, .signup-card, .onboard-card {
  background: var(--dk-card) !important;
  border-color: var(--dk-border) !important;
  box-shadow: 0 8px 40px rgba(0,0,0,.5) !important;
}
.onboard-title, .login-title { color: var(--dk-text) !important; }
.onboard-sub { color: var(--dk-sub) !important; }

/* ── Sidepanel (right panel) ──────────────────────── */
.sidepanel { background: var(--dk-surface); border-left: 1px solid var(--dk-border); }
.sidepanel__title, .sidepanel__label { color: var(--dk-muted); }
.sidepanel__value { color: var(--dk-text); }
.sidepanel__card { background: var(--dk-card); border-color: var(--dk-border); }
.sidepanel__card--dark { background: linear-gradient(135deg, #1A1507, #0F0E08); border-color: var(--firm-primary-border); }
.sidepanel__aiKicker { color: var(--firm-primary); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.sidepanel__quicklink { color: var(--dk-text); }
.sidepanel__quicklink:hover { background: var(--dk-hover); }
.sidepanel__bot { border-color: var(--firm-primary-border); }
.sidepanel__bot-header { background: linear-gradient(135deg, #1A1507, #0F0E08); border-bottom-color: var(--firm-primary); }
.sidepanel__aiTitle { color: var(--dk-text); font-size: 15px; font-weight: 700; margin: 4px 0; }
.sidepanel__aiText { color: var(--dk-sub); font-size: 12px; line-height: 1.5; }

/* ── Alerts (keep green/red, just tweak) ──────────── */
.alert { background: var(--dk-card2); border-color: var(--dk-border); color: var(--dk-text); }
.alert--error { background: rgba(231,76,60,.12); border-color: rgba(231,76,60,.3); color: #F1948A; }
.alert--success { background: rgba(46,204,113,.1); border-color: rgba(46,204,113,.25); color: #82E0AA; }
.alert-ok { background: rgba(46,204,113,.1); border-color: rgba(46,204,113,.25); color: #82E0AA; }
.alert-err { background: rgba(231,76,60,.12); border-color: rgba(231,76,60,.3); color: #F1948A; }
.flash--ok { background: rgba(46,204,113,.1); border-color: rgba(46,204,113,.25); color: #82E0AA; }
.flash--err { background: rgba(231,76,60,.12); border-color: rgba(231,76,60,.3); color: #F1948A; }

/* ── Status badges ────────────────────────────────── */
.status-pill--active { background: rgba(46,204,113,.12); color: var(--dk-green); border-color: rgba(46,204,113,.25); }
.status-pill--pending { background: var(--firm-primary-dim); color: var(--firm-primary); border-color: var(--firm-primary-border); }
.status-pill--other { background: var(--dk-hover); color: var(--dk-sub); border-color: var(--dk-border2); }

/* ── Chatbot (floating) ───────────────────────────── */
.chatbot-panel { background: var(--dk-card); border-color: var(--firm-primary-border); }
.chatbot-header { background: linear-gradient(135deg,#1A1507,#0F0E08); border-color: var(--firm-primary-border); }
.chatbot-messages { background: var(--dk-base); }
.chat-message--bot .chat-bubble { background: var(--dk-card); border-color: var(--dk-border); color: var(--dk-text); }
.chatbot-footer { background: var(--dk-card); border-color: var(--dk-border); }
.chatbot-footer textarea { background: var(--dk-card2); border-color: var(--dk-border2); color: var(--dk-text); }
.chatbot-footer textarea::placeholder { color: var(--dk-muted); }
.chatbot-send { background: var(--firm-primary); color: #000; }
.chatbot-send:hover { background: var(--firm-primary-light); }
.chat-suggestions { scrollbar-width: none; }
.suggestion-btn { background: var(--dk-card2); border-color: var(--dk-border); color: var(--dk-sub); }
.suggestion-btn:hover { border-color: var(--firm-primary-border); color: var(--firm-primary); background: var(--firm-primary-glow); }
.chatbot-disclaimer { background: var(--dk-card2); color: var(--dk-muted); border-left-color: var(--firm-primary); }
.chatbot-toggle { background: var(--dk-surface); border-color: var(--firm-primary); color: var(--firm-primary); }

/* ── Analog clock in dashboard ────────────────────── */
.hero-clock-analog { display: flex; align-items: center; gap: 14px; }
#analogClock { display: block; flex-shrink: 0; }

/* ── Misc overrides ───────────────────────────────── */
.muted { color: var(--dk-sub); }
.btn--full { width: 100%; }
.audio-tools { background: var(--dk-card2); border-color: var(--dk-border); }
.audio-tools__title { color: var(--dk-text); }
.dropzone { background: var(--dk-card2); border-color: var(--dk-border); color: var(--dk-sub); }
.dropzone--active { border-color: var(--firm-primary); background: var(--firm-primary-glow); }
.how-it-works { background: var(--dk-card2); border-color: var(--dk-border); color: var(--dk-sub); }
.how-it-works strong { color: var(--dk-text); }
.tab-btn { background: var(--dk-card2); border-color: var(--dk-border); color: var(--dk-sub); }
.tab-btn.active { background: var(--firm-primary); color: #000; border-color: var(--firm-primary); }
.admin-tab { background: var(--dk-card); border-color: var(--dk-border); color: var(--dk-sub); }
.admin-tab.is-active { background: var(--dk-text); color: var(--dk-base); border-color: var(--dk-text); }
code { background: var(--dk-card2); color: var(--firm-primary); border-radius: 4px; padding: 1px 5px; border: 1px solid var(--dk-border); }
hr { border-color: var(--dk-border); }
.info-pill { background: rgba(91,141,239,.12); border-color: rgba(91,141,239,.25); color: var(--dk-blue); }
.ls-msg.ok { background: rgba(46,204,113,.1); border-color: rgba(46,204,113,.25); color: #82E0AA; padding: .5rem .85rem; border-radius: 7px; }
.ls-msg.err { background: rgba(231,76,60,.12); border-color: rgba(231,76,60,.3); color: #F1948A; }

/* ── App footer ───────────────────────────────────── */
.app-footer { background: var(--dk-surface); border-top: 1px solid var(--dk-border); color: var(--dk-muted); }

/* ── Theme toggle button ──────────────────────────── */
.theme-toggle-btn {
  width: 34px; height: 34px;
  border-radius: 8px;
  border: 1px solid var(--dk-border2);
  background: var(--dk-card2);
  color: var(--dk-sub);
  font-size: 16px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
  flex-shrink: 0;
}
.theme-toggle-btn:hover {
  border-color: var(--firm-primary-border);
  color: var(--firm-primary);
  background: var(--firm-primary-dim);
}

/* ═══════════════════════════════════════════════════════════════
   MOBILE & TABLET — DARK THEME + MODERN REDESIGN
   Breakpoints: ≤1024px tablet/mobile, ≤767px phone
   Desktop (≥1025px) left untouched.
═══════════════════════════════════════════════════════════════ */

/* ── Mobile cards: dark theme overrides ──────────────── */
.m-section {
  background: var(--dk-card);
  border-color: var(--dk-border);
  border-radius: 14px;
  padding: 16px;
}
.m-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.m-section__title { color: var(--dk-text); font-size: 18px; }
.m-section__link {
  font-size: 12px;
  color: var(--firm-primary);
  text-decoration: none;
  font-weight: 600;
}
.m-section__link:hover { opacity: .8; }

.m-case-card {
  background: var(--dk-card2);
  border-color: var(--dk-border);
  border-radius: 10px;
  padding: 12px 13px;
  transition: background .15s;
}
.m-case-card:active { background: var(--dk-hover); }
.m-case-card__title { color: var(--dk-text); font-size: 14px; font-weight: 600; }
.m-case-card__id { color: var(--dk-muted); }
.m-case-card__status {
  background: var(--firm-primary-dim);
  color: var(--firm-primary);
  border-radius: 30px;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 600;
}
.m-case-card__meta { color: var(--dk-sub); font-size: 12px; }

.m-doc-card {
  background: var(--dk-card2);
  border: 1px solid var(--dk-border);
  border-radius: 10px;
  padding: 11px 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.m-doc-card__type { color: var(--dk-text); font-size: 13px; font-weight: 600; }
.m-doc-card__date { color: var(--dk-muted); font-size: 11px; }

/* ── Case drawer: dark theme ─────────────────────────── */
.m-case-drawer {
  background: var(--dk-card) !important;
  border-top: 1px solid var(--dk-border) !important;
}
.m-case-drawer__handle { background: var(--dk-border2); }
.m-case-drawer__title { color: var(--dk-text); }
.m-case-drawer__meta { color: var(--dk-sub); }

/* ── Mobile hero: enhanced ───────────────────────────── */
.m-hero {
  background: linear-gradient(145deg, #1A1507 0%, #0F0E08 60%, #13120A 100%);
  border-color: var(--firm-primary-border);
  border-radius: 16px;
  padding: 20px 16px 16px;
}
.m-hero__kicker { color: var(--firm-primary); font-weight: 700; letter-spacing: .12em; }
.m-hero__title { font-size: clamp(26px, 7vw, 34px); margin: 8px 0 6px; color: #F8F6F1; }
.m-hero__sub { color: #9A9488; font-size: 13px; margin-bottom: 16px; }
.m-hero__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 0;
}

/* ── Mobile quick-stats row ──────────────────────────── */
.m-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.m-stat {
  background: var(--dk-card);
  border: 1px solid var(--dk-border);
  border-radius: 12px;
  padding: 12px 10px;
  text-align: center;
}
.m-stat__val {
  font-size: 22px;
  font-weight: 700;
  color: var(--firm-primary);
  line-height: 1;
}
.m-stat__label {
  font-size: 10px;
  color: var(--dk-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-top: 4px;
}

/* ── Tablet improvements (768–1024px) ────────────────── */
@media (min-width: 640px) and (max-width: 1024px) {
  .m-case-list, .m-doc-list {
    grid-template-columns: repeat(2, 1fr);
  }
  .dashboard-mobile {
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
  }
  .m-stats { grid-template-columns: repeat(3, 1fr); }
  .m-hero__title { font-size: 38px; }
}

/* ── Mobile topbar: Inter font + modern spacing ──────── */
@media (max-width: 1024px) {
  .m-topbar {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: rgba(26, 26, 26, 0.96);
  }
  .workspace { padding: 12px; gap: 12px; }
  .dashboard-mobile { gap: 10px; }
}
