
:root{--bg:#f5f7fb;--card:#fff;--ink:#182230;--muted:#667085;--line:#e4e7ec;--nav:#111827;--nav2:#253248;--brand:#f59e0b;--brand2:#fff7ed;--ok:#15803d;--warn:#b45309;--bad:#b42318;--blue:#175cd3}
*{box-sizing:border-box}html,body{margin:0;min-height:100%;font-family:Inter,Arial,sans-serif;background:var(--bg);color:var(--ink)}a{text-decoration:none;color:inherit}
.layout{min-height:100vh;display:grid;grid-template-columns:260px minmax(0,1fr)}
.sidebar{background:var(--nav);color:#fff;padding:0;position:sticky;top:0;height:100vh;display:flex;flex-direction:column;overflow:hidden;border-right:1px solid rgba(255,255,255,0.06);z-index:20}
.sidebar-header{position:sticky;top:0;z-index:10;background:var(--nav);padding:14px 14px 10px;border-bottom:1px solid rgba(255,255,255,0.08);flex-shrink:0}
.sidebar-header-row{display:flex;align-items:center;justify-content:space-between;width:100%;gap:10px}
.sidebar-toggle-btn{display:none;align-items:center;justify-content:center;background:transparent;border:1px solid var(--line);color:inherit;border-radius:8px;padding:6px 9px;cursor:pointer;line-height:1;transition:all .15s ease}
.sidebar-toggle-btn:hover{background:var(--nav2);color:var(--brand)}
body.dark-mode .sidebar-toggle-btn{border-color:#334155;background:#1e293b;color:#cbd5e1}
body.dark-mode .sidebar-toggle-btn:hover{background:#334155;color:#fff}
.sidebar-close-btn{display:none;align-items:center;justify-content:center;background:rgba(255,255,255,0.08);border:0;color:#cbd5e1;border-radius:6px;width:32px;height:32px;cursor:pointer;flex-shrink:0;transition:all .15s ease}
.sidebar-close-btn:hover{background:rgba(255,255,255,0.2);color:#fff}
.sidebar-backdrop{display:none}
body.sidebar-locked{overflow:hidden}
.sidebar-body{flex:1;overflow-y:auto;overflow-x:hidden;padding:10px 12px;scrollbar-width:thin;scrollbar-color:rgba(255,255,255,0.18) transparent}
.sidebar-footer{position:sticky;bottom:0;z-index:10;background:var(--nav);padding:12px 14px;border-top:1px solid rgba(255,255,255,0.08);flex-shrink:0;display:flex;flex-direction:column;gap:8px}
.sidebar-user-card{display:flex;align-items:center;gap:10px;padding:4px 2px}
.sidebar-user-avatar{width:32px;height:32px;border-radius:50%;background:var(--brand);color:#111827;font-weight:800;font-size:13px;display:flex;align-items:center;justify-content:center;flex-shrink:0}
.sidebar-user-details{min-width:0;flex:1}
.sidebar-user-name{font-size:12px;font-weight:700;color:#f8fafc;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sidebar-user-role{font-size:10.5px;color:#94a3b8;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sidebar-logout-btn{display:flex;align-items:center;gap:8px;padding:8px 10px;border-radius:8px;color:#f87171;background:rgba(239,68,68,0.08);font-size:12px;font-weight:600;transition:all .15s ease;text-decoration:none}
.sidebar-logout-btn:hover{background:rgba(239,68,68,0.18);color:#fca5a5}
.brand{font-size:20px;font-weight:800;padding:2px 4px 6px;margin:0;line-height:1.2}
.brand small{display:block;color:#cbd5e1;font-size:11px;font-weight:400;margin-top:3px}
.brand-has-logo{padding:2px 4px 6px;display:flex;align-items:center;min-height:46px}
.brand-has-logo a{display:flex;align-items:center;width:100%;max-width:100%}
.sidebar-brand-logo{max-width:100%;max-height:46px;width:auto;height:auto;object-fit:contain;display:block;border-radius:10px;overflow:hidden}
.brand-logo-dropzone{border:2px dashed var(--line);border-radius:12px;padding:22px 16px;text-align:center;cursor:pointer;background:var(--bg);transition:all .2s ease}
.brand-logo-dropzone:hover,.brand-logo-dropzone.dragover{border-color:var(--brand);background:var(--brand2)}
body.dark-mode .brand-logo-dropzone{border-color:#334155;background:#0f172a}
body.dark-mode .brand-logo-dropzone:hover,body.dark-mode .brand-logo-dropzone.dragover{border-color:var(--brand);background:#1e293b}
.nav{display:flex;flex-direction:column;gap:2px}
.nav a{display:flex;align-items:center;gap:10px;padding:8px 11px;border-radius:8px;color:#cbd5e1;margin:1px 0;font-size:13px;font-weight:500;line-height:1.4;letter-spacing:-0.01em;transition:all .15s ease;text-decoration:none}
.nav a:hover{background:var(--nav2);color:#fff}
.nav a.active{background:var(--nav2);color:#fff;font-weight:600}
.nav-icon{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;flex-shrink:0;color:#94a3b8;transition:color .15s ease}
.nav a:hover .nav-icon,.nav a.active .nav-icon{color:var(--brand)}
.nav-text{flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.main{min-width:0}.topbar{background:#fff;border-bottom:1px solid var(--line);padding:13px 22px;display:flex;justify-content:space-between;gap:10px;align-items:center;position:sticky;top:0;z-index:10}.content{padding:22px;max-width:1500px;margin:auto}.footer{text-align:center;padding:22px;color:var(--muted);font-size:12px}
.hero{background:linear-gradient(135deg,var(--brand2),#fff);border:1px solid #fed7aa;border-radius:18px;padding:22px;margin-bottom:18px}.hero h1{margin:0 0 7px}.muted{color:var(--muted)}
.grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}.grid2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.card{background:var(--card);border:1px solid var(--line);border-radius:14px;padding:16px;box-shadow:0 2px 12px #1018280a;margin-bottom:14px}.kpi span{font-size:12px;color:var(--muted);font-weight:700}.kpi b{font-size:25px;display:block;margin-top:8px}
h1,h2,h3{margin-top:0}.actions{display:flex;flex-wrap:wrap;gap:9px;margin:14px 0}.btn,button{border:0;border-radius:9px;padding:10px 14px;background:var(--brand);color:#fff;font-weight:700;cursor:pointer}.btn.dark,button.dark{background:#111827}.btn.light,button.light{background:#fff;color:#182230;border:1px solid var(--line)}.btn.bad,button.bad{background:var(--bad)}.btn.blue,button.blue{background:var(--blue)}button:disabled{opacity:.5;cursor:not-allowed}
label{display:block;font-size:12px;font-weight:800;margin:10px 0 5px}input,select,textarea{width:100%;padding:10px;border:1px solid #d0d5dd;border-radius:8px;background:#fff;color:#182230}textarea{min-height:80px}.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 14px}.form-grid3{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:0 14px}
.table-wrap{overflow:auto;background:#fff;border:1px solid var(--line);border-radius:12px}table{border-collapse:collapse;width:100%;min-width:760px}th,td{padding:10px 11px;border-bottom:1px solid var(--line);text-align:left;font-size:13px;vertical-align:top}th{background:#f9fafb;font-size:12px}tr:last-child td{border-bottom:0}
.badge{display:inline-block;padding:4px 8px;border-radius:999px;font-size:11px;font-weight:800;background:#eef2ff}.paid,.online,.active{background:#dcfce7;color:#166534}.pending{background:#ffedd5;color:#9a3412}.cancelled,.suspended,.offline{background:#fee2e2;color:#991b1b}
.badge-master-admin{display:inline-flex;align-items:center;gap:4px;padding:3px 9px;border-radius:999px;font-size:10.5px;font-weight:700;letter-spacing:0.3px;white-space:nowrap;background:rgba(245,158,11,0.16);color:#b45309;border:1px solid rgba(245,158,11,0.35);vertical-align:middle}
body.dark-mode .badge-master-admin{background:rgba(245,158,11,0.18);color:#fbbf24;border-color:rgba(245,158,11,0.45)}
.searchbar{display:flex;gap:8px;align-items:center;margin:10px 0}.searchbar input{max-width:430px}.section-title{display:flex;justify-content:space-between;gap:10px;align-items:center}
.login-page,body.login-page{min-height:100vh;display:grid;place-items:center;background:radial-gradient(circle at 50% 20%,#1e293b 0,#0b1120 65%,#070d19 100%) !important;color:#f8fafc;padding:20px 12px}.login-card{width:min(440px,92vw);background:#1e293b;border:1px solid #334155;border-radius:22px;padding:32px 28px;box-shadow:0 24px 70px rgba(0,0,0,0.55),0 0 0 1px rgba(255,255,255,0.05);color:#f8fafc}.egg{font-size:52px;line-height:1;margin-bottom:6px;display:inline-block}.login-card h1{margin:0 0 5px;font-size:26px;font-weight:800;color:#f8fafc}.login-brand-container{text-align:center;margin-bottom:22px}.login-brand-container.has-brand-logo{min-height:70px;display:flex;align-items:center;justify-content:center;margin-bottom:24px}.login-brand-logo{max-width:100%;max-height:80px;width:auto;height:auto;object-fit:contain;display:block;margin:0 auto;border-radius:12px;overflow:hidden}.login-page input{background:#0f172a!important;border:1px solid #334155!important;color:#f8fafc!important}.login-page input:focus{border-color:var(--brand)!important;outline:none;box-shadow:0 0 0 3px rgba(245,158,11,0.25)!important}.login-page .btn.light{background:#0f172a;border-color:#334155;color:#f8fafc;transition:all .15s ease}.login-page .btn.light:hover{background:#253248;border-color:var(--brand);color:#fff}
.invoice-paper{background:#fff;border:1px solid var(--line);border-radius:12px;padding:24px;max-width:950px;margin:auto}.paper-head{display:flex;justify-content:space-between;gap:20px;border-bottom:2px solid #111827;padding-bottom:14px;margin-bottom:14px}.invoice-brand-wrap{margin-bottom:10px}.invoice-brand-logo{max-width:260px;max-height:75px;width:auto;height:auto;object-fit:contain;display:block;border-radius:10px;overflow:hidden}.totals{margin-left:auto;max-width:330px}.totals div{display:flex;justify-content:space-between;padding:5px}.totals .grand{font-size:18px;font-weight:800;border-top:2px solid #111827;margin-top:5px;padding-top:9px}
.portal-page{max-width:1450px;margin:auto;padding:22px}.portal-top{display:flex;justify-content:space-between;gap:14px;align-items:center}.signature-box{border:1px dashed #98a2b3;background:#fff;border-radius:12px;padding:15px}.signature-pad{height:140px;background:#f9fafb;border:1px solid var(--line);border-radius:9px;display:grid;place-items:center;color:var(--muted)}
.checks{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}.checks label{border:1px solid var(--line);padding:8px;border-radius:8px;margin:0;font-weight:600}.checks input{width:auto;margin-right:6px}
.note{padding:11px;border-radius:9px;background:#eff8ff;border:1px solid #b2ddff;color:#1849a9;font-size:13px}.warning{background:#fff7ed;border-color:#fed7aa;color:#9a3412}
@media(max-width:950px){
  .layout{grid-template-columns:1fr;display:block}
  .sidebar{position:fixed;top:0;left:0;bottom:0;width:280px;max-width:84vw;height:100vh;height:100dvh;z-index:1050;transform:translateX(-100%);transition:transform .28s cubic-bezier(0.16,1,0.3,1),box-shadow .28s ease;box-shadow:none;display:flex;flex-direction:column;overflow:hidden;border-right:1px solid rgba(255,255,255,0.12)}
  .layout.sidebar-open .sidebar,.sidebar.open{transform:translateX(0);box-shadow:14px 0 40px rgba(0,0,0,0.65)}
  .sidebar-header{position:sticky;top:0;z-index:10;background:var(--nav);padding:14px}
  .sidebar-body{flex:1;overflow-y:auto;overflow-x:hidden}
  .sidebar-footer{position:sticky;bottom:0;z-index:10;background:var(--nav)}
  .sidebar-backdrop{display:block;position:fixed;inset:0;background:rgba(3,7,18,0.65);backdrop-filter:blur(2px);-webkit-backdrop-filter:blur(2px);z-index:1040;opacity:0;pointer-events:none;transition:opacity .25s ease}
  .layout.sidebar-open .sidebar-backdrop,.sidebar-backdrop.active{opacity:1;pointer-events:auto}
  .sidebar-toggle-btn{display:inline-flex}
  .sidebar-close-btn{display:inline-flex}
  .grid{grid-template-columns:repeat(2,1fr)}
  .form-grid3{grid-template-columns:1fr 1fr}
  .topbar{position:sticky;top:0;z-index:20;padding:10px 16px}
}
@media(max-width:620px){
  .grid,.grid2,.form-grid,.form-grid3{grid-template-columns:1fr}
  .content,.portal-page{padding:12px}
  .paper-head,.portal-top{display:block}
  .checks{grid-template-columns:1fr}
}
@media print{body{background:#fff}.sidebar,.topbar,.footer,.no-print{display:none!important}.layout{display:block}.content,.portal-page{padding:0;max-width:none}.invoice-paper,.print-area{border:0;box-shadow:none;margin:0;max-width:none}.invoice-brand-logo{max-width:200px;max-height:60px;object-fit:contain;border-radius:8px;overflow:hidden}.thermal-print{width:80mm!important;font-size:11px!important}.thermal-print table{min-width:0!important}}

/* Global Brand Logo Styling */
.sidebar-brand-logo,
.invoice-brand-logo,
.login-brand-logo,
.portal-brand-logo,
.portal-header-logo,
.docked-footer-logo,
#brandLogoPreviewImg,
#loginBrandImg,
.brand-logo-img {
  border-radius: 10px !important;
  overflow: hidden !important;
}
.sidebar-brand-logo,
#brandLogoPreviewImg {
  box-shadow: 0 2px 10px rgba(0,0,0,0.18);
}
.invoice-brand-logo {
  box-shadow: 0 1px 6px rgba(0,0,0,0.08);
}

/* 80mm Thermal Printer Modal & Print Architecture */
.printer-modal-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(15,23,42,0.65);z-index:9999;display:none;align-items:center;justify-content:center;padding:16px;backdrop-filter:blur(3px)}
.printer-modal-card{background:#fff;border-radius:18px;max-width:760px;width:100%;max-height:92vh;overflow-y:auto;padding:26px;box-shadow:0 24px 60px rgba(0,0,0,0.35);border:1px solid var(--line)}
.printer-modal-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:8px}
.printer-modal-head h3{margin:0;font-size:19px;font-weight:800}
.printer-modal-close{background:#f1f5f9;border:0;border-radius:50%;width:32px;height:32px;cursor:pointer;font-weight:800;font-size:15px;display:grid;place-items:center;color:#475569}
.printer-options-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:14px;margin-top:14px}
.print-opt-box{border:1px solid var(--line);border-radius:14px;padding:16px;background:#f8fafc;display:flex;flex-direction:column;justify-content:space-between;text-align:center}
.print-opt-box h4{margin:6px 0;font-size:14px;font-weight:800}
.print-opt-box p{font-size:12px;color:var(--muted);margin:0 0 12px;line-height:1.4}
.opt-badge{display:inline-block;font-size:10px;font-weight:800;padding:3px 7px;border-radius:6px;text-transform:uppercase;margin:0 auto 4px}
.opt-1{background:#dbeafe;color:#1d4ed8}
.opt-2{background:#d1fae5;color:#047857}
.opt-3{background:#fef3c7;color:#b45309}
.receipt-preview-box{background:#fffef5;border:1px dashed #cbd5e1;border-radius:10px;padding:14px;max-height:190px;overflow-y:auto;box-shadow:inset 0 2px 6px rgba(0,0,0,0.03)}

#thermalPrintRoot{display:none}

/* Thermal Print Specific Styles */
@media print{
  body.printing-thermal-mode{background:#fff!important;margin:0!important;padding:0!important}
  body.printing-thermal-mode .layout,
  body.printing-thermal-mode .sidebar,
  body.printing-thermal-mode .topbar,
  body.printing-thermal-mode .footer,
  body.printing-thermal-mode .content,
  body.printing-thermal-mode .printer-modal-overlay{display:none!important}
  body.printing-thermal-mode #thermalPrintRoot{
    display:block!important;
    width:72mm!important;
    max-width:72mm!important;
    margin:0 auto!important;
    padding:2mm!important;
    color:#000!important;
    font-family:'Courier New',Courier,monospace!important;
    font-size:11px!important;
    line-height:1.35!important;
  }
  body.printing-thermal-mode #thermalPrintRoot table{min-width:0!important;width:100%!important;border-collapse:collapse}
  body.printing-thermal-mode #thermalPrintRoot th,
  body.printing-thermal-mode #thermalPrintRoot td{padding:2px 0!important;border:0!important;font-size:10px!important}
  body.printing-thermal-mode #thermalPrintRoot h2{font-size:14px!important;margin:0 0 2px!important;text-align:center}
  body.printing-thermal-mode #thermalPrintRoot h3{font-size:12px!important;margin:0 0 4px!important;text-align:center}
  body.printing-thermal-mode #thermalPrintRoot p{font-size:10px!important;margin:2px 0!important;text-align:center}
  body.printing-thermal-mode .dash-line{white-space:nowrap;overflow:hidden;margin:3px 0;font-weight:700}
  body.printing-thermal-mode .receipt-totals div{display:flex;justify-content:space-between;padding:1px 0}
  body.printing-thermal-mode .receipt-totals .grand{font-weight:800;font-size:12px;border-top:1px dashed #000;margin-top:3px;padding-top:3px}
}
@media(max-width:768px){.printer-options-grid{grid-template-columns:1fr}}

/* Custom Sleek Scrollbars (Standard & WebKit) */
html {
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
  border: 2px solid transparent;
  background-clip: padding-box;
}

/* Sidebar Specific Scrollbar */
.sidebar {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}
.sidebar::-webkit-scrollbar {
  width: 5px;
}
.sidebar::-webkit-scrollbar-track {
  background: transparent;
}
.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
}
.sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.35);
}

/* Global Dark Mode Theme */
body.dark-mode {
  --bg: #0b1120;
  --card: #1e293b;
  --ink: #f8fafc;
  --muted: #94a3b8;
  --line: #334155;
  --nav: #070d19;
  --nav2: #1e293b;
  --brand2: #451a03;
  color-scheme: dark;
  scrollbar-width: thin;
  scrollbar-color: #334155 transparent;
}
html:has(body.dark-mode),
html:has(body.login-page) {
  color-scheme: dark;
  background: #070d19;
  scrollbar-color: #334155 transparent;
}

/* Dark Mode Scrollbars for WebKit/Blink */
body.dark-mode ::-webkit-scrollbar-track,
html:has(body.dark-mode) ::-webkit-scrollbar-track {
  background: transparent;
}
body.dark-mode ::-webkit-scrollbar-thumb,
html:has(body.dark-mode) ::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
body.dark-mode ::-webkit-scrollbar-thumb:hover,
html:has(body.dark-mode) ::-webkit-scrollbar-thumb:hover {
  background: #475569;
  border: 2px solid transparent;
  background-clip: padding-box;
}
body.dark-mode ::-webkit-scrollbar-thumb:active,
html:has(body.dark-mode) ::-webkit-scrollbar-thumb:active {
  background: var(--brand);
}
body.dark-mode .topbar {
  background: #0f172a;
  border-color: #334155;
}
body.dark-mode input,
body.dark-mode select,
body.dark-mode textarea {
  background: #0f172a;
  border-color: #334155;
  color: #f8fafc;
}
body.dark-mode .table-wrap,
body.dark-mode .invoice-paper,
body.dark-mode .printer-modal-card {
  background: #1e293b;
  border-color: #334155;
  color: #f8fafc;
}
body.dark-mode .paper-head {
  border-bottom-color: #334155;
}
body.dark-mode .totals .grand {
  border-top-color: #334155;
}
body.dark-mode th {
  background: #0f172a;
  color: #cbd5e1;
  border-color: #334155;
}
body.dark-mode td {
  border-color: #334155;
}
body.dark-mode .btn.light,
body.dark-mode button.light {
  background: #0f172a;
  color: #f8fafc;
  border-color: #334155;
}
body.dark-mode .btn.dark,
body.dark-mode button.dark {
  background: #334155;
  color: #f8fafc;
  border: 1px solid #475569;
}
body.dark-mode .hero {
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border-color: #334155;
}
body.dark-mode .print-opt-box {
  background: #0f172a;
  border-color: #334155;
}
body.dark-mode .receipt-preview-box {
  background: #0f172a;
  border-color: #334155;
  color: #f8fafc;
}
body.dark-mode .note {
  background: #1e293b;
  border-color: #334155;
  color: #93c5fd;
}
body.dark-mode .note.warning {
  background: #2a1b12;
  border-color: #7c2d12;
  color: #fdba74;
}
body.dark-mode .signature-box,
body.dark-mode .signature-pad {
  background: #0f172a;
  border-color: #334155;
}
body.dark-mode .login-card,
body.login-page .login-card {
  background: #1e293b;
  border-color: #334155;
  color: #f8fafc;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.05);
}
body.login-page,
body.dark-mode.login-page,
body.login-page.dark-mode,
body.dark-mode .login-page {
  background: radial-gradient(circle at 50% 20%, #1e293b 0%, #0b1120 65%, #070d19 100%) !important;
  color: #f8fafc;
}

/* In-App Custom Modal Dialog System */
.egg-modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.75);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  backdrop-filter: blur(4px);
  animation: eggFadeIn 0.15s ease-out;
}
.egg-modal-box {
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 18px;
  max-width: 480px;
  width: 100%;
  padding: 24px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
  animation: eggPopIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.egg-modal-box h3 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 800;
}
.egg-modal-box p {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}
.egg-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}
.egg-modal-box.modal-lg {
  max-width: 680px;
}
.egg-canvas-wrap {
  border: 2px dashed var(--line);
  border-radius: 12px;
  background: #ffffff;
  touch-action: none;
  cursor: crosshair;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 12px 0;
  overflow: hidden;
}
#sigCanvas {
  display: block;
  width: 100%;
  max-width: 500px;
  height: 180px;
  touch-action: none;
}
.sig-tools {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
}
@keyframes eggFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes eggPopIn { from { transform: scale(0.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* Docked 3-Column Dashboard Fixed Footer */
.dashboard-docked-footer {
  position: fixed;
  bottom: 0;
  left: 255px;
  right: 0;
  z-index: 999;
  background: #ffffff;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding: 10px 24px;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
  font-size: 13px;
  line-height: 1.4;
  box-sizing: border-box;
}
.docked-footer-col {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  word-break: break-word;
}
.docked-footer-col.col-2 {
  text-align: center;
  padding: 0 12px;
}
.docked-footer-col.col-3 {
  text-align: right;
}
.docked-footer-col p {
  margin: 2px 0 0;
}
.docked-footer-col small {
  color: var(--muted);
}
.docked-footer-col a {
  color: var(--brand);
  text-decoration: underline;
}

/* Ensure page content never gets blocked by the docked footer */
.content {
  padding-bottom: 95px !important;
}

.footer-preview-box {
  background: var(--nav);
  border: 1px solid var(--line);
  border-radius: 10px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding: 12px 20px;
  color: #f8fafc;
  font-size: 13px;
  line-height: 1.4;
  margin-top: 12px;
}

.malta-time-widget {
  display: inline-flex;
  flex-direction: column;
  text-align: right;
}
.malta-time-widget .time {
  display: flex;
  flex-direction: column;
}
#malta-time {
  font-weight: 700;
  color: #38bdf8;
}

@media (max-width: 950px) {
  .dashboard-docked-footer {
    left: 0;
  }
}
@media (max-width: 768px) {
  .dashboard-docked-footer {
    grid-template-columns: 1fr;
    gap: 8px;
    text-align: center;
    padding: 10px 16px;
    font-size: 12px;
  }
  .docked-footer-col.col-3 {
    text-align: center;
  }
  .malta-time-widget {
    text-align: center;
  }
  .content {
    padding-bottom: 140px !important;
  }
  .footer-preview-box {
    grid-template-columns: 1fr;
  }
}

/* Dark Mode Support for Docked Footer */
body.dark-mode .dashboard-docked-footer {
  background: #0f172a;
  border-top: 1px solid #334155;
  color: #f8fafc;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
}

/* Color Accent Preset Circles */
.accent-color-preset {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  padding: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}
.accent-color-preset:hover {
  transform: scale(1.15);
}
.accent-color-preset.active {
  border-color: #ffffff;
  outline: 2px solid var(--brand);
  transform: scale(1.18);
  box-shadow: 0 0 12px var(--brand);
}
.accent-color-preset:not(.active) {
  color: transparent;
}



