/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #eff6ff;
  --success: #16a34a;
  --success-light: #f0fdf4;
  --warning: #d97706;
  --warning-light: #fffbeb;
  --danger: #dc2626;
  --danger-light: #fef2f2;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.05);
  --shadow: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 15px rgba(0,0,0,.1), 0 4px 6px rgba(0,0,0,.05);
  --radius: 8px;
  --radius-lg: 12px;
  /* ── Branding (overridable via JS) ── */
  --primary-color: #2563eb;
  --sidebar-bg:    #1e293b;
  --accent-color:  #16a34a;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--gray-100);
  color: var(--gray-800);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
}

/* ── Login Page ───────────────────────────────────────────── */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #1e40af 0%, #1d4ed8 50%, #2563eb 100%);
}

.login-container {
  background: white;
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
}

.login-header {
  text-align: center;
  margin-bottom: 28px;
}
.logo-icon { font-size: 48px; margin-bottom: 12px; }
.login-header h1 { font-size: 22px; font-weight: 700; color: var(--gray-900); }
.login-header p { color: var(--gray-500); font-size: 13px; margin-top: 4px; }

.role-tabs {
  display: flex;
  gap: 8px;
  background: var(--gray-100);
  padding: 4px;
  border-radius: var(--radius);
  margin-bottom: 24px;
}
.role-tab {
  flex: 1;
  padding: 9px;
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-500);
  transition: all .2s;
}
.role-tab.active {
  background: white;
  color: var(--primary);
  box-shadow: var(--shadow-sm);
  font-weight: 600;
}

.register-section { margin-top: 20px; }
.divider {
  text-align: center;
  margin: 16px 0;
  position: relative;
  color: var(--gray-400);
  font-size: 12px;
}
.divider::before, .divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 40%;
  height: 1px;
  background: var(--gray-200);
}
.divider::before { left: 0; }
.divider::after { right: 0; }

/* ── App Layout ───────────────────────────────────────────── */
.app-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 240px;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
}

.sidebar-brand {
  padding: 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-brand h2 { color: white; font-size: 15px; font-weight: 700; }
.sidebar-brand p { color: var(--gray-400); font-size: 11px; margin-top: 2px; }

.sidebar-user {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}
.user-info { min-width: 0; }
.user-info .user-name { color: white; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-info .user-role { color: var(--gray-400); font-size: 11px; }

.sidebar-nav { padding: 12px 8px; flex: 1; overflow-y: auto; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px;
  border-radius: 6px;
  color: var(--gray-400);
  cursor: pointer;
  transition: all .15s;
  font-size: 13px;
  font-weight: 500;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  text-decoration: none;
  margin-bottom: 2px;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: white; }
.nav-item.active { background: var(--primary-color); color: white; }
.nav-item .nav-icon { font-size: 16px; flex-shrink: 0; width: 20px; text-align: center; }

.sidebar-footer {
  padding: 12px 8px;
  border-top: 1px solid rgba(255,255,255,.08);
}

.main-content {
  flex: 1;
  margin-left: 240px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  background: white;
  border-bottom: 1px solid var(--gray-200);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-title { font-size: 17px; font-weight: 700; color: var(--gray-900); }
.topbar-actions { display: flex; align-items: center; gap: 10px; }

.page-content { padding: 24px; flex: 1; }

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background: white;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.card-title { font-size: 15px; font-weight: 700; color: var(--gray-800); }

/* ── Stats Grid ───────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-sm);
}
.stat-clickable {
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.stat-clickable:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,.10);
  border-color: var(--primary);
}
.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.stat-icon.blue { background: var(--primary-light); }
.stat-icon.yellow { background: var(--warning-light); }
.stat-icon.green { background: var(--success-light); }
.stat-icon.red { background: var(--danger-light); }
.stat-icon.purple { background: #f5f3ff; }
.stat-value { font-size: 24px; font-weight: 800; color: var(--gray-900); line-height: 1; }
.stat-label { font-size: 12px; color: var(--gray-500); margin-top: 3px; }

/* ── Forms ────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 6px;
}
input[type="text"], input[type="email"], input[type="password"],
input[type="number"], textarea, select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--gray-800);
  background: white;
  transition: border-color .15s, box-shadow .15s;
  font-family: inherit;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
textarea { resize: vertical; min-height: 90px; }

/* ── Buttons ──────────────────────────────────────────────── */
.btn-primary {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; }

.btn-outline {
  background: white;
  color: var(--primary);
  border: 1.5px solid var(--primary);
  padding: 9px 18px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}
.btn-outline:hover { background: var(--primary-light); }

.btn-success {
  background: var(--success);
  color: white;
  border: none;
  padding: 8px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.btn-danger {
  background: var(--danger);
  color: white;
  border: none;
  padding: 8px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-full { width: 100%; }
.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  font-size: 16px;
  transition: background .15s;
}
.btn-icon:hover { background: var(--gray-100); }
.btn-close {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--gray-500);
  padding: 4px 8px;
  border-radius: 6px;
}
.btn-close:hover { background: var(--gray-100); }

/* ── Badges ───────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  text-transform: capitalize;
}
.badge-pending { background: var(--warning-light); color: var(--warning); }
.badge-progress { background: var(--primary-light); color: var(--primary); }
.badge-closed { background: var(--success-light); color: var(--success); }
.badge-normal { background: var(--gray-100); color: var(--gray-600); }
.badge-high { background: var(--warning-light); color: var(--warning); }
.badge-critical { background: var(--danger-light); color: var(--danger); }

/* ── Table ────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th {
  background: var(--gray-50);
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--gray-500);
  border-bottom: 1px solid var(--gray-200);
  white-space: nowrap;
}
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
  font-size: 13px;
}
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--gray-50); cursor: pointer; }

/* ── Modal ────────────────────────────────────────────────── */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}
.modal-box {
  background: white;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal-box.modal-lg { max-width: 700px; }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--gray-200);
  position: sticky;
  top: 0;
  background: white;
  z-index: 1;
}
.modal-header h3 { font-size: 16px; font-weight: 700; }
.modal-body { padding: 20px; }
.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--gray-200);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ── Upload ───────────────────────────────────────────────── */
.upload-area {
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius-lg);
  padding: 28px;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
  background: var(--gray-50);
}
.upload-area:hover, .upload-area.drag-over {
  border-color: var(--primary);
  background: var(--primary-light);
}
.upload-area input { display: none; }
.upload-icon { font-size: 32px; margin-bottom: 8px; }
.upload-text { font-size: 13px; color: var(--gray-500); }
.upload-text strong { color: var(--primary); }
.upload-preview { margin-top: 12px; }
.upload-preview img { max-height: 160px; max-width: 100%; border-radius: var(--radius); border: 1px solid var(--gray-200); }

/* ── Filters bar ──────────────────────────────────────────── */
.filters-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 16px;
}
.filters-bar select, .filters-bar input[type="month"] {
  width: auto;
  padding: 8px 12px;
  font-size: 13px;
}

/* ── Ticket detail ────────────────────────────────────────── */
.ticket-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}
.meta-item { }
.meta-label { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--gray-400); letter-spacing: .5px; margin-bottom: 4px; }
.meta-value { font-size: 14px; color: var(--gray-800); font-weight: 500; }

.description-box {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 14px;
  font-size: 14px;
  color: var(--gray-700);
  margin-bottom: 16px;
  white-space: pre-wrap;
}

.ticket-photo img {
  max-width: 100%;
  max-height: 300px;
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
  cursor: zoom-in;
}

/* ── Section divider ──────────────────────────────────────── */
.section-divider {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--gray-400);
  padding: 4px 0 8px;
  border-bottom: 1px solid var(--gray-200);
  margin-bottom: 14px;
}

/* ── Empty state ──────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--gray-400);
}
.empty-state .empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state p { font-size: 14px; }

/* ── Error & Success msgs ─────────────────────────────────── */
.error-msg {
  background: var(--danger-light);
  color: var(--danger);
  border: 1px solid #fecaca;
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 12px;
}
.success-msg {
  background: var(--success-light);
  color: var(--success);
  border: 1px solid #bbf7d0;
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 12px;
}

/* ── Grid layouts ─────────────────────────────────────────── */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.three-col { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* ── Priority dot ─────────────────────────────────────────── */
.priority-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 5px;
}
.dot-normal { background: var(--gray-400); }
.dot-high { background: var(--warning); }
.dot-critical { background: var(--danger); }

/* ── Lightbox ─────────────────────────────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  cursor: zoom-out;
}
.lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { width: 100%; height: auto; position: relative; }
  .main-content { margin-left: 0; }
  .app-layout { flex-direction: column; }
  .ticket-meta { grid-template-columns: 1fr; }
  .two-col, .three-col { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Modal Tabs ───────────────────────────────────────────── */
.modal-tabs {
  display: flex;
  border-bottom: 2px solid var(--gray-200);
  margin: -20px -20px 16px;
  padding: 0 20px;
  background: var(--gray-50);
  overflow-x: auto;
}
.modal-tab {
  padding: 11px 16px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-500);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  transition: color .15s;
}
.modal-tab:hover { color: var(--gray-700); }
.modal-tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Search bar ───────────────────────────────────────────── */
.search-wrap { position: relative; }
.search-wrap input { padding-left: 34px; }
.search-wrap::before {
  content: '🔍';
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  pointer-events: none;
}

/* ── Comments / Chat ──────────────────────────────────────── */
.comments-wrap {
  max-height: 320px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 0 12px;
}
.comment-bubble { max-width: 88%; display: flex; flex-direction: column; }
.comment-bubble.from-me   { align-self: flex-end; }
.comment-bubble.from-them { align-self: flex-start; }
.bubble-content {
  padding: 9px 13px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.5;
  word-break: break-word;
}
.from-me   .bubble-content { background: var(--primary); color: white; border-radius: 14px 14px 2px 14px; }
.from-them .bubble-content { background: var(--gray-100); color: var(--gray-800); border-radius: 14px 14px 14px 2px; }

/* ── Internal note bubble ──────────────────────── */
.comment-bubble.internal-note {
  align-self: stretch;
  max-width: 100%;
  background: #fffbeb;
  border: 1px dashed #fcd34d;
  border-radius: 10px;
  padding: 10px 14px 8px;
  position: relative;
}
.comment-bubble.internal-note .bubble-content {
  background: transparent;
  color: #78350f;
  border-radius: 0;
  padding: 0;
  font-size: 13px;
}
.comment-bubble.internal-note .bubble-meta {
  color: #d97706;
  font-weight: 600;
}
.comment-bubble.internal-note::before {
  content: '🔒';
  position: absolute;
  top: -10px;
  right: 10px;
  font-size: 14px;
  background: #fffbeb;
  padding: 0 4px;
}

.bubble-meta {
  font-size: 11px;
  color: var(--gray-400);
  margin-top: 4px;
  padding: 0 4px;
}
.from-me .bubble-meta { text-align: right; }

.comment-input-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  align-items: flex-end;
}
.comment-input-row textarea {
  flex: 1;
  min-height: 60px;
  resize: none;
  font-size: 13px;
}
.comment-input-row button { flex-shrink: 0; align-self: flex-end; }

/* ── Timeline / History ───────────────────────────────────── */
.timeline { display: flex; flex-direction: column; }
.timeline-item {
  display: flex;
  gap: 12px;
  padding-bottom: 16px;
  position: relative;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 32px;
  bottom: 0;
  width: 2px;
  background: var(--gray-200);
}
.timeline-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gray-100);
  border: 2px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
  z-index: 1;
}
.timeline-dot.dot-tech   { background: var(--primary-light); border-color: var(--primary); }
.timeline-dot.dot-client { background: var(--success-light); border-color: var(--success); }
.timeline-content { flex: 1; padding-top: 5px; min-width: 0; }
.timeline-action { font-size: 13px; color: var(--gray-700); }
.timeline-meta   { font-size: 11px; color: var(--gray-400); margin-top: 2px; }

/* ── Photo grid ───────────────────────────────────────────── */
.photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px;
}
.photo-thumb {
  aspect-ratio: 1;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: zoom-in;
  border: 2px solid var(--gray-200);
  transition: border-color .15s;
}
.photo-thumb:hover { border-color: var(--primary); }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.upload-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.upload-thumb {
  width: 72px;
  height: 72px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 2px solid var(--gray-200);
  flex-shrink: 0;
}
.upload-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* ── Change password modal ────────────────────────────────── */
.pwd-modal .modal-box { max-width: 380px; }

/* ── Print styles ─────────────────────────────────────────── */
@media print {
  .sidebar, .topbar, .filters-bar, button, .btn-primary, .btn-outline, .btn-danger { display: none !important; }
  .main-content { margin-left: 0 !important; }
  .page-content { padding: 0 !important; }
  .card { border: 1px solid #ccc; box-shadow: none; page-break-inside: avoid; }
  body { background: white; }
}

/* ── Timer widget ─────────────────────────────────────────── */
.timer-widget {
  background: var(--gray-900);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  text-align: center;
  margin-bottom: 16px;
}
.timer-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--gray-400);
  margin-bottom: 10px;
}
.timer-display {
  font-size: 46px;
  font-weight: 800;
  color: white;
  font-family: 'Courier New', monospace;
  letter-spacing: 3px;
  line-height: 1;
  margin-bottom: 14px;
  transition: color .3s;
}
.timer-display.running { color: #4ade80; }
.timer-display.paused  { color: #fbbf24; }
.timer-controls { display: flex; gap: 8px; justify-content: center; margin-bottom: 10px; }
.timer-btn {
  padding: 9px 18px;
  border: none;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, transform .1s;
  letter-spacing: .3px;
}
.timer-btn:active { transform: scale(.96); }
.timer-btn.play  { background: #16a34a; color: white; }
.timer-btn.play:hover  { background: #15803d; }
.timer-btn.pause { background: #d97706; color: white; }
.timer-btn.pause:hover { background: #b45309; }
.timer-btn.stop  { background: #dc2626; color: white; }
.timer-btn.stop:hover  { background: #b91c1c; }
.timer-hint { font-size: 11px; color: var(--gray-500); }
.timer-saved {
  font-size: 12px;
  color: #4ade80;
  margin-top: 6px;
  display: none;
}

/* ── Login welcome animation ─────────────────────────────── */
@keyframes fadeIn { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:translateY(0); } }
@keyframes spin   { to { transform:rotate(360deg); } }

/* ── Equipment Age Badge ─────────────────────────────────── */
.age-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .3px;
}
.age-green  { background: #dcfce7; color: #15803d; }
.age-yellow { background: #fef9c3; color: #a16207; }
.age-red    { background: #fee2e2; color: #b91c1c; }

/* ── Upgrade list ────────────────────────────────────────── */
.upgrade-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.upgrade-item {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.upgrade-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.upgrade-type {
  font-weight: 700;
  font-size: 13px;
  color: var(--gray-800);
}
.upgrade-date {
  font-size: 12px;
  color: var(--gray-400);
  margin-left: auto;
}
.upgrade-desc {
  font-size: 13px;
  color: var(--gray-700);
  margin-bottom: 4px;
}
.upgrade-meta {
  font-size: 11px;
  color: var(--gray-400);
}

/* ── Section divider (reuse) ─────────────────────────────── */
.section-divider {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--gray-400);
  border-bottom: 1px solid var(--gray-200);
  padding-bottom: 4px;
  margin-bottom: 8px;
}

/* ── Calendar ────────────────────────────────────────────── */
.calendar-grid {
  background: var(--white);
  border-radius: 12px;
  border: 1px solid var(--gray-200);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.cal-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: var(--primary);
}
.cal-day-name {
  padding: 10px 0;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: rgba(255,255,255,.85);
  text-transform: uppercase;
  letter-spacing: .5px;
}
.cal-body {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-top: 1px solid var(--gray-200);
}
.cal-cell {
  min-height: 90px;
  border-right: 1px solid var(--gray-100);
  border-bottom: 1px solid var(--gray-100);
  padding: 6px;
  cursor: pointer;
  transition: background .15s;
  vertical-align: top;
}
.cal-cell:hover { background: var(--gray-50); }
.cal-cell:nth-child(7n) { border-right: none; }
.cal-empty { background: var(--gray-50); cursor: default; }
.cal-today { background: #eff6ff !important; }
.cal-today .cal-date {
  background: var(--primary);
  color: white;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cal-date {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 4px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cal-events-wrap { display: flex; flex-direction: column; gap: 2px; }
.cal-event-chip {
  font-size: 10px;
  color: white;
  padding: 2px 5px;
  border-radius: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  font-weight: 500;
  max-width: 100%;
}
.cal-event-chip:hover { opacity: .85; }
.cal-more {
  font-size: 10px;
  color: var(--gray-400);
  padding: 1px 4px;
  cursor: pointer;
}
@media (max-width: 768px) {
  .cal-cell { min-height: 60px; padding: 4px; }
  .cal-event-chip { font-size: 9px; }
}

/* ── Module Tabs (Cotizaciones / Facturas) ─────────────────── */
.tab-btn {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 8px 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-400);
  cursor: pointer;
  transition: color .15s, border-color .15s;
  margin-bottom: -2px;
}
.tab-btn:hover { color: var(--primary); }
.tab-btn.tab-active { color: var(--primary); border-bottom-color: var(--primary); }

/* Factura status badges */
.badge-vigente   { background:#dcfce7; color:#166534; }
.badge-cancelada { background:#fee2e2; color:#991b1b; }
.badge-pendiente { background:#fef3c7; color:#92400e; }
.badge-vencida   { background:#fee2e2; color:#991b1b; }
