/* ==============================================================================
   MTravel Rent — CRM Styles (High-Density Fintech Dashboard)
   ============================================================================== */

:root {
  --primary: #2E8CFF;
  --primary-hover: #1A7CEB;
  --yellow: #FFD200;
  
  --slate-900: #0F172A;
  --slate-800: #1E293B;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-500: #64748B;
  --slate-200: #E2E8F0;
  --slate-100: #F1F5F9;
  --slate-50:  #F8FAFC;
  
  --green: #10B981;
  --amber: #F59E0B;
  --red:   #EF4444;
  --blue:  #3B82F6;
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
  background: var(--slate-50);
  color: var(--slate-900);
  font-size: 13px;
  line-height: 1.45;
}

/* ==============================================================================
   LOGIN SCREEN
   ============================================================================== */

.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--slate-100);
  padding: 20px;
}

.login-card {
  background: #FFFFFF;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  padding: 32px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

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

.brand-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--slate-900);
  letter-spacing: -0.02em;
}

.brand-subtitle {
  font-size: 13px;
  color: var(--slate-500);
  margin-top: 4px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.error-msg {
  background: #FEE2E2;
  color: #991B1B;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
}

/* ==============================================================================
   DASHBOARD TOPBAR
   ============================================================================== */

.dashboard-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.crm-topbar {
  background: #FFFFFF;
  border-bottom: 1px solid var(--slate-200);
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

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

.logo-mark {
  background: var(--primary);
  color: #FFFFFF;
  font-weight: 800;
  font-size: 14px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}

.logo-sub {
  font-weight: 700;
  font-size: 15px;
  color: var(--slate-800);
}

.topbar-nav {
  display: flex;
  gap: 4px;
  height: 100%;
}

.nav-link {
  background: none;
  border: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--slate-600);
  padding: 0 16px;
  height: 100%;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.15s ease;
}

.nav-link:hover {
  color: var(--slate-900);
}

.nav-link.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-name {
  font-weight: 600;
  color: var(--slate-700);
}

/* ==============================================================================
   MAIN CONTENT
   ============================================================================== */

.crm-main-container {
  flex: 1;
  padding: 24px;
  max-width: 1300px;
  margin: 0 auto;
  width: 100%;
}

.crm-tab-pane {
  display: none;
}

.crm-tab-pane.active {
  display: block;
}

.pane-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.pane-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.pane-desc {
  font-size: 12px;
  color: var(--slate-500);
  margin-top: 2px;
}

/* Tables */
.table-card {
  background: #FFFFFF;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  overflow-x: auto;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th {
  background: #F8FAFC;
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--slate-500);
  border-bottom: 1px solid var(--slate-200);
  letter-spacing: 0.03em;
}

.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--slate-200);
  color: var(--slate-800);
  vertical-align: middle;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.loading-cell {
  text-align: center;
  padding: 32px !important;
  color: var(--slate-500);
}

/* Badges */
.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
}

.badge-pending   { background: #FEF3C7; color: #92400E; }
.badge-confirmed { background: #D1FAE5; color: #065F46; }
.badge-issued    { background: #DBEAFE; color: #1E40AF; }
.badge-completed { background: #F1F5F9; color: #334155; }
.badge-cancelled { background: #FEE2E2; color: #991B1B; }

/* Switch Toggle */
.switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #CBD5E1;
  transition: 0.2s;
  border-radius: 20px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.2s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--green);
}

input:checked + .slider:before {
  transform: translateX(16px);
}

/* Form Controls */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--slate-700);
}

.form-row {
  display: flex;
  gap: 12px;
}

.flex-1 { flex: 1; }

.input-text {
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 13px;
  outline: none;
  background: #FFFFFF;
}

.input-text:focus {
  border-color: var(--primary);
}

/* Buttons */
.btn {
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-primary { background: var(--primary); color: #FFFFFF; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-outline { background: transparent; border: 1px solid var(--slate-200); color: var(--slate-700); }
.btn-outline:hover { background: var(--slate-100); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-block { width: 100%; }

/* Modal */
.crm-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

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

.crm-modal {
  background: #FFFFFF;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 540px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
  overflow: hidden;
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--slate-200);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title { font-size: 15px; font-weight: 700; }
.modal-close { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--slate-500); }
.modal-body { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.modal-footer { display: flex; justify-content: flex-end; margin-top: 6px; }
