/* Panha — OBOR AI Office — Global Styles */

* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy: #1C3F94;
  --navy-light: #2a50b0;
  --gold: #FDBB30;
  --white: #ffffff;
  --bg: #f0f2f8;
  --text: #1a2540;
  --text-muted: #6b7a99;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
  --sidebar-w: 200px;
  --panel-w: 200px;
  --top-h: 52px;
  --upper-h: 55vh;
}

body {
  font-family: Verdana, Geneva, sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── TOPBAR ── */

.topbar {
  height: var(--top-h);
  background: var(--navy);
  border-bottom: 3px solid var(--gold);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 14px;
  flex-shrink: 0;
}

.topbar-logo { height: 26px; width: auto; }
.topbar-brand { font-size: 17px; font-weight: 700; color: var(--white); }
.topbar-brand span { color: var(--gold); }
.topbar-sub { font-size: 10px; color: rgba(255,255,255,0.5); }

.topbar-user {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--navy);
  font-weight: 700;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.topbar-username {
  font-size: 12px;
  color: var(--white);
  font-weight: 600;
}

.logout-btn {
  margin-left: 12px;
  padding: 5px 12px;
  border: 1.5px solid rgba(255,255,255,0.3);
  border-radius: 14px;
  background: transparent;
  color: rgba(255,255,255,0.7);
  font-family: Verdana, sans-serif;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.logout-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
}

/* ── UPPER ZONE ── */

.upper {
  height: var(--upper-h);
  min-height: 80px;
  max-height: 70vh;
  display: flex;
  flex-shrink: 0;
  border-bottom: none;
  overflow: hidden;
}

/* ── SIDEBAR ── */

.sidebar {
  width: var(--sidebar-w);
  background: var(--navy);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
}


.sidebar-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  cursor: pointer;
  font-size: 11px;
  color: rgba(255,255,255,0.6);
  border-left: 3px solid transparent;
  transition: all 0.15s;
}

.sidebar-item:hover {
  background: rgba(255,255,255,0.07);
  color: var(--white);
}

.sidebar-item.active {
  background: rgba(253,187,48,0.12);
  color: var(--white);
  border-left-color: var(--gold);
  font-weight: 600;
}

.sidebar-icon { font-size: 13px; width: 16px; text-align: center; }

.sidebar-sep {
  padding: 8px 0 2px 14px;
  font-size: 8px;
  color: rgba(255,255,255,0.3);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
}

/* ── HISTORY PANEL ── */

.history-panel {
  flex: 1;
  background: var(--white);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.history-header {
  padding: 10px 16px 6px;
  border-bottom: 1px solid #eef0f6;
  display: flex;
  align-items: center;
  gap: 8px;
}

.history-title {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.history-module-badge {
  background: rgba(28,63,148,0.1);
  color: var(--navy);
  border-radius: 8px;
  padding: 1px 8px;
  font-size: 10px;
  font-weight: 700;
}

.history-table-wrap { flex: 1; overflow-y: auto; }

table.htable {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.htable th {
  padding: 4px 10px;
  text-align: left;
  font-size: 9px;
  font-weight: 600;
  color: var(--text-muted);
  background: #f8f9fc;
  position: sticky;
  top: 0;
}

.htable td {
  padding: 5px 10px;
  border-top: 1px solid #f0f2f8;
  color: var(--text);
  vertical-align: middle;
}

.htable tr:hover td { background: #f8f9fc; }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
}

.badge-success { background: #dcfce7; color: #16a34a; }
.badge-pending { background: #fef9c3; color: #a16207; }
.badge-progress { background: #dbeafe; color: #1d4ed8; }
.badge-cancelled { background: #f1f5f9; color: #64748b; }

.row-actions {
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.15s;
}

.htable tr:hover .row-actions { opacity: 1; }

.row-btn {
  width: 22px; height: 22px;
  border: none;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.row-btn:hover { background: #f0f3fa; color: var(--navy); }
.delete-btn:hover { background: #fef2f2; color: var(--danger); }

.history-empty {
  padding: 20px 16px;
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
}

/* ── REMINDERS PANEL ── */

.reminders-panel {
  width: var(--panel-w);
  background: var(--white);
  border-left: 1px solid #e2e6f0;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
}

.reminders-header {
  padding: 10px 14px 6px;
  border-bottom: 1px solid #eef0f6;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.reminders-title {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.rem-count {
  background: var(--danger);
  color: white;
  border-radius: 10px;
  padding: 1px 6px;
  font-size: 10px;
}

.reminder-card {
  margin: 6px 10px;
  border-radius: 6px;
  padding: 8px 10px;
  border-left: 3px solid;
}

.reminder-card.overdue { background: #fef2f2; border-color: var(--danger); }
.reminder-card.high    { background: #fffbeb; border-color: var(--warning); }
.reminder-card.normal  { background: #f0f9ff; border-color: var(--info); }

.rem-title { font-size: 11px; font-weight: 700; color: var(--text); margin-bottom: 3px; }
.rem-meta  { font-size: 9px; color: var(--text-muted); display: flex; align-items: center; gap: 5px; }
.rem-status { font-size: 9px; font-weight: 700; text-transform: uppercase; }
.s-overdue { color: var(--danger); }

.rem-category {
  font-size: 8px;
  font-weight: 600;
  text-transform: uppercase;
  padding: 1px 5px;
  border-radius: 6px;
  margin-left: auto;
}

.rem-category.cat-compliance { background: #fef2f2; color: var(--danger); }
.rem-category.cat-financial  { background: #fffbeb; color: var(--warning); }
.rem-category.cat-commercial { background: #f3e8ff; color: #9333ea; }
.rem-category.cat-internal   { background: #f0f9ff; color: var(--info); }
.rem-category.cat-personal   { background: #f1f5f9; color: var(--text-muted); }
.s-high    { color: var(--warning); }

/* ── LOWER ZONE (chat) ── */

.lower {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
}

.new-chat-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: transparent;
  border: 1.5px solid #d0d6e8;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  flex-shrink: 0;
  color: var(--navy);
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
}

.new-chat-btn:hover {
  border-color: var(--navy);
  background: #f0f3fa;
}

.messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.msg { display: flex; gap: 8px; max-width: 72%; }
.msg.user { align-self: flex-end; flex-direction: row-reverse; }

.msg-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--white);
  font-weight: 700;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.msg.user .msg-avatar { background: var(--gold); color: var(--navy); }

.msg-bubble {
  background: var(--white);
  border-radius: 10px 10px 10px 2px;
  padding: 9px 13px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  border: 1px solid #e8eaf2;
  white-space: pre-wrap;
}

.msg.user .msg-bubble {
  background: var(--navy);
  color: var(--white);
  border-radius: 10px 10px 2px 10px;
  border-color: var(--navy);
}

.typing-indicator { display: flex; align-items: center; gap: 4px; padding: 8px 12px; }

.typing-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: bounce 1.2s infinite;
}

.typing-dot:nth-child(2) { animation-delay: .2s; }
.typing-dot:nth-child(3) { animation-delay: .4s; }

@keyframes bounce { 0%,60%,100%{transform:translateY(0)} 30%{transform:translateY(-5px)} }

.quick-actions {
  padding: 8px 20px;
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  background: var(--white);
  border-top: 1px solid #e2e6f0;
  flex-shrink: 0;
}

.quick-btn {
  padding: 5px 11px;
  border-radius: 14px;
  border: 1.5px solid #d0d6e8;
  background: var(--white);
  font-size: 11px;
  color: var(--navy);
  cursor: pointer;
  font-family: Verdana, sans-serif;
  font-weight: 600;
  transition: all 0.15s;
}

.quick-btn:hover { border-color: var(--navy); background: #f0f3fa; }

.input-bar {
  padding: 10px 20px;
  background: var(--white);
  border-top: 1px solid #e2e6f0;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-shrink: 0;
}

.input-bar textarea {
  flex: 1;
  padding: 9px 14px;
  border: 1.5px solid #d0d6e8;
  border-radius: 20px;
  font-size: 12px;
  font-family: Verdana, sans-serif;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
  resize: none;
  overflow-y: hidden;
  min-height: 36px;
  max-height: 120px;
  line-height: 1.4;
}

.input-bar textarea:focus { border-color: var(--navy); }
.input-bar textarea::placeholder { color: #aab0c5; }

/* ── ATTACH BUTTON ── */

.attach-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: transparent;
  border: 1.5px solid #d0d6e8;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  flex-shrink: 0;
  color: var(--navy);
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
}

.attach-btn:hover {
  border-color: var(--navy);
  background: #f0f3fa;
}

/* ── FILE PREVIEW ── */

.file-preview {
  padding: 6px 20px;
  background: var(--white);
  border-top: 1px solid #e2e6f0;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.file-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: #f0f3fa;
  border: 1px solid #d0d6e8;
  border-radius: 14px;
  font-size: 11px;
  color: var(--navy);
  font-weight: 600;
}

.file-chip-remove {
  cursor: pointer;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1;
}

.file-chip-remove:hover { color: var(--danger); }

.send-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--navy);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  flex-shrink: 0;
}

.send-btn:hover { background: var(--navy-light); }
.send-btn svg { width: 15px; height: 15px; fill: white; }

/* ── RESIZER ── */

.resizer {
  height: 6px;
  background: #e2e6f0;
  cursor: ns-resize;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  user-select: none;
}

.resizer:hover,
.resizer.dragging { background: var(--gold); }

.resizer-handle {
  width: 32px; height: 3px;
  border-radius: 2px;
  background: #b0b8d0;
}

.resizer:hover .resizer-handle,
.resizer.dragging .resizer-handle { background: var(--navy); }

/* ── DRIVE ACTION ── */

.drive-action {
  padding: 4px 20px;
}

.drive-action-bar {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 10px;
  font-size: 11px;
  flex-wrap: wrap;
}

.drive-label {
  font-weight: 700;
  color: var(--navy);
}

.drive-btn {
  padding: 5px 14px;
  border-radius: 14px;
  border: none;
  background: var(--navy);
  color: var(--white);
  font-family: Verdana, sans-serif;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.drive-btn:hover { background: var(--navy-light); }
.drive-btn:disabled { opacity: 0.6; cursor: default; }

.drive-success {
  background: #dcfce7;
  border-color: #86efac;
  color: #16a34a;
  font-weight: 700;
}

.drive-error {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #dc2626;
  font-weight: 700;
}

/* ── CHAT TABLES ── */

.chat-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  margin: 6px 0;
}

.chat-table th {
  background: #f0f3fa;
  font-weight: 700;
  color: var(--navy);
  padding: 4px 10px;
  text-align: left;
  border-bottom: 2px solid #d0d6e8;
}

.chat-table td {
  padding: 4px 10px;
  border-bottom: 1px solid #e8eaf2;
  color: var(--text);
}

.chat-table tr:hover td { background: #f8f9fc; }

/* ── ACTION CARDS ── */

.action-card-wrap {
  padding: 4px 20px;
}

.action-card {
  background: var(--white);
  border: 1.5px solid #d0d6e8;
  border-radius: 10px;
  max-width: 420px;
  overflow: hidden;
}

.action-card-header {
  padding: 8px 14px;
  background: #f8f9fc;
  font-size: 12px;
  font-weight: 700;
  color: var(--navy);
  border-bottom: 1px solid #e8eaf2;
}

.action-card-body {
  padding: 10px 14px;
  font-size: 11px;
  line-height: 1.6;
  color: var(--text);
}

.action-card-buttons {
  padding: 8px 14px;
  border-top: 1px solid #e8eaf2;
  display: flex;
  gap: 8px;
  align-items: center;
}

.category-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
  user-select: none;
}

.category-badge.category-compliance { background: #fef2f2; color: var(--danger); border: 1px solid var(--danger); }
.category-badge.category-financial  { background: #fffbeb; color: var(--warning); border: 1px solid var(--warning); }
.category-badge.category-commercial { background: #f3e8ff; color: #9333ea; border: 1px solid #9333ea; }
.category-badge.category-internal   { background: #f0f9ff; color: var(--info); border: 1px solid var(--info); }

.category-hint {
  font-size: 9px;
  color: var(--text-muted);
}

.action-confirm-btn {
  padding: 6px 16px;
  border-radius: 14px;
  border: none;
  background: var(--navy);
  color: var(--white);
  font-family: Verdana, sans-serif;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.action-confirm-btn:hover { background: var(--navy-light); }

.action-edit-btn {
  padding: 6px 16px;
  border-radius: 14px;
  border: 1.5px solid #d0d6e8;
  background: transparent;
  color: var(--text-muted);
  font-family: Verdana, sans-serif;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.action-edit-btn:hover {
  border-color: var(--navy);
  color: var(--navy);
}

.action-loading { font-size: 11px; color: var(--text-muted); }
.action-success { font-size: 11px; color: #16a34a; font-weight: 600; }
.action-error { font-size: 11px; color: var(--danger); font-weight: 600; }

.action-card.action-done {
  border-color: #86efac;
  background: #f0fdf4;
}

/* ── ACTION GROUPS (multiple actions proposed in one turn) ── */

.action-group-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 4px 0;
}

.action-group-all-bar {
  padding: 0 20px 4px;
}

.action-confirm-all-btn {
  padding: 7px 18px;
  border-radius: 14px;
  border: none;
  background: var(--navy);
  color: var(--white);
  font-family: Verdana, sans-serif;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}

.action-confirm-all-btn:hover { background: var(--navy-light); }
.action-confirm-all-btn:disabled { opacity: 0.6; cursor: default; }

/* ── MODULE TAG (chat bubbles) ── */

.module-tag {
  display: inline-block;
  background: rgba(28,63,148,0.1);
  color: var(--navy);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 9px;
  font-weight: 700;
  margin-right: 4px;
  vertical-align: middle;
}
