/* ==========================================================================
   Kerio Webmail Client - Gmail Exact Official Theme & Compact Line Spacing
   ========================================================================== */

:root {
  --font-family: 'Segoe UI', 'Google Sans', 'Roboto', -apple-system, sans-serif;

  /* Color Palette */
  --bg-app: #f3f4f6;
  --bg-sidebar: #f8fafc;
  --bg-card: #ffffff;
  --bg-search: #eaf1fb;
  --bg-search-focus: #ffffff;
  
  --bg-active-pill: #c2e7ff;
  --text-active-pill: #001d35;
  --bg-hover-pill: #e9eef6;
  
  --bg-compose: #c2e7ff;
  --text-compose: #001d35;
  --hover-compose: #b3dcfc;
  
  --bg-unread-row: #ffffff;
  --bg-read-row: #f8fafc;
  --bg-hover-row: #edf2fa;

  --text-primary: #1f1f1f;
  --text-secondary: #444746;
  --text-muted: #5e6266;

  --accent-blue: #0b57d0;
  --accent-blue-hover: #0842a0;
  --border-subtle: #e1e3e1;

  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 9999px;

  --shadow-search: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-card: 0 1px 3px 0 rgba(60,64,67,0.15);
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-app);
  color: var(--text-primary);
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  font-size: 14px;
  line-height: 1.35;
}

/* Header Navbar */
.gmail-topbar {
  height: 52px;
  background-color: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  gap: 16px;
  flex-shrink: 0;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 260px;
}

.icon-btn-ghost {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: #444746;
  font-size: 19px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, opacity 0.15s;
}

.icon-btn-ghost i {
  color: #444746;
}

.icon-btn-ghost:hover:not(:disabled) {
  background-color: var(--bg-hover-pill);
}

.icon-btn-ghost:disabled {
  opacity: 0.35 !important;
  cursor: default !important;
  pointer-events: none;
}

.icon-btn-ghost:disabled i {
  color: #a0a0a0 !important;
}

.gmail-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 19px;
  font-weight: 600;
  color: #0b57d0;
  text-decoration: none;
  user-select: none;
}

.gmail-logo i {
  color: #ea4335;
  font-size: 22px;
}

.topbar-center {
  flex: 1;
  max-width: 680px;
}

.gmail-search-box {
  position: relative;
  width: 100%;
}

.gmail-search-box input {
  width: 100%;
  height: 38px;
  background-color: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 0 38px 0 40px;
  font-size: 14px;
  color: var(--text-primary);
  outline: none;
  transition: background 0.2s, border-color 0.2s;
}

.gmail-search-box input:focus {
  background-color: #ffffff;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 2px rgba(11, 87, 208, 0.15);
}

.gmail-search-box .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  font-size: 18px;
  pointer-events: none;
}

.btn-clear-search {
  position: absolute;
  right: 38px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #5f6368;
  font-size: 18px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.btn-clear-search:hover {
  background-color: rgba(60, 64, 67, 0.12);
  color: #1f1f1f;
}

.gmail-search-box .filter-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  font-size: 18px;
  cursor: pointer;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-profile-circle {
  width: 34px;
  height: 34px;
  background-color: #0b57d0;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}

.view-mode-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #0b57d0;
  cursor: pointer;
  transition: background 0.15s;
}

.view-mode-toggle:hover {
  background: #e2e8f0;
}

/* Main App Layout Body */
.gmail-app-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Outlook Left Sidebar */
.gmail-sidebar {
  width: 270px;
  background-color: #f8fafc;
  border-right: 1px solid #e2e8f0;
  padding: 10px;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.btn-gmail-compose {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  background-color: #0b57d0;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(11, 87, 208, 0.2);
  transition: background 0.2s;
  margin-bottom: 12px;
  width: 100%;
}

.btn-gmail-compose:hover {
  background-color: #0842a0;
}

/* Outlook Multi-Account Folder Tree */
.outlook-folder-tree {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  flex: 1;
}

.account-tree-group {
  display: flex;
  flex-direction: column;
}

.account-tree-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
  padding: 4px 4px;
  cursor: pointer;
  user-select: none;
  word-break: break-all;
}

.account-tree-header i {
  font-size: 14px;
  color: #64748b;
  transition: transform 0.15s;
}

.account-tree-header.collapsed i {
  transform: rotate(-90deg);
}

.tree-folder-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding-left: 10px;
}

.tree-folder-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 13.5px;
  color: #334155;
  cursor: pointer;
  transition: background 0.15s;
  user-select: none;
  line-height: 1.3;
}

.tree-folder-item:hover {
  background-color: #e2e8f0;
  color: #0f172a;
}

.tree-folder-item.active {
  background-color: #cbd5e1;
  font-weight: 700;
  color: #0b57d0;
}

.tree-folder-badge {
  font-size: 12px;
  font-weight: 700;
  color: #0b57d0;
}

/* Center Main Card & Layout Split */
.gmail-main-card {
  flex: 1;
  background-color: #ffffff;
  display: flex;
  overflow: hidden;
}

.outlook-split-container {
  display: flex;
  width: 100%;
  height: 100%;
}

.outlook-email-list-panel {
  width: 380px;
  border-right: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  background: #ffffff;
}

.outlook-reading-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  overflow: hidden;
}

/* Toolbar & Tabs */
.mail-list-toolbar {
  height: 44px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
  background: #f8fafc;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.gmail-tabs-bar {
  display: flex;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
  background: #ffffff;
}

.tab-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
}

.tab-item.active {
  color: var(--accent-blue);
  border-bottom-color: var(--accent-blue);
}

/* Outlook Style 3-Column Mail Item Card */
.outlook-mail-item {
  padding: 8px 14px;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  transition: background 0.1s;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.outlook-mail-item:hover {
  background-color: #f1f5f9;
}

.outlook-mail-item.selected {
  background-color: #e2e8f0 !important;
  border-left: 4px solid var(--accent-blue);
}

.outlook-mail-item.unread {
  font-weight: 700;
  background-color: #ffffff;
}

.outlook-mail-item.read {
  font-weight: 400;
  background-color: #f2f6fc;
  color: #444746;
}

.item-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.item-sender-name {
  font-size: 13.5px;
  font-weight: 600;
  color: #0f172a;
}

.item-date-text {
  font-size: 11.5px;
  color: #0b57d0;
  font-weight: 600;
}

.item-subject-text {
  font-size: 13.5px;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

/* Gmail 2-Column Row Layout (Sát vừa vặn, không thưa) */
.gmail-email-list {
  flex: 1;
  overflow-y: auto;
}

.gmail-mail-row {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 14px;
  border-bottom: 1px solid #f1f3f4;
  cursor: pointer;
  font-size: 13.5px;
  transition: background 0.1s, box-shadow 0.1s;
  user-select: none;
  line-height: 1.3;
}

.gmail-mail-row:hover {
  box-shadow: inset 1px 0 0 #dadce0, inset -1px 0 0 #dadce0, 0 1px 2px 0 rgba(60,64,67,0.3);
  z-index: 2;
  background-color: #f2f6fc;
}

.gmail-mail-row.unread {
  background-color: #ffffff;
  font-weight: 700;
}

.gmail-mail-row.read {
  background-color: #f2f6fc;
  color: #444746;
}

.gmail-mail-row.selected {
  background-color: #c2e7ff !important;
}

.row-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: 14px;
  padding: 4px 8px;
  color: #c4c7c5;
  cursor: pointer;
  border-radius: 4px;
}

.row-controls:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.row-controls i:hover {
  color: #f4b400;
}

.row-clickable-area {
  display: flex;
  align-items: center;
  flex: 1;
  overflow: hidden;
  cursor: pointer;
}

.row-sender {
  width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
  color: #1f1f1f;
  font-size: 13.5px;
  font-weight: 600;
}

.gmail-mail-row.read .row-sender {
  font-weight: 400;
  color: #444746;
}

.row-subject-snippet {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 14px;
  font-size: 13.5px;
}

.row-subject {
  color: #1f1f1f;
  font-weight: 600;
}

.gmail-mail-row.read .row-subject {
  font-weight: 400;
  color: #1f1f1f;
}

.row-date {
  font-size: 12px;
  color: #5f6368;
  font-weight: 600;
  flex-shrink: 0;
}

.gmail-mail-row.read .row-date {
  font-weight: 400;
}

/* Reading Pane Header */
.reader-top-actions {
  height: 44px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}

.reader-header-detail {
  padding: 14px 20px 10px;
  border-bottom: 1px solid #f1f5f9;
}

.reader-title-subject {
  font-size: 19px;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 8px;
  line-height: 1.3;
}

.reader-sender-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.sender-left-info {
  display: flex;
  gap: 10px;
}

.avatar-gmail-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background-color: #0b57d0;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 16px;
}

.sender-text-info h4 {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.2;
}

.sender-text-info p {
  font-size: 12px;
  color: #64748b;
  line-height: 1.2;
}

.reader-body-frame {
  flex: 1;
  padding: 16px 20px;
  overflow-y: auto;
}

.reader-empty-placeholder {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #64748b;
  gap: 12px;
}

.reader-empty-placeholder i {
  font-size: 48px;
  opacity: 0.4;
}

/* Login Modal */
.login-container {
  position: fixed;
  inset: 0;
  background: var(--bg-app);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}

.login-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 36px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  border: 1px solid #cbd5e1;
}

.login-header {
  text-align: center;
  margin-bottom: 24px;
}

.login-header .logo-icon {
  width: 48px;
  height: 48px;
  background: #0b57d0;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  color: white;
  margin: 0 auto 16px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
}

.form-control:focus {
  border-color: var(--accent-blue);
}

.btn-primary {
  width: 100%;
  padding: 10px;
  background-color: var(--accent-blue);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-primary:hover {
  background-color: var(--accent-blue-hover);
}

/* Gmail Official Compose Window Theme */
.gmail-compose-modal {
  position: fixed;
  bottom: 0;
  right: 80px;
  width: 580px;
  height: 540px;
  background: #ffffff;
  border-radius: 12px 12px 0 0;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  z-index: 9000;
  overflow: hidden;
  border: 1px solid #dadce0;
  transition: all 0.2s ease;
}

.gmail-compose-modal.maximized {
  width: 92vw !important;
  height: 92vh !important;
  top: 4vh;
  left: 4vw;
  right: auto;
  bottom: auto;
  border-radius: 12px;
}

.gmail-compose-header {
  height: 38px;
  background: #f2f6fc;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 500;
  color: #041e49;
}

.compose-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.compose-header-btn {
  background: none;
  border: none;
  color: #444746;
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
}

.compose-header-btn:hover {
  color: #1f1f1f;
}

.gmail-compose-body {
  padding: 0 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  overflow-y: auto;
}

.gmail-input-line {
  border-bottom: 1px solid #f1f3f4;
  padding: 6px 0;
  display: flex;
  align-items: center;
}

.gmail-input-line input {
  width: 100%;
  border: none;
  outline: none;
  font-size: 14px;
  color: #1f1f1f;
  background: transparent;
}

.gmail-input-line input::placeholder {
  color: #747775;
}

.cc-bcc-buttons-bar {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 4px;
}

.cc-bcc-btn {
  background: none;
  border: none;
  color: #5f6368;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 3px 8px;
  border-radius: 4px;
  transition: all 0.12s ease;
}

.cc-bcc-btn:hover {
  background-color: #f1f5f9;
  color: #0b57d0;
}

.cc-bcc-btn.active {
  color: #0b57d0;
  background-color: #e0e7ff;
}

/* Rich Content Area */
.rich-editor-area {
  flex: 1;
  min-height: 200px;
  padding: 10px 0;
  border: none;
  outline: none;
  font-size: 14px;
  line-height: 1.45;
  color: #1f1f1f;
  overflow-y: auto;
  background: #ffffff;
}

.rich-editor-area:empty:before {
  content: attr(placeholder);
  color: #747775;
  cursor: text;
}

/* Floating Formatting Toolbar Pill */
.composer-toolbar-pill {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: #edf2fa;
  border-radius: 20px;
  margin-bottom: 8px;
  flex-wrap: wrap;
  width: max-content;
  max-width: 100%;
}

.pill-btn {
  background: transparent;
  border: none;
  border-radius: 4px;
  color: #444746;
  font-size: 13.5px;
  cursor: pointer;
  padding: 3px 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

.pill-btn:hover {
  background-color: #d3e3fd;
  color: #041e49;
}

.pill-divider {
  width: 1px;
  height: 14px;
  background: #c4c7c5;
  margin: 0 2px;
}

.pill-select {
  background: transparent;
  border: none;
  border-radius: 4px;
  color: #444746;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 3px 4px;
  outline: none;
}

.pill-select:hover {
  background-color: #d3e3fd;
  color: #041e49;
}

.pill-color-picker-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 24px;
  border-radius: 4px;
  cursor: pointer;
}

.pill-color-picker-wrapper:hover {
  background-color: #d3e3fd;
}

.pill-color-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.color-indicator-text {
  font-weight: 800;
  font-size: 13px;
  color: #0b57d0;
  text-decoration: underline;
}

/* Emoji Picker Popup */
.emoji-picker-popup {
  position: fixed;
  bottom: 80px;
  right: 120px;
  width: 260px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.18);
  border: 1px solid #e2e8f0;
  z-index: 1005;
  padding: 12px;
}

.emoji-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid #f1f5f9;
}

.btn-close-emoji {
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  color: #64748b;
}

.emoji-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  font-size: 20px;
  text-align: center;
}

.emoji-grid span {
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: transform 0.1s ease;
}

.emoji-grid span:hover {
  background: #f1f5f9;
  transform: scale(1.25);
}

.footer-icon-btn.active {
  background-color: #d3e3fd;
  color: #0b57d0;
}

/* Bottom Action Bar */
.gmail-compose-footer-bar {
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  border-top: none;
}

.send-split-btn {
  display: inline-flex;
  align-items: center;
  background-color: #0b57d0;
  border-radius: 20px;
  overflow: hidden;
}

.send-btn-main {
  background: transparent;
  border: none;
  color: white;
  padding: 7px 16px 7px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.send-btn-main:hover {
  background-color: #0842a0;
}

.send-btn-arrow {
  background: transparent;
  border: none;
  border-left: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  padding: 7px 8px;
  font-size: 12px;
  cursor: pointer;
}

.send-btn-arrow:hover {
  background-color: #0842a0;
}

.footer-icon-btn {
  background: transparent;
  border: none;
  color: #444746;
  font-size: 17px;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.footer-icon-btn:hover {
  background-color: #e9eef6;
  color: #1f1f1f;
}

.footer-icon-btn.active {
  background-color: #d3e3fd;
  color: #041e49;
}

.compose-attachments-container {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.compose-attachment-pill {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 16px;
  padding: 3px 8px;
  font-size: 12px;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 4px;
}

.compose-attachment-pill .btn-remove-file {
  border: none;
  background: none;
  color: #ef4444;
  cursor: pointer;
  font-size: 13px;
}

/* Multi-Account Dropdown */
.account-switcher-dropdown {
  position: absolute;
  top: 48px;
  right: 0;
  width: 300px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  border: 1px solid #cbd5e1;
  z-index: 9999;
  padding: 14px 0;
  display: flex;
  flex-direction: column;
}

.account-switcher-header {
  padding: 0 16px 10px;
  border-bottom: 1px solid #e2e8f0;
  text-align: center;
}

.account-list {
  display: flex;
  flex-direction: column;
  max-height: 240px;
  overflow-y: auto;
}

.account-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  cursor: pointer;
  transition: background 0.15s;
}

.account-item:hover {
  background-color: #f1f5f9;
}

.account-item.active {
  background-color: #e2e8f0;
}

.account-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.account-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #0b57d0;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 13px;
}

.account-info {
  display: flex;
  flex-direction: column;
}

.account-email {
  font-size: 13.5px;
  font-weight: 500;
  color: #0f172a;
}

.account-status {
  font-size: 11px;
  color: #64748b;
}

.account-switcher-actions {
  border-top: 1px solid #e2e8f0;
  padding-top: 6px;
  margin-top: 6px;
}

.switcher-btn {
  width: 100%;
  padding: 8px 16px;
  background: none;
  border: none;
  text-align: left;
  font-size: 13px;
  font-weight: 500;
  color: #0f172a;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background 0.15s;
}

.switcher-btn:hover {
  background-color: #f1f5f9;
}

.btn-create-label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 600;
  color: #0b57d0;
  background: transparent;
  border: 1px dashed #cbd5e1;
  border-radius: 6px;
  cursor: pointer;
  margin-top: 6px;
  width: 100%;
  transition: background 0.15s;
}

.btn-create-label:hover {
  background: #e2e8f0;
}

.label-pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 7px;
  border-radius: 12px;
  font-size: 11.5px;
  font-weight: 600;
  color: #0b57d0;
  background: #e8f0fe;
  margin-left: 6px;
}

.btn-delete-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 15px;
  font-weight: bold;
  border-radius: 50%;
  cursor: pointer;
  opacity: 0.6;
  transition: all 0.15s ease;
  margin-left: auto;
}

.tree-folder-item:hover .btn-delete-label {
  opacity: 1;
}

.btn-delete-label:hover {
  background-color: #fee2e2;
  color: #dc2626;
}

/* Gmail Right-Click Context Menu */
.context-menu {
  position: fixed;
  z-index: 10000;
  width: 230px;
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.18), 0 1px 6px rgba(0, 0, 0, 0.1);
  padding: 6px 0;
  border: 1px solid #e2e8f0;
  font-size: 13px;
  font-family: inherit;
  color: #0f172a;
  user-select: none;
}

.context-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  cursor: pointer;
  transition: background 0.12s ease;
  font-size: 13px;
  font-weight: 500;
}

.context-menu-item i {
  font-size: 16px;
  color: #475569;
}

.context-menu-item:hover {
  background-color: #f1f5f9;
}

.context-menu-divider {
  height: 1px;
  background-color: #e2e8f0;
  margin: 4px 0;
}

/* Attachment Preview Modal */
.attachment-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
}

.attachment-preview-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(4px);
}

.attachment-preview-container {
  position: relative;
  z-index: 1;
  width: 90vw;
  max-width: 1100px;
  height: 85vh;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.attachment-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.preview-file-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

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

.btn-preview-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
}

.btn-preview-action-icon {
  background: transparent;
  border: none;
  font-size: 24px;
  color: #64748b;
  cursor: pointer;
  padding: 0 4px;
}

.attachment-preview-body {
  flex: 1;
  overflow: auto;
  padding: 20px;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.preview-iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: #ffffff;
  border-radius: 6px;
}

.preview-text-box {
  width: 100%;
  height: 100%;
  background: #ffffff;
  border-radius: 6px;
  padding: 16px;
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 13px;
  line-height: 1.5;
  color: #0f172a;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  border: 1px solid #cbd5e1;
}

.hidden {
  display: none !important;
}

/* Gmail Official Reader View Styles */
.gmail-reader-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #ffffff;
}

.gmail-reader-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-bottom: 1px solid #e2e8f0;
  background: #ffffff;
}

.toolbar-separator {
  width: 1px;
  height: 18px;
  background: #cbd5e1;
  margin: 0 4px;
}

.gmail-reader-scrollable {
  flex: 1;
  overflow-y: auto;
  padding: 24px 36px 40px;
}

.gmail-reader-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.gmail-reader-subject {
  font-size: 20px;
  font-weight: 400;
  color: #1f2937;
  font-family: 'Roboto', 'Segoe UI', sans-serif;
  line-height: 1.3;
  margin: 0;
}

.gmail-folder-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: #e2e8f0;
  color: #475569;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

.gmail-sender-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
}

.sender-left-block {
  display: flex;
  align-items: center;
  gap: 14px;
}

.gmail-avatar-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #0b57d0;
  color: #ffffff;
  font-weight: 600;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sender-info-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sender-name-line {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sender-name-bold {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
}

.sender-email-grey {
  font-size: 12px;
  color: #64748b;
}

.sender-to-me {
  font-size: 12px;
  color: #64748b;
  cursor: pointer;
}

.sender-right-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.gmail-date-text {
  font-size: 12px;
  color: #64748b;
  margin-right: 8px;
}

.gmail-body-frame-wrapper {
  margin-bottom: 30px;
  min-height: 250px;
}

.gmail-body-iframe {
  width: 100%;
  min-height: 350px;
  border: none;
  background: #ffffff;
}

/* Attachment Cards Grid (Gmail Style at Bottom) */
.gmail-attachments-section {
  border-top: 1px solid #e2e8f0;
  padding-top: 16px;
  margin-bottom: 30px;
}

.attachments-header-title {
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.attachment-scanned-badge {
  font-size: 11.5px;
  color: #16a34a;
  font-weight: 500;
}

.gmail-attachment-cards-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.gmail-attachment-card {
  width: 190px;
  height: 120px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  transition: transform 0.15s, box-shadow 0.15s;
}

.gmail-attachment-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.card-thumbnail-preview {
  flex: 1;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.card-thumbnail-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-footer-info {
  height: 36px;
  padding: 6px 10px;
  background: #ffffff;
  border-top: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  gap: 6px;
}

.card-file-name {
  font-size: 11.5px;
  font-weight: 600;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.card-hover-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.gmail-attachment-card:hover .card-hover-overlay {
  opacity: 1;
}

.overlay-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #ffffff;
  color: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 15px;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.gmail-bottom-actions-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #f1f5f9;
}

.gmail-bottom-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  border-radius: 20px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #475569;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.gmail-bottom-btn:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  color: #0b57d0;
}

/* Professional Excel Sheet Viewer Styles */
.excel-viewer-container {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #cbd5e1;
}

.excel-sheet-tabs-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  background: #f1f5f9;
  border-bottom: 1px solid #cbd5e1;
  overflow-x: auto;
}

.excel-sheet-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 6px 6px 0 0;
  border: 1px solid #cbd5e1;
  background: #e2e8f0;
  color: #475569;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s;
}

.excel-sheet-tab.active {
  background: #ffffff;
  color: #16a34a;
  border-bottom-color: #ffffff;
  box-shadow: 0 -2px 4px rgba(0,0,0,0.04);
}

.excel-table-scroll-wrapper {
  flex: 1;
  overflow: auto;
  padding: 12px;
  background: #ffffff;
}

#excelTableGrid {
  border-collapse: collapse;
  width: 100%;
  font-family: 'Segoe UI', Arial, sans-serif;
  font-size: 12.5px;
  color: #0f172a;
}

#excelTableGrid tr:first-child td, #excelTableGrid th {
  background: #f8fafc;
  font-weight: 600;
  color: #334155;
}

#excelTableGrid td, #excelTableGrid th {
  border: 1px solid #cbd5e1;
  padding: 6px 10px;
  white-space: nowrap;
  min-width: 60px;
}

#excelTableGrid tr:nth-child(even) {
  background-color: #f8fafc;
}

#excelTableGrid tr:hover {
  background-color: #f0fdf4;
}

/* Gmail Interactive Quick-Chip Attachment Pills on Email Rows */
.gmail-quick-chips-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
  margin-bottom: 4px;
}

.gmail-quick-chip-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 18px;
  font-size: 12px;
  font-weight: 500;
  color: #1e293b;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.gmail-quick-chip-pill:hover {
  background: #ffffff;
  border-color: #0b57d0;
  color: #0b57d0;
  box-shadow: 0 3px 8px rgba(11, 87, 208, 0.2);
  transform: translateY(-1px);
}

.chip-filename-text {
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Designed by Vi Pham Footer Credit Badge */
.app-designer-credit {
  padding: 10px 20px;
  margin-top: auto;
  font-size: 11.5px;
  font-weight: 500;
  color: #64748b;
  text-align: left;
  border-top: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  user-select: none;
  background: #f8fafc;
}

.app-designer-credit b {
  color: #0b57d0;
  font-weight: 700;
}

/* Load More Emails Button */
.btn-gmail-load-more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 20px;
  color: #0b57d0;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.btn-gmail-load-more:hover {
  background-color: #f1f5f9;
  border-color: #0b57d0;
  box-shadow: 0 2px 6px rgba(11, 87, 208, 0.15);
}

/* Master System Login Tabs */
.login-tabs-bar {
  display: flex;
  background: #f1f5f9;
  border-radius: 8px;
  padding: 4px;
  margin-bottom: 20px;
  gap: 4px;
}

.login-tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  padding: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: #64748b;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.login-tab-btn:hover {
  color: #0f172a;
  background: rgba(255, 255, 255, 0.5);
}

.login-tab-btn.active {
  background: #ffffff;
  color: #0b57d0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
