/* ==========================================================
   BCY ENGINEERING - ERP & CRM CORPORATE PORTAL
   Lightweight, Pure Vanilla CSS (No Frameworks)
   Minimalist Aesthetic: Zero Unnecessary Borders / Frames
   100% Fluid & Responsive (No UI Overflow)
   Strict Zero-Emoji Corporate Compliance
   ========================================================== */

:root {
  --bcy-midnight: #08142b;
  --bcy-midnight-hover: #132446;
  
  --bg-page: #f8fafc;
  --bg-white: #ffffff;
  --bg-subtle: #f1f5f9;
  
  --border-light: #e2e8f0;
  --border-hover: #cbd5e1;
  
  --text-dark: #0f172a;
  --text-main: #334155;
  --text-sub: #64748b;
  --text-muted: #94a3b8;
  
  --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  font-family: var(--font-family);
  background-color: var(--bg-page);
  color: var(--text-dark);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* ==========================================================
   HEADER & NAVBAR (Clean Minimal Header, No Language Pill)
   ========================================================== */
.bcy-header {
  background: var(--bcy-midnight);
  color: #ffffff;
  width: 100%;
  position: sticky;
  top: 0;
  z-index: 100;
}

.bcy-nav-container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.bcy-brand-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bcy-brand-logo {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: 0.35em;
  color: #ffffff;
  text-transform: uppercase;
  user-select: none;
}

.bcy-platform-tag {
  background: #152648;
  color: #94a3b8;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 2px 7px;
  border-radius: 4px;
  text-transform: uppercase;
}

.bcy-nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-link {
  font-size: 0.86rem;
  font-weight: 600;
  color: #94a3b8;
  transition: color 0.15s ease;
  padding: 4px 0;
}

.nav-link:hover,
.nav-link.active {
  color: #ffffff;
}

/* ==========================================================
   MAIN CONTAINER & VIEW SWITCHING (Fluid & Bounded)
   ========================================================== */
.main-container {
  width: 100%;
  max-width: 1180px;
  margin: 24px auto 48px auto;
  padding: 0 20px;
  box-sizing: border-box;
}

.portal-view {
  display: none;
  width: 100%;
}

.portal-view.active {
  display: block;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ==========================================================
   VIEW 1: DASHBOARD (Clean, Solid, No Transparent Frames)
   ========================================================== */
.dashboard-banner {
  background: var(--bcy-midnight);
  border-radius: 14px;
  padding: 28px 32px;
  color: #ffffff;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
  width: 100%;
}

.dash-banner-content {
  flex: 1 1 300px;
  min-width: 0;
}

.dash-banner-eyebrow {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #38bdf8;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.dash-banner-title {
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #ffffff;
  margin-bottom: 6px;
}

.dash-banner-desc {
  font-size: 0.95rem;
  color: #f1f5f9;
  line-height: 1.5;
  font-weight: 400;
}

/* Clean KPIs without any transparent border boxes */
.dash-banner-kpis {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 28px;
  flex: 0 0 auto;
}

.dash-kpi-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.dash-kpi-val {
  font-size: 1.85rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1;
}

.dash-kpi-lbl {
  font-size: 0.76rem;
  font-weight: 700;
  color: #e2e8f0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 4px;
}

/* Executive AI Assistant & Q&A Card */
.assistant-card {
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 28px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.assistant-header {
  margin-bottom: 14px;
}

.assistant-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: #eff6ff;
  color: #1d4ed8;
  padding: 3px 8px;
  border-radius: 4px;
  margin-bottom: 6px;
}

.assistant-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-dark);
  margin: 0 0 4px 0;
}

.assistant-sub {
  font-size: 0.84rem;
  color: var(--text-sub);
  margin: 0;
}

.assistant-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.assistant-chip {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  color: var(--text-main);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.assistant-chip:hover {
  background: #e2e8f0;
  border-color: #cbd5e1;
  color: var(--text-dark);
}

.assistant-input-form {
  display: flex;
  gap: 8px;
  width: 100%;
}

.assistant-input {
  flex: 1;
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.88rem;
  color: var(--text-dark);
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease;
}

.assistant-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.assistant-btn-send {
  background: var(--bcy-midnight);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 0 20px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.15s ease;
  font-family: inherit;
}

.assistant-btn-send:hover {
  background: var(--bcy-midnight-hover);
}

.assistant-btn-send:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.assistant-response-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 16px 18px;
  margin-top: 14px;
  animation: fadeIn 0.2s ease;
}

.assistant-response-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid #e2e8f0;
}

.assistant-response-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #3b82f6;
}

.assistant-btn-clear {
  background: transparent;
  border: none;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-sub);
  cursor: pointer;
  padding: 2px 6px;
}

.assistant-btn-clear:hover {
  color: var(--text-dark);
}

.assistant-response-content {
  font-size: 0.86rem;
  line-height: 1.65;
  color: var(--text-dark);
  white-space: pre-wrap;
}

/* Section Heading */
.section-heading {
  margin-bottom: 16px;
}

.section-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-dark);
}

.section-sub {
  font-size: 0.82rem;
  color: var(--text-sub);
  margin-top: 2px;
}

/* Modules Grid */
.modules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  width: 100%;
}

.module-card {
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  transition: all 0.15s ease;
  min-width: 0;
}

/* Active Module Card (Mail Services) */
.module-card-active {
  cursor: pointer;
}

.module-card-active:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.04);
}

.module-badge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.module-status-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
}

.status-live {
  background: #ecfdf5;
  color: #047857;
}

.status-upcoming {
  background: #f1f5f9;
  color: #64748b;
}

.module-counter-tag {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-sub);
}

.module-icon-wrap {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: #f1f5f9;
  color: var(--bcy-midnight);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.module-icon-wrap svg {
  width: 18px;
  height: 18px;
}

.module-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-dark);
  margin-bottom: 6px;
}

.module-desc {
  font-size: 0.82rem;
  color: var(--text-sub);
  line-height: 1.45;
  margin-bottom: 14px;
  flex: 1;
}

.module-features-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.76rem;
  color: var(--text-main);
  background: var(--bg-subtle);
  padding: 10px 12px;
  border-radius: 6px;
  margin-bottom: 16px;
}

.module-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 9px 14px;
  border-radius: 6px;
  background: var(--bcy-midnight);
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 700;
  transition: background 0.15s ease;
}

.module-card-active:hover .module-action-btn {
  background: var(--bcy-midnight-hover);
}

.module-action-btn svg {
  width: 12px;
  height: 12px;
}

/* Disabled Future Modules */
.module-card-disabled {
  opacity: 0.7;
  background: #fafbfc;
}

.module-disabled-note {
  margin-top: auto;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  padding-top: 10px;
  border-top: 1px dashed var(--border-light);
}

/* ==========================================================
   VIEW 2: MAIL SERVICES (Clean, Fluid Canvas)
   ========================================================== */
.view-header-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 6px;
  border: 1px solid var(--border-light);
  background: var(--bg-white);
  color: var(--text-main);
  font-size: 0.8rem;
  font-weight: 600;
  transition: all 0.15s ease;
}

.btn-back:hover {
  background: var(--bg-subtle);
}

.btn-back svg {
  width: 13px;
  height: 13px;
}

.view-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.view-badge {
  font-size: 0.68rem;
  font-weight: 700;
  background: var(--bg-subtle);
  color: var(--text-sub);
  padding: 2px 6px;
  border-radius: 4px;
}

.view-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-dark);
}

/* White Canvas */
.bcy-white-canvas {
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 22px;
  width: 100%;
  box-sizing: border-box;
}

.canvas-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 18px;
}

.canvas-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-dark);
  margin-bottom: 3px;
}

.canvas-desc {
  font-size: 0.82rem;
  color: var(--text-sub);
  max-width: 720px;
  line-height: 1.45;
}

.canvas-kpi-summary {
  display: flex;
  align-items: center;
  gap: 12px;
}

.kpi-mini-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.kpi-mini-num {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-dark);
  line-height: 1;
}

.kpi-mini-label {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-top: 2px;
}

/* Toolbar & Status Filters */
.toolbar-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
  width: 100%;
}

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

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-wrap input {
  width: 100%;
  padding: 9px 36px 9px 38px;
  border-radius: 6px;
  border: 1px solid var(--border-light);
  background: var(--bg-subtle);
  font-family: inherit;
  font-size: 0.84rem;
  color: var(--text-dark);
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.15s ease;
}

.search-wrap input:focus {
  background: var(--bg-white);
  border-color: #94a3b8;
}

.btn-clear {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
}

.status-pills-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  width: 100%;
}

.pill {
  padding: 6px 12px;
  border-radius: 6px;
  border: none;
  background: var(--bg-subtle);
  color: var(--text-main);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.pill:hover {
  background: #e2e8f0;
}

.pill.active {
  background: var(--bcy-midnight);
  color: #ffffff;
}

/* ==========================================================
   CARDS GRID & CARDS (Clean, Flat, No Frame Noise)
   ========================================================== */
.bcy-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  width: 100%;
  box-sizing: border-box;
}

.bcy-card {
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  cursor: pointer;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

.bcy-card:hover {
  border-color: var(--border-hover);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

/* Top Meta Row */
.card-top-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.card-country-badge {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-sub);
  background: var(--bg-subtle);
  padding: 2px 6px;
  border-radius: 4px;
}

.bcy-card-status-tag {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  white-space: nowrap;
}

.tag-pending { background: #f8fafc; color: #64748b; }
.tag-sent { background: #eff6ff; color: #1d4ed8; }
.tag-replied { background: #f0fdf4; color: #15803d; }
.tag-hot { background: #fef2f2; color: #b91c1c; }
.tag-passive { background: #f1f5f9; color: #64748b; }

/* Logo and Title */
.card-brand-section {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.card-logo-box {
  width: 42px;
  height: 42px;
  border-radius: 6px;
  background: #f8fafc;
  padding: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.card-logo-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.card-logo-monogram {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--bcy-midnight);
}

.card-title-col {
  flex: 1;
  min-width: 0;
}

.bcy-card-title {
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-contact-count-text {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.bcy-card-desc {
  font-size: 0.78rem;
  color: var(--text-sub);
  line-height: 1.4;
  margin-bottom: 10px;
  min-height: 34px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Handwritten Note (Natural Text, NO yellow box, NO border!) */
.card-note-text {
  font-size: 0.74rem;
  color: #475569;
  font-style: italic;
  margin-bottom: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Action Button ("Kartviziti Görüntüle") */
.bcy-card-btn {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 8px 12px;
  border-radius: 6px;
  background: var(--bg-subtle);
  color: var(--text-dark);
  font-size: 0.78rem;
  font-weight: 600;
  transition: all 0.15s ease;
}

.bcy-card:hover .bcy-card-btn {
  background: var(--bcy-midnight);
  color: #ffffff;
}

.bcy-card-btn svg {
  width: 12px;
  height: 12px;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 40px 16px;
}

.empty-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 4px;
}

.empty-sub {
  font-size: 0.82rem;
  color: var(--text-sub);
}

/* ==========================================================
   MODAL DIALOGS (Zero Horizontal Overflow, Clean Sizing)
   ========================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 20, 43, 0.65);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
  overflow-y: auto;
}

.modal-overlay.active {
  display: flex;
}

.modal-dialog {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
  width: 100%;
  max-width: 860px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin: auto;
  box-sizing: border-box;
  animation: modalIn 0.18s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

.modal-mail-dialog {
  max-width: 680px;
}

.modal-bahadir-dialog {
  max-width: 760px;
}

/* Modal Header */
.detail-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #f8fafc;
}

.modal-logo-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-header-logo-box {
  width: 38px;
  height: 38px;
  border-radius: 6px;
  background: #ffffff;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.detail-header-left h2 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-dark);
}

.detail-meta-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.detail-badge-country {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-sub);
  background: var(--bg-subtle);
  padding: 1px 6px;
  border-radius: 4px;
}

.detail-meta-dot {
  color: var(--text-muted);
}

.detail-website-link {
  font-size: 0.76rem;
  font-weight: 600;
  color: #2563eb;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.detail-website-link svg {
  width: 11px;
  height: 11px;
}

.detail-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.status-selector-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-sub);
}

.bcy-status-select {
  padding: 5px 8px;
  border-radius: 4px;
  border: 1px solid var(--border-light);
  background: #ffffff;
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-dark);
  outline: none;
}

.modal-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all 0.15s ease;
}

.modal-close:hover {
  background: var(--border-light);
  color: var(--text-dark);
}

.modal-close svg {
  width: 15px;
  height: 15px;
}

.modal-subtitle {
  font-size: 0.78rem;
  color: var(--text-sub);
}

/* Detail Body: 50% 50% Desktop, Stacking on Tablet */
.detail-body-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  flex: 1;
  overflow-y: auto;
}

@media (max-width: 768px) {
  .detail-body-grid {
    grid-template-columns: 1fr;
  }
}

.detail-photo-panel {
  padding: 18px;
  border-right: 1px solid var(--border-light);
  background: #fafbfc;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

@media (max-width: 768px) {
  .detail-photo-panel {
    border-right: none;
    border-bottom: 1px solid var(--border-light);
  }
}

.photo-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.photo-title {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-sub);
}

.photo-tools {
  display: flex;
  align-items: center;
  gap: 5px;
}

.btn-tool {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 4px;
  background: #ffffff;
  border: 1px solid var(--border-light);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-dark);
}

.btn-tool svg {
  width: 12px;
  height: 12px;
}

.photo-viewport {
  width: 100%;
  height: 280px;
  background: #0f172a;
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-large-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform 0.2s ease;
}

.photo-empty {
  color: var(--text-muted);
  font-size: 0.78rem;
}

.photo-hint {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 6px;
}

/* Right Info Panel */
.detail-info-panel {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  min-width: 0;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

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

.form-label {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-dark);
}

.form-sub-hint {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.bcy-input {
  padding: 7px 10px;
  border-radius: 4px;
  border: 1px solid var(--border-light);
  background: #ffffff;
  font-family: inherit;
  font-size: 0.8rem;
  color: var(--text-dark);
  outline: none;
}

.bcy-textarea {
  padding: 8px 10px;
  border-radius: 4px;
  border: 1px solid var(--border-light);
  background: #ffffff;
  font-family: inherit;
  font-size: 0.8rem;
  color: var(--text-dark);
  line-height: 1.4;
  resize: vertical;
  outline: none;
}

.detail-address-box {
  padding: 6px 10px;
  background: var(--bg-subtle);
  border-radius: 4px;
  font-size: 0.76rem;
  color: var(--text-sub);
}

/* Contacts Section */
.detail-contacts-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

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

.section-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-dark);
}

.section-badge {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
}

.contacts-cards-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.contact-card-item {
  background: var(--bg-subtle);
  border-radius: 6px;
  padding: 8px 10px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.contact-thumb-wrap {
  width: 40px;
  height: 40px;
  border-radius: 4px;
  overflow: hidden;
  background: #0f172a;
  flex-shrink: 0;
  cursor: pointer;
}

.contact-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.contact-info-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.contact-name-title {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}

.contact-name {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-dark);
}

.contact-title {
  font-size: 0.72rem;
  color: var(--text-sub);
}

.contact-links-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
}

.contact-link-pill {
  font-size: 0.72rem;
  font-weight: 600;
  color: #2563eb;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.contact-link-pill svg {
  width: 11px;
  height: 11px;
}

/* Detail Actions Bar */
.detail-actions-bar {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  transition: all 0.15s ease;
}

.btn-secondary {
  background: #ffffff;
  border: 1px solid var(--border-light);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: var(--bg-subtle);
}

.btn-primary {
  background: var(--bcy-midnight);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--bcy-midnight-hover);
}

/* ==========================================================
   MAIL MODAL STYLES (Simple, No Language Toggle)
   ========================================================== */
.mail-modal-body {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.mail-templates-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-light);
}

.template-label {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-sub);
}

.template-chips {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}

.tpl-chip {
  padding: 4px 9px;
  border-radius: 4px;
  border: none;
  background: var(--bg-subtle);
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-main);
}

.tpl-chip.active {
  background: var(--bcy-midnight);
  color: #ffffff;
}

.mail-fields-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mail-footer-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--border-light);
}

/* ==========================================================
   BAHADIR BEY EXECUTIVE REPORT
   ========================================================== */
.bahadir-body {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 70vh;
  overflow-y: auto;
}

.exec-summary-card {
  background: var(--bcy-midnight);
  color: #ffffff;
  padding: 16px 18px;
  border-radius: 8px;
}

.exec-card-title {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #38bdf8;
  margin-bottom: 4px;
}

.exec-summary-paragraph {
  font-size: 0.95rem;
  line-height: 1.6;
  color: #ffffff;
  font-weight: 500;
}

.exec-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.exec-section-title {
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-dark);
}

.priority-cards-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.priority-row {
  background: var(--bg-subtle);
  border-radius: 6px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.priority-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-dark);
}

.priority-note {
  font-size: 0.72rem;
  color: var(--text-sub);
  font-style: italic;
  margin-left: 4px;
}

.exec-timeline-box {
  background: var(--bg-subtle);
  border-radius: 6px;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 140px;
  overflow-y: auto;
}

.timeline-entry {
  font-size: 0.74rem;
  color: var(--text-sub);
  line-height: 1.35;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border-light);
}

.timeline-entry:last-child {
  border-bottom: none;
}

/* ==========================================================
   LIGHTBOX MODAL
   ========================================================== */
.modal-lightbox-overlay {
  background: rgba(0, 0, 0, 0.92);
}

.lightbox-container {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-close {
  position: absolute;
  top: -34px;
  right: 0;
  color: #ffffff;
  width: 28px;
  height: 28px;
}

.lightbox-close svg {
  width: 20px;
  height: 20px;
}

.lightbox-img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 8px;
}

/* ==========================================================
   TOAST NOTIFICATION
   ========================================================== */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000000;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.toast {
  background: var(--bcy-midnight);
  color: #ffffff;
  padding: 10px 16px;
  border-radius: 6px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  font-size: 0.8rem;
  font-weight: 600;
  animation: toastIn 0.15s ease;
}

.auth-error-alert {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #b91c1c;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.4;
  margin-top: 12px;
  animation: toastIn 0.2s ease;
  word-break: break-word;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================
   USER AUTH & HEADER PROFILE BADGE
   ========================================================== */
.bcy-user-profile-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.user-badge-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 0.8rem;
}

.user-role-tag {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.role-superadmin {
  background: #08142b;
  color: #ffffff;
}

.role-engineer {
  background: #0284c7;
  color: #ffffff;
}

.role-hr {
  background: #0d9488;
  color: #ffffff;
}

.user-name-text {
  font-weight: 600;
  color: var(--text-dark);
}

.btn-auth-action {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid var(--border-light);
  background: var(--bg-white);
  color: var(--text-main);
  transition: all 0.15s ease;
}

.btn-auth-action:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

/* ==========================================================
   AUTH / LOGIN MODAL
   ========================================================== */
.auth-modal-dialog {
  max-width: 440px;
  width: 90%;
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  padding: 28px;
  border: 1px solid var(--border-light);
}

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

.auth-brand {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  color: var(--bcy-midnight);
}

.auth-title {
  margin: 8px 0 4px;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-dark);
}

.auth-subtitle {
  font-size: 0.8rem;
  color: var(--text-sub);
  margin: 0;
}

.quick-users-bar {
  margin-bottom: 18px;
  padding: 10px;
  background: var(--bg-subtle);
  border-radius: 6px;
  border: 1px solid var(--border-light);
}

.quick-users-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-sub);
  margin-bottom: 6px;
  display: block;
}

.quick-user-chips {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.quick-user-chip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 4px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.quick-user-chip:hover {
  background: #f8fafc;
  border-color: #0284c7;
}

.chip-role {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
}

/* ==========================================================
   MAILBOX ACCOUNT SWITCHER
   ========================================================== */
.mailbox-selector-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  margin-bottom: 16px;
  overflow-x: auto;
}

.mailbox-selector-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-sub);
  text-transform: uppercase;
  white-space: nowrap;
  margin-right: 4px;
}

.account-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s ease;
}

.account-pill:hover {
  background: #e2e8f0;
}

.account-pill.active {
  background: var(--bcy-midnight);
  color: #ffffff;
  border-color: var(--bcy-midnight);
}

.account-badge-count {
  font-size: 0.68rem;
  font-weight: 700;
  background: #ef4444;
  color: #ffffff;
  padding: 1px 6px;
  border-radius: 10px;
}

.account-service-tag {
  font-size: 0.68rem;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.service-yavuzlar {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.service-bcy-exec {
  background: #dbeafe;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

.account-pill.active .service-yavuzlar {
  background: #fbbf24;
  color: #78350f;
  border-color: #f59e0b;
}

.account-pill.active .service-bcy-exec {
  background: #60a5fa;
  color: #0f172a;
  border-color: #3b82f6;
}

body.auth-locked .main-container {
  filter: blur(8px);
  pointer-events: none;
  user-select: none;
  opacity: 0.2;
}

body.auth-locked .bcy-user-profile-bar {
  display: none !important;
}

body.auth-locked .bcy-nav-links {
  pointer-events: none;
  opacity: 0.2;
}

body.auth-locked .mobile-bottom-nav {
  display: none !important;
}

/* ==========================================================
   GMAIL-STYLE WEBMAIL LAYOUT
   ========================================================== */
.webmail-container {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 16px;
  min-height: 640px;
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  overflow: hidden;
}

.webmail-sidebar {
  border-right: 1px solid var(--border-light);
  padding: 16px 12px;
  background: #fafbfc;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.btn-compose-mail {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 11px 16px;
  background: var(--bcy-midnight);
  color: #ffffff;
  border-radius: 6px;
  font-size: 0.86rem;
  font-weight: 700;
  transition: background 0.15s ease;
}

.btn-compose-mail:hover {
  background: var(--bcy-midnight-hover);
}

.btn-compose-mail svg {
  width: 16px;
  height: 16px;
}

.webmail-nav-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.webmail-nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.12s ease;
}

.webmail-nav-item:hover {
  background: #f1f5f9;
  color: var(--text-dark);
}

.webmail-nav-item.active {
  background: #e2e8f0;
  color: var(--bcy-midnight);
  font-weight: 700;
}

.webmail-nav-item-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.webmail-nav-item svg {
  width: 16px;
  height: 16px;
  color: var(--text-sub);
}

.webmail-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  background: #e2e8f0;
  color: var(--text-dark);
}

.webmail-badge.badge-danger {
  background: #fee2e2;
  color: #991b1b;
}

/* ==========================================================
   WEBMAIL LIST & READING PANE
   ========================================================== */
.webmail-content-area {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.webmail-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  gap: 12px;
}

.webmail-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: 6px 12px;
  flex: 1;
  max-width: 460px;
}

.webmail-search-box svg {
  width: 14px;
  height: 14px;
  color: var(--text-sub);
}

.webmail-search-box input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.82rem;
  width: 100%;
  font-family: inherit;
}

.webmail-messages-list {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow-y: auto;
}

.mail-row-item {
  display: grid;
  grid-template-columns: 36px 180px 1fr 100px;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: background 0.1s ease;
  font-size: 0.82rem;
}

.mail-row-item:hover {
  background: #f8fafc;
}

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

.mail-row-item.read {
  background: #fbfcfd;
  color: var(--text-sub);
}

.mail-row-item.unread .mail-sender,
.mail-row-item.unread .mail-subject-title {
  color: var(--text-dark);
}

.mail-star-btn {
  color: #cbd5e1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mail-star-btn.starred {
  color: #f59e0b;
}

.mail-star-btn svg {
  width: 16px;
  height: 16px;
}

.mail-sender {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mail-subject-line {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mail-subject-title {
  font-weight: inherit;
}

.mail-snippet {
  color: var(--text-muted);
  font-weight: 400;
}

.mail-spam-tag {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: #fee2e2;
  color: #991b1b;
  white-space: nowrap;
}

.mail-date {
  text-align: right;
  font-size: 0.74rem;
  color: var(--text-muted);
}

/* ==========================================================
   MAIL READING MODAL / PANE
   ========================================================== */
.mail-view-dialog {
  max-width: 840px;
  width: 95%;
  background: #ffffff;
  border-radius: 8px;
  border: 1px solid var(--border-light);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  max-height: 85vh;
}

.mail-view-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.mail-view-subject {
  margin: 0 0 8px;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-dark);
}

.mail-view-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  font-size: 0.8rem;
  color: var(--text-sub);
}

.mail-view-body-box {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-main);
}

/* BCY Smart Spam Shield Warning Alert */
.spam-shield-banner {
  margin: 0 20px 16px;
  padding: 14px 18px;
  border-radius: 6px;
  background: #fff1f2;
  border: 1px solid #fecdd3;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.spam-shield-icon svg {
  width: 24px;
  height: 24px;
  color: #e11d48;
}

.spam-shield-content {
  flex: 1;
}

.spam-shield-title {
  font-size: 0.84rem;
  font-weight: 800;
  color: #9f1239;
  margin-bottom: 4px;
}

.spam-shield-desc {
  font-size: 0.78rem;
  color: #881337;
  line-height: 1.4;
  margin: 0;
}

.spam-shield-actions {
  margin-top: 8px;
  display: flex;
  gap: 8px;
}

.btn-shield-action {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 4px;
  border: 1px solid #fda4af;
  background: #ffffff;
  color: #9f1239;
  cursor: pointer;
}

.btn-shield-action:hover {
  background: #fff;
  border-color: #e11d48;
}

.attachments-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 20px;
  background: var(--bg-subtle);
  border-top: 1px solid var(--border-light);
}

.attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-dark);
}

.attachment-chip svg {
  width: 14px;
  height: 14px;
  color: var(--text-sub);
}

/* ==========================================================
   AUTO-COMPLETE SUGGESTIONS POPUP
   ========================================================== */
.autocomplete-wrapper {
  position: relative;
  width: 100%;
}

.suggestions-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
  max-height: 200px;
  overflow-y: auto;
  z-index: 1500;
  margin-top: 4px;
}

.suggestion-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  font-size: 0.78rem;
  cursor: pointer;
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.1s ease;
}

.suggestion-item:last-child {
  border-bottom: none;
}

.suggestion-item:hover {
  background: #f8fafc;
}

.suggestion-main {
  display: flex;
  flex-direction: column;
}

.suggestion-name {
  font-weight: 700;
  color: var(--text-dark);
}

.suggestion-email {
  font-size: 0.7rem;
  color: var(--text-sub);
}

.suggestion-company {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* ==========================================================
   ADMIN SETTINGS & USER MANAGEMENT
   ========================================================== */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  text-align: left;
}

.admin-table th {
  padding: 10px 12px;
  background: var(--bg-subtle);
  border-bottom: 2px solid var(--border-light);
  font-weight: 700;
  color: var(--text-sub);
}

.admin-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-main);
}

.admin-table tr:hover td {
  background: #fafbfc;
}

/* ==========================================================
   MAIL ATTACHMENTS (UPLOAD & DOWNLOAD SYSTEM)
   ========================================================== */
.compose-attach-box {
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  padding: 10px 14px;
  margin-top: 4px;
}

.btn-attach-picker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #0284c7;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-attach-picker:hover {
  background: #f0f9ff;
  border-color: #0284c7;
}

.compose-attached-files-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.compose-attach-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 0.74rem;
  color: #1e293b;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.attach-chip-name {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

.attach-chip-size {
  color: #64748b;
  font-size: 0.68rem;
}

.btn-remove-attach {
  background: transparent;
  border: none;
  color: #ef4444;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}

.btn-remove-attach:hover {
  color: #b91c1c;
}

/* Downloadable Attachment Chips in Mail Reader */
.attachment-download-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 6px 12px;
  text-decoration: none;
  color: #0284c7;
  font-weight: 600;
  font-size: 0.76rem;
  transition: all 0.15s ease;
  cursor: pointer;
}

.attachment-download-chip:hover {
  background: #e0f2fe;
  border-color: #0284c7;
  color: #0369a1;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.15);
  transform: translateY(-1px);
}

.attach-download-label {
  background: #0284c7;
  color: #ffffff;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  margin-left: 2px;
}

.attachment-download-chip:hover .attach-download-label {
  background: #0369a1;
}

/* ==========================================================
   MOBILE & PWA RESPONSIVE DESIGN (iOS & Android)
   ========================================================== */

.mobile-bottom-nav {
  display: none;
}

.ios-install-banner {
  display: none;
}

@media (max-width: 768px) {
  /* Safe Area & Bottom Spacing for iPhone Notch/Home Bar */
  body {
    padding-bottom: calc(68px + env(safe-area-inset-bottom));
  }

  /* Header adjustments on mobile */
  .bcy-header {
    padding: 8px 14px;
    height: auto;
  }

  .bcy-nav-container {
    flex-wrap: wrap;
    gap: 8px;
  }

  .bcy-nav-links {
    display: none; /* Replaced by Mobile Bottom Navigation */
  }

  .bcy-brand-wrap {
    gap: 8px;
  }

  .bcy-brand-logo {
    font-size: 1.1rem;
    padding: 4px 8px;
  }

  .bcy-platform-tag {
    font-size: 0.65rem;
  }

  .bcy-user-profile-bar {
    margin-left: auto;
  }

  .user-name-text {
    display: none; /* Conserve space, show badge */
  }

  .btn-auth-action {
    padding: 4px 8px;
    font-size: 0.72rem;
  }

  /* Mobile Bottom Navigation Bar (iOS / Android) */
  .mobile-bottom-nav {
    display: flex;
    align-items: center;
    justify-content: space-around;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 62px;
    padding-bottom: env(safe-area-inset-bottom);
    background: rgba(15, 23, 42, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.25);
    z-index: 9999;
  }

  .mobile-nav-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: #94a3b8;
    padding: 6px 0;
    gap: 3px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.68rem;
    font-weight: 600;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-nav-btn svg {
    width: 22px;
    height: 22px;
    transition: transform 0.2s ease, stroke 0.2s ease;
  }

  .mobile-nav-btn.active {
    color: #38bdf8;
  }

  .mobile-nav-btn.active svg {
    stroke: #38bdf8;
    transform: translateY(-2px);
  }

  .mobile-nav-icon-wrap {
    position: relative;
    display: inline-flex;
  }

  .mobile-badge {
    position: absolute;
    top: -4px;
    right: -8px;
    background: #ef4444;
    color: #ffffff;
    font-size: 0.6rem;
    font-weight: 800;
    padding: 1px 5px;
    border-radius: 10px;
    border: 2px solid #0f172a;
    line-height: 1.2;
  }

  /* Center Floating Action Button (FAB) for Instant Mail Compose */
  .mobile-nav-fab {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0284c7, #0369a1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    cursor: pointer;
    margin-top: -18px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-nav-fab:active {
    transform: scale(0.92);
  }

  .mobile-nav-fab svg {
    width: 24px;
    height: 24px;
    stroke: #ffffff;
  }

  /* iOS PWA Install Prompt Banner */
  .ios-install-banner {
    display: block;
    position: fixed;
    bottom: calc(72px + env(safe-area-inset-bottom));
    left: 12px;
    right: 12px;
    background: #0f172a;
    border: 1px solid #0284c7;
    border-radius: 12px;
    padding: 12px 14px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    z-index: 9998;
    animation: slideUpFade 0.3s ease-out;
  }

  .ios-install-content {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #ffffff;
  }

  .ios-install-icon {
    flex-shrink: 0;
  }

  .ios-install-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 0.75rem;
    color: #cbd5e1;
    line-height: 1.35;
  }

  .ios-install-text strong {
    color: #38bdf8;
    font-size: 0.82rem;
  }

  .ios-install-close {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 1.4rem;
    padding: 4px;
    cursor: pointer;
    line-height: 1;
  }

  @keyframes slideUpFade {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
  }

  /* Webmail Mobile Layout Overrides */
  .webmail-container {
    flex-direction: column;
    border-radius: 8px;
    overflow: hidden;
  }

  .webmail-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border-light);
    padding: 12px;
  }

  .webmail-nav-list {
    display: flex;
    overflow-x: auto;
    padding-bottom: 4px;
    gap: 6px;
    -webkit-overflow-scrolling: touch;
  }

  .webmail-nav-item {
    flex-shrink: 0;
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid var(--border-light);
  }

  .webmail-content-area {
    padding: 10px;
  }

  .webmail-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .webmail-msg-item {
    padding: 12px 10px;
    min-height: 54px;
  }

  /* Full Screen Compose Modal on Mobile */
  #modalComposeWebmail .modal-container {
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    border-radius: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
  }

  #modalComposeWebmail .modal-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  #modalComposeWebmail .mail-compose-editor {
    min-height: 180px;
  }
}

/* ==========================================================
   STRICT CORPORATE AUTH GATEWAY (DIRECT LOGIN SCREEN)
   ========================================================== */
body.auth-locked {
  overflow: hidden;
  background: #0b132b;
}

body.auth-locked .header,
body.auth-locked .main-content,
body.auth-locked .mobile-bottom-bar,
body.auth-locked #iosInstallBanner {
  display: none !important;
}

body.auth-locked #modalAuth {
  display: flex !important;
  opacity: 1 !important;
  visibility: visible !important;
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: radial-gradient(circle at 50% 25%, #1c2541 0%, #0b132b 100%);
  align-items: center;
  justify-content: center;
  padding: 24px;
}

body.auth-locked #modalAuth .auth-modal-dialog {
  max-width: 440px;
  width: 100%;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.1);
  padding: 34px 30px;
  animation: modalScaleIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================
   GOOGLE-STYLE MAILBOX PICKER SCREEN
   ========================================================== */
.mailbox-picker-container {
  padding: 10px 0 30px;
  max-width: 1200px;
  margin: 0 auto;
}

.mailbox-picker-hero {
  background: linear-gradient(135deg, #0b132b 0%, #1c2541 100%);
  border-radius: 14px;
  padding: 30px 32px;
  color: #ffffff;
  margin-bottom: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.mailbox-picker-headline {
  font-size: 1.55rem;
  font-weight: 800;
  color: #ffffff;
  margin: 0 0 8px 0;
  letter-spacing: -0.02em;
}

.mailbox-picker-sub {
  font-size: 0.95rem;
  color: #e2e8f0;
  line-height: 1.5;
  margin: 0;
  font-weight: 400;
}

.mailbox-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}

.mailbox-picker-card {
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: 14px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  position: relative;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.04);
}

.mailbox-picker-card:hover {
  transform: translateY(-4px);
  border-color: #0284c7;
  box-shadow: 0 16px 32px -6px rgba(2, 132, 199, 0.18);
}

.mailbox-card-header {
  display: flex;
  align-items: center;
  gap: 16px;
}

.mailbox-card-avatar {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: #0b132b;
  color: #38bdf8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.mailbox-card-meta {
  flex: 1;
  min-width: 0;
}

.mailbox-card-email {
  font-size: 1.12rem;
  font-weight: 800;
  color: #0b132b;
  margin-bottom: 2px;
  word-break: break-all;
}

.mailbox-card-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: #64748b;
}

.mailbox-card-desc {
  font-size: 0.86rem;
  color: #475569;
  line-height: 1.45;
  margin: 0;
}

.mailbox-card-stats {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #f1f5f9;
}

.mailbox-stat-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: #334155;
  font-weight: 500;
}

.mailbox-stat-num {
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 10px;
  font-size: 0.76rem;
}

.stat-inbox .mailbox-stat-num {
  background: #e0f2fe;
  color: #0369a1;
}

.stat-spam .mailbox-stat-num {
  background: #fee2e2;
  color: #b91c1c;
}

.mailbox-card-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  background: #0b132b;
  color: #ffffff;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 700;
  transition: all 0.15s ease;
  border: none;
  cursor: pointer;
  width: 100%;
}

.mailbox-picker-card:hover .mailbox-card-btn {
  background: #0284c7;
  color: #ffffff;
}



