/* ============================================
   CRM Follow-Up System - Main Stylesheet
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg:        #0a0f1e;
  --surface:   #111827;
  --surface2:  #1a2332;
  --border:    #1f2d40;
  --text:      #e8edf5;
  --muted:     #6b7a99;
  --accent:    #3b82f6;
  --accent2:   #0ea5e9;
  --green:     #10b981;
  --red:       #ef4444;
  --amber:     #f59e0b;
  --purple:    #8b5cf6;
  --cyan:      #06b6d4;
  --radius:    10px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

/* -- Layout --------------------------------- */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 240px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform .25s;
}

.sidebar-logo {
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo h2 {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.3px;
}
.sidebar-logo span {
  font-size: 11px;
  color: var(--muted);
  display: block;
  margin-top: 2px;
}

.sidebar-nav {
  padding: 16px 12px;
  flex: 1;
  overflow-y: auto;
}
.nav-section {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--muted);
  text-transform: uppercase;
  padding: 8px 8px 4px;
  margin-top: 12px;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: all .15s;
  margin-bottom: 2px;
}
.nav-link:hover  { background: var(--surface2); color: var(--text); }
.nav-link.active { background: rgba(59,130,246,.15); color: var(--accent); }
.nav-link .icon  { width: 18px; text-align: center; font-size: 15px; }
.nav-badge {
  margin-left: auto;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
}

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid var(--border);
}
.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
}
.user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; color: #fff;
  flex-shrink: 0;
}
.user-name  { font-size: 13px; font-weight: 600; }
.user-role  { font-size: 11px; color: var(--muted); }

/* -- Main Content --------------------------- */
.main {
  margin-left: 240px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar h1 {
  font-size: 18px;
  font-weight: 700;
}
.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.content { padding: 28px; }

/* -- Cards / Stats -------------------------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: border-color .15s, transform .1s;
}
a .stat-card, a:hover .stat-card {
  cursor: pointer;
}
a:hover .stat-card {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}
.stat-card.blue::before   { background: var(--accent); }
.stat-card.green::before  { background: var(--green); }
.stat-card.amber::before  { background: var(--amber); }
.stat-card.red::before    { background: var(--red); }
.stat-card.purple::before { background: var(--purple); }
.stat-card.cyan::before   { background: var(--cyan); }

.stat-icon { font-size: 22px; margin-bottom: 12px; }
.stat-value {
  font-size: 28px;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  line-height: 1;
  margin-bottom: 4px;
}
.stat-label { font-size: 12px; color: var(--muted); font-weight: 500; }

/* -- Table ---------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 24px;
}
.p-1 { padding: 4px; }
.p-2 { padding: 8px; }
.p-3 { padding: 16px; }
.p-4 { padding: 24px; }
.px-3 { padding-left: 16px; padding-right: 16px; }
.py-3 { padding-top: 16px; padding-bottom: 16px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 24px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.form-label { display: block; font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}
.card-title { font-size: 14px; font-weight: 700; }
.card-header .ml-auto { margin-left: auto; }

.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
thead th {
  padding: 11px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background .1s;
}
tbody tr:hover { background: var(--surface2); }
tbody tr:last-child { border-bottom: none; }
tbody td {
  padding: 12px 16px;
  vertical-align: middle;
}

/* -- Badges --------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-new         { background: rgba(99,102,241,.2);  color: #a5b4fc; }
.badge-contacted   { background: rgba(6,182,212,.2);   color: #67e8f9; }
.badge-quoted      { background: rgba(245,158,11,.2);  color: #fcd34d; }
.badge-negotiating { background: rgba(139,92,246,.2);  color: #c4b5fd; }
.badge-won         { background: rgba(16,185,129,.2);  color: #6ee7b7; }
.badge-lost        { background: rgba(239,68,68,.2);   color: #fca5a5; }
.badge-hold        { background: rgba(107,114,128,.2); color: #d1d5db; }

/* -- Buttons -------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  border: none;
  transition: all .15s;
  font-family: inherit;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #2563eb; }
.btn-secondary { background: var(--surface2); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-success { background: var(--green); color: #fff; }
.btn-danger  { background: var(--red); color: #fff; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-icon { padding: 7px; width: 32px; height: 32px; justify-content: center; }

/* -- Forms ---------------------------------- */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.form-control {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 13.5px;
  font-family: inherit;
  transition: border .15s;
}
.form-control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59,130,246,.1);
}
textarea.form-control { resize: vertical; min-height: 80px; }
select.form-control { cursor: pointer; }

.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* -- Alert ---------------------------------- */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 20px;
}
.alert-success { background: rgba(16,185,129,.15); color: #6ee7b7; border: 1px solid rgba(16,185,129,.3); }
.alert-danger  { background: rgba(239,68,68,.15);  color: #fca5a5; border: 1px solid rgba(239,68,68,.3); }
.alert-info    { background: rgba(59,130,246,.15); color: #93c5fd; border: 1px solid rgba(59,130,246,.3); }
.alert-warning { background: rgba(245,158,11,.15); color: #fcd34d; border: 1px solid rgba(245,158,11,.3); }

/* -- Search / Filter bar -------------------- */
.filter-bar {
  display: flex;
  gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.filter-bar .form-control { width: auto; flex: 1; min-width: 160px; }

/* -- Modal ---------------------------------- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.7);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px;
  width: 100%;
  max-width: 620px;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-title { font-size: 18px; font-weight: 700; margin-bottom: 20px; }

/* -- Reminder bell -------------------------- */
.bell-btn {
  position: relative;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text); font-size: 16px;
  text-decoration: none;
}
.bell-dot {
  position: absolute;
  top: 5px; right: 5px;
  width: 8px; height: 8px;
  background: var(--red);
  border-radius: 50%;
  border: 1px solid var(--surface);
}

/* -- Followup timeline ---------------------- */
.timeline { padding: 4px 0; }
.timeline-item {
  display: flex;
  gap: 14px;
  padding-bottom: 20px;
  position: relative;
}
.timeline-item:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 14px;
  top: 30px;
  bottom: 0;
  width: 2px;
  background: var(--border);
}
.timeline-dot {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--surface2);
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
}
.timeline-body { flex: 1; }
.timeline-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}
.timeline-meta { font-size: 11px; color: var(--muted); }
.timeline-comment {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  line-height: 1.5;
}

/* -- Login page ----------------------------- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 20px;
}
.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 400px;
}
.login-logo { text-align: center; margin-bottom: 32px; }
.login-logo h1 { font-size: 22px; font-weight: 800; }
.login-logo p { font-size: 13px; color: var(--muted); margin-top: 4px; }

/* -- Utilities ------------------------------ */
.text-muted { color: var(--muted); }
.text-green  { color: var(--green); }
.text-red    { color: var(--red); }
.text-amber  { color: var(--amber); }
.text-accent { color: var(--accent); }
.font-mono   { font-family: 'JetBrains Mono', monospace; }
.fw-700      { font-weight: 700; }
.fs-12       { font-size: 12px; }
.fs-13       { font-size: 13px; }
.mt-4        { margin-top: 4px; }
.mt-8        { margin-top: 8px; }
.mt-16       { margin-top: 16px; }
.mt-24       { margin-top: 24px; }
.mb-16       { margin-bottom: 16px; }
.d-flex      { display: flex; }
.align-center { align-items: center; }
.gap-8       { gap: 8px; }
.gap-12      { gap: 12px; }
.ml-auto     { margin-left: auto; }
.hidden      { display: none !important; }
.truncate    { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; max-width: 200px; }

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}

/* -- Task Board ----------------------------- */
.board-col-wrap { overflow-x: auto; }
.kanban-empty {
  text-align: center;
  padding: 30px 0;
  color: var(--muted);
  font-size: 13px;
}

/* ============================================================
   RESPONSIVE OVERHAUL - mobile-first improvements
   ============================================================ */

/* Topbar mobile button always visible */
@media (max-width: 900px) {
  #menuBtn { display: block !important; }
  .sidebar {
    transform: translateX(-100%);
    transition: transform .25s cubic-bezier(.4,0,.2,1);
    z-index: 200;
    box-shadow: 4px 0 20px rgba(0,0,0,.4);
  }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0 !important; }
  /* Overlay when sidebar open */
  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 199;
  }
  .sidebar-overlay.show { display: block; }
}

@media (max-width: 900px) {
  .content { padding: 14px; }
  .topbar  { padding: 10px 14px; }
  .form-grid-2, .form-grid-3 { grid-template-columns: 1fr !important; }
  .stats-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .table-wrap table { font-size: 12px; }
  .table-wrap table th,
  .table-wrap table td { padding: 8px 10px; }
  /* Hide less-important columns on small screens */
  .hide-mobile { display: none !important; }
  /* Stack card headers */
  .card-header { flex-wrap: wrap; gap: 8px; }
  .ab-layout { grid-template-columns: 1fr !important; }
  .sop-layout { grid-template-columns: 1fr !important; }
  .notif-grid { grid-template-columns: 1fr !important; }
  .roles-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr !important; }
  .stat-value { font-size: 22px !important; }
  .topbar h1  { font-size: 15px; }
  .btn-primary.btn-sm { padding: 6px 10px; font-size: 12px; }
  .modal { padding: 20px 16px; }
  .form-cols-2, .form-cols-3 { grid-template-columns: 1fr !important; }
}

/* -- JOB SHEET STYLES ------------------------ */
.js-status-draft      { background: rgba(107,114,128,.15); color: #9ca3af; }
.js-status-assigned   { background: rgba(59,130,246,.15);  color: #60a5fa; }
.js-status-in_progress{ background: rgba(245,158,11,.15);  color: #fbbf24; }
.js-status-pending_signature { background: rgba(139,92,246,.15); color: #c4b5fd; }
.js-status-completed  { background: rgba(16,185,129,.15);  color: #34d399; }
.js-status-cancelled  { background: rgba(239,68,68,.15);   color: #f87171; }

/* Field builder */
.field-row {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 10px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.field-drag { cursor: grab; color: var(--muted); font-size: 18px; padding-top: 6px; }
.field-row-inner { flex: 1; display: grid; grid-template-columns: 2fr 1fr auto; gap: 8px; align-items: center; }
@media (max-width: 600px) {
  .field-row-inner { grid-template-columns: 1fr; }
}

/* Signature pad */
.sig-pad-wrap {
  border: 2px dashed var(--border);
  border-radius: 10px;
  background: var(--bg);
  overflow: hidden;
  position: relative;
  touch-action: none;
}
.sig-pad-wrap canvas { display: block; }
.sig-actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }

/* Public job sheet page */
.jobsheet-public {
  min-height: 100vh;
  background: var(--bg);
  padding: 0;
}
.jobsheet-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.jobsheet-body { padding: 20px; max-width: 780px; margin: 0 auto; }
.jobsheet-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 16px;
  overflow: hidden;
}
.jobsheet-section-title {
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 700;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
}
.jobsheet-section-body { padding: 16px; }
.jfield-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--muted);
  margin-bottom: 5px;
}
.jfield-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  transition: border .15s;
}
.jfield-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(59,130,246,.1); }
.jfield-static {
  font-size: 13px;
  color: var(--text);
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

/* -- Date Picker Styles -- */
.dp-wrapper { position: relative; display: block; }
.dp-input-wrap { position: relative; display: flex; align-items: center; }
.dp-input-wrap .form-control { padding-right: 36px !important; cursor: pointer !important; caret-color: transparent; }
.dp-trigger-icon { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-size: 11px; font-weight: 700; pointer-events: none; opacity: .5; letter-spacing: -1px; }
.dp-clear-btn { position: absolute; right: 30px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; color: var(--muted); font-size: 16px; padding: 0; line-height: 1; display: none; z-index: 2; }
.dp-clear-btn:hover { color: var(--red); }

/* Popup container - fixed width, never compress */
.dp-popup {
  display: none;
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  z-index: 99999;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 280px !important;
  min-width: 280px !important;
  max-width: 280px !important;
  box-shadow: 0 8px 32px rgba(0,0,0,.4);
  overflow: hidden;
  user-select: none;
  box-sizing: border-box !important;
}
.dp-popup.open { display: block; animation: dpFade .15s ease; }
@keyframes dpFade { from { opacity:0; transform:translateY(-6px); } to { opacity:1; transform:translateY(0); } }

.dp-header {
  display: flex !important;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
  gap: 5px;
  box-sizing: border-box;
}
.dp-nav-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  color: var(--text);
  width: 28px !important;
  height: 28px !important;
  min-width: 28px !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
  padding: 0;
}
.dp-nav-btn:hover { background: var(--bg); }
.dp-month-year {
  flex: 1;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  padding: 3px 4px;
  border-radius: 6px;
  white-space: nowrap;
}
.dp-month-year:hover { background: var(--bg); }

/* Day-of-week header - MUST be 7 equal columns */
.dp-dow-row {
  display: grid !important;
  grid-template-columns: repeat(7, 1fr) !important;
  padding: 8px 10px 3px !important;
  gap: 2px !important;
  width: 100%;
  box-sizing: border-box;
}
.dp-dow {
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
}

/* Days grid - MUST be 7 equal columns */
.dp-days {
  display: grid !important;
  grid-template-columns: repeat(7, 1fr) !important;
  padding: 2px 10px 8px !important;
  gap: 2px !important;
  width: 100%;
  box-sizing: border-box;
}
.dp-day {
  aspect-ratio: 1 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 12px !important;
  border-radius: 6px;
  cursor: pointer;
  color: var(--text);
  border: none;
  background: none;
  font-family: inherit;
  padding: 0 !important;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}
.dp-day:hover:not(.dp-day-other-month):not(.dp-day-selected) { background: var(--surface2); }
.dp-day-today { font-weight: 700; color: var(--accent); position: relative; }
.dp-day-today::after { content:''; position:absolute; bottom:2px; left:50%; transform:translateX(-50%); width:3px; height:3px; border-radius:50%; background:var(--accent); }
.dp-day-selected { background: var(--accent) !important; color: #fff !important; font-weight: 700; }
.dp-day-other-month { color: var(--muted); opacity: .3; }

/* Month/year picker */
.dp-my-picker { display: none; padding: 10px; box-sizing: border-box; }
.dp-my-picker.open { display: block !important; }
.dp-my-grid {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 4px;
  margin-bottom: 8px;
}
.dp-year-scroll {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 4px;
  max-height: 130px;
  overflow-y: auto;
}
.dp-my-item {
  text-align: center;
  padding: 6px 2px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 11px;
  border: none;
  background: none;
  color: var(--text);
  font-family: inherit;
  width: 100%;
}
.dp-my-item:hover { background: var(--surface2); }
.dp-my-item.selected { background: var(--accent); color: #fff; }

/* Footer */
.dp-footer {
  padding: 7px 10px;
  border-top: 1px solid var(--border);
  display: flex !important;
  gap: 5px;
  justify-content: space-between;
  background: var(--surface2);
}
.dp-footer-btn { padding: 5px 12px; border-radius: 6px; font-size: 12px; font-weight: 600; cursor: pointer; border: 1px solid var(--border); background: transparent; color: var(--muted); font-family: inherit; }
.dp-footer-btn:hover { background: var(--bg); color: var(--text); }
.dp-today-btn { color: var(--accent) !important; border-color: var(--accent) !important; }
.dp-clear-footer { color: var(--red) !important; border-color: var(--red) !important; }

/* On very small screens, position popup from right edge instead of left */
@media (max-width: 360px) {
  .dp-popup { left: auto !important; right: 0 !important; }
}