:root {
  --bs-primary: #1a73e8;
  --bs-primary-rgb: 26, 115, 232;
  --bs-link-color: #1a73e8;
  --bs-link-color-rgb: 26, 115, 232;
  --bs-link-hover-color: #1557b0;
  --bs-link-hover-color-rgb: 21, 87, 176;
  --bs-body-color: #0f172a;
  --bs-body-bg: #f8fafc;
  --bs-border-color: #e2e8f0;
  --bs-secondary-color: #475569;
  --gk-ink: #0f172a;
  --gk-muted: #475569;
  --gk-line: #e2e8f0;
  --gk-paper: #f8fafc;
  --gk-mail-bg: #f6f8fc;
  --gk-primary: #1a73e8;
  --gk-primary-dark: #0b57d0;
  --gk-primary-soft: #e8f0fe;
  --gk-pill-active: #d3e3fd;
  --gk-star: #f59e0b;
  --gk-selected: #e8f0fe;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--gk-paper);
  color: var(--gk-ink);
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea,
select {
  font: inherit;
}

.btn {
  --bs-btn-border-radius: 8px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.btn-primary {
  --bs-btn-color: #ffffff;
  --bs-btn-bg: #1a73e8;
  --bs-btn-border-color: #1a73e8;
  --bs-btn-hover-color: #ffffff;
  --bs-btn-hover-bg: #1557b0;
  --bs-btn-hover-border-color: #1557b0;
  --bs-btn-active-color: #ffffff;
  --bs-btn-active-bg: #0b57d0;
  --bs-btn-active-border-color: #0b57d0;
  --bs-btn-focus-shadow-rgb: 26, 115, 232;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.btn-outline-primary {
  --bs-btn-color: #1a73e8;
  --bs-btn-border-color: #cbd5e1;
  --bs-btn-hover-color: #0b57d0;
  --bs-btn-hover-bg: #e8f0fe;
  --bs-btn-hover-border-color: #93c5fd;
  --bs-btn-active-color: #0b57d0;
  --bs-btn-active-bg: #d3e3fd;
  --bs-btn-focus-shadow-rgb: 26, 115, 232;
  background: #ffffff;
}

.form-control,
.form-select {
  border-color: #cbd5e1;
  border-radius: 8px;
  color: #0f172a;
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus {
  border-color: #1a73e8;
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.18);
}

.form-check-input:checked {
  background-color: #1a73e8;
  border-color: #1a73e8;
}

.gk-wordmark {
  font-weight: 700;
  letter-spacing: -0.025em;
  font-size: 1.15rem;
  line-height: 1.2;
  color: #0f172a;
}

.gk-logo {
  width: 2.1rem;
  height: 2.1rem;
  display: block;
  flex: 0 0 auto;
}

.gk-logo-sm {
  width: 1.85rem;
  height: 1.85rem;
}

.gk-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 700;
  flex: 0 0 auto;
}

.gk-avatar-sm {
  width: 2.1rem;
  height: 2.1rem;
  font-size: 0.78rem;
}

.gk-site-header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 0;
  z-index: 40;
}

.gk-nav-link {
  color: #334155;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.gk-nav-link:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.gk-hero {
  background: radial-gradient(circle at 85% 15%, #e0edff 0%, #f8fafc 52%, #ffffff 100%);
  border-bottom: 1px solid #e2e8f0;
}

.gk-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  color: var(--gk-ink);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.gk-stat-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.gk-mock {
  background: #f6f8fc;
  border: 1px solid #cbd5e1;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
}

.gk-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1.3;
}

.gk-badge-blue {
  background: #e8f0fe;
  color: #0b57d0;
}

.gk-badge-green {
  background: #dcfce7;
  color: #15803d;
}

.gk-badge-amber {
  background: #fef3c7;
  color: #b45309;
}

.gk-badge-red {
  background: #fee2e2;
  color: #b91c1c;
}

.gk-badge-slate {
  background: #f1f5f9;
  color: #334155;
}

.gk-admin-hero {
  background: linear-gradient(180deg, #ffffff 0%, #f1f5f9 100%);
}

.gk-admin-tabs {
  gap: 0.35rem;
  border-bottom: 0;
}

.gk-admin-tabs .nav-link {
  color: #475569;
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: 8px;
  padding: 0.5rem 0.9rem;
}

.gk-admin-tabs .nav-link:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.gk-admin-tabs .nav-link.active {
  background: #1a73e8;
  color: #ffffff;
}

.gk-menu {
  position: relative;
}

.gk-menu summary {
  list-style: none;
}

.gk-menu summary::-webkit-details-marker {
  display: none;
}

/* Gmail-like Webmail Layout */
.mail-app {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--gk-mail-bg);
  color: #0f172a;
  font-size: 14px;
}

.gk-topbar {
  height: 60px;
  background: var(--gk-mail-bg);
  flex: 0 0 auto;
}

.mail-body {
  gap: 12px;
  padding: 0 12px 12px;
  min-height: 0;
}

.gk-side {
  display: none;
  background: transparent;
  flex-direction: column;
  min-height: 0;
}

.gk-folder {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #334155;
  border-radius: 999px;
  text-align: left;
  min-height: 36px;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  margin: 1px 4px;
  transition: background-color 0.12s ease;
}

.gk-folder.active {
  background: var(--gk-pill-active);
  color: var(--gk-primary-dark);
  font-weight: 700;
}

.gk-folder:hover {
  background: #eaeef6;
  color: #0f172a;
}

.gk-folder.active:hover {
  background: #c4d7fb;
  color: var(--gk-primary-dark);
}

.gk-compose-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  min-width: 148px;
  height: 48px;
  padding: 0 20px;
  margin: 4px 4px 12px;
  border: 0;
  border-radius: 16px;
  background: #c2e7ff;
  color: #001d35;
  font-weight: 700;
  font-size: 14px;
  justify-content: center;
  text-decoration: none;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
  transition: box-shadow 0.15s ease, background-color 0.15s ease;
}

.gk-compose-btn:hover {
  background: #b3dffc;
  color: #001d35;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.16);
}

.gk-split {
  gap: 12px;
  min-width: 0;
  min-height: 0;
}

.gk-list,
.gk-reader {
  min-height: 0;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.gk-command {
  min-height: 46px;
  border-bottom: 1px solid #eef2f6;
  background: #ffffff;
  flex: 0 0 auto;
}

.gk-subject {
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.015em;
  color: #0f172a;
}

.gk-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
  border-bottom: 1px solid #f1f5f9;
  background: #ffffff;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  text-align: left;
  color: inherit;
  text-decoration: none;
  padding: 11px 14px;
  transition: background-color 0.1s ease;
}

.gk-row.unread {
  background: #f8fafc;
}

.gk-row > a {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.gk-row:hover {
  background: #f1f5f9;
  color: inherit;
}

.gk-row.selected,
.gk-row.selected:hover {
  background: var(--gk-selected);
}

.gk-search {
  background: #eaf1fb;
  border: 1px solid transparent;
  border-radius: 999px;
  overflow: hidden;
  max-width: 680px;
  height: 42px;
  padding: 0 14px;
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.gk-search:focus-within {
  background: #ffffff;
  border-color: #bfdbfe;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
}

.gk-search .form-control {
  height: 38px;
  font-size: 14px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.gk-star {
  color: #94a3b8;
  border: 0;
  background: transparent;
  line-height: 1;
  font-size: 18px;
  padding: 0 4px;
}

.gk-star:hover {
  color: #f59e0b;
}

.gk-star.on {
  color: var(--gk-star);
}

.gk-icon-btn {
  border: 0;
  background: transparent;
  color: #334155;
  border-radius: 8px;
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  font-weight: 600;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.gk-icon-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.scroll-thin {
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

.gk-body {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.6;
  color: #1e293b;
}

.gk-compose {
  position: fixed;
  inset: 0;
  z-index: 1050;
  display: flex;
  flex-direction: column;
  background: #ffffff;
}

.gk-compose-bar {
  background: #f2f6fc;
  color: #0f172a;
  border-bottom: 1px solid #e2e8f0;
  min-height: 44px;
}

.gk-reader .btn-outline-secondary {
  border-color: #cbd5e1;
  color: #1e293b;
  background: #ffffff;
}

.gk-reader .btn-outline-secondary:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.min-h-0 {
  min-height: 0;
}

@media (min-width: 576px) {
  .gk-compose {
    inset: auto 24px 0 auto;
    width: min(560px, calc(100vw - 32px));
    height: min(600px, calc(100dvh - 48px));
    border: 1px solid #cbd5e1;
    border-bottom: 0;
    border-radius: 14px 14px 0 0;
    box-shadow: 0 12px 36px rgba(15, 23, 42, 0.2);
  }

  .gk-compose-bar {
    border-radius: 14px 14px 0 0;
  }
}

@media (min-width: 992px) {
  .gk-side {
    display: flex;
    flex: 0 0 236px;
    width: 236px;
  }

  .gk-mobile-folders {
    display: none !important;
  }

  .gk-list {
    width: 390px;
    max-width: 42%;
    flex: 0 0 auto;
    border-radius: 16px;
  }

  .gk-reader {
    display: flex !important;
    border-radius: 16px;
    flex: 1 1 auto;
  }
}

@media (max-width: 991.98px) {
  .mail-body,
  .gk-split {
    gap: 0;
    padding: 0;
  }

  .gk-list,
  .gk-reader {
    border: 0;
    border-radius: 0;
    width: 100%;
    max-width: none;
    flex: 1 1 auto;
  }

  .gk-reader {
    display: none;
  }

  .is-reading .gk-list,
  .is-reading .gk-mobile-folders {
    display: none;
  }

  .is-reading .gk-reader {
    display: flex;
  }

  .is-compose .mail-body {
    display: none;
  }
}
