:root {
  --bg: #e7f8ff;
  --panel: rgba(255, 255, 255, 0.74);
  --panel-strong: #f8fdff;
  --surface: rgba(255, 255, 255, 0.74);
  --surface-strong: rgba(248, 253, 255, 0.96);
  --field-bg: rgba(255, 255, 255, 0.78);
  --ghost-bg: rgba(248, 253, 255, 0.84);
  --line: #aee5ff;
  --line-soft: #d6f3ff;
  --text: #10293a;
  --muted: #537086;
  --primary: #37aee2;
  --primary-dark: #168dc4;
  --primary-strong: var(--primary-dark);
  --accent: var(--primary);
  --accent-soft: color-mix(in srgb, var(--primary) 82%, #ffffff 18%);
  --accent-strong: var(--primary-dark);
  --on-primary: #10293a;
  --primary-gradient: linear-gradient(135deg, #2fb4e8, #74d4f3);
  --primary-hover: linear-gradient(135deg, #159fda 0%, #3cc2ee 48%, #8ee3fb 100%);
  --app-bg:
    linear-gradient(135deg, rgba(207, 248, 255, 0.96), rgba(255, 244, 251, 0.92)),
    #e7f8ff;
  --topbar-bg:
    linear-gradient(135deg, rgba(135, 220, 247, 0.94) 0%, rgba(203, 246, 255, 0.96) 42%, rgba(116, 203, 236, 0.9) 100%);
  --calendar-guide-bg: linear-gradient(180deg, rgba(176, 227, 247, 0.98), rgba(206, 241, 255, 0.96));
  --calendar-time-bg: linear-gradient(90deg, rgba(165, 223, 247, 0.98), rgba(210, 244, 255, 0.98));
  --cell-a: linear-gradient(180deg, rgba(243, 253, 255, 0.78), rgba(231, 249, 255, 0.72));
  --cell-b: linear-gradient(180deg, rgba(225, 246, 253, 0.82), rgba(214, 241, 251, 0.76));
  --cell-hover: linear-gradient(180deg, rgba(204, 244, 255, 0.9), rgba(230, 251, 255, 0.82));
  --month-color: #168dc4;
  --greeting-color: #214f66;
  --name-color: #1188c4;
  --name-stain:
    radial-gradient(ellipse at 50% 48%, rgba(236, 250, 255, 0.82) 0 20%, transparent 42%),
    radial-gradient(circle at 10% 42%, rgba(0, 76, 184, 0.64) 0 13%, transparent 28%),
    radial-gradient(circle at 24% 28%, rgba(24, 130, 235, 0.56) 0 18%, transparent 36%),
    radial-gradient(circle at 48% 70%, rgba(72, 169, 255, 0.45) 0 17%, transparent 33%),
    radial-gradient(circle at 78% 40%, rgba(0, 95, 205, 0.58) 0 20%, transparent 39%),
    radial-gradient(circle at 94% 58%, rgba(8, 70, 172, 0.54) 0 13%, transparent 30%),
    linear-gradient(112deg, rgba(5, 93, 204, 0.52), rgba(117, 195, 255, 0.6) 42%, rgba(0, 91, 202, 0.5));
  --name-splatter:
    radial-gradient(circle at 16% 78%, rgba(0, 76, 184, 0.24) 0 5%, transparent 9%),
    radial-gradient(circle at 88% 17%, rgba(0, 83, 188, 0.22) 0 4%, transparent 8%),
    radial-gradient(circle at 98% 55%, rgba(0, 92, 204, 0.18) 0 6%, transparent 12%);
  --name-glow: rgba(0, 79, 145, 0.2);
  --name-stroke: rgba(0, 80, 140, 0.2);
  --danger: #df2f35;
  --green: #1f9a57;
  --shadow: 0 18px 50px rgba(24, 124, 166, 0.16);
  --radius: 8px;
  color-scheme: light;
}

body[data-theme="mint"] {
  --bg: #e8fff7;
  --surface: rgba(248, 255, 252, 0.78);
  --surface-strong: rgba(247, 255, 252, 0.96);
  --field-bg: rgba(250, 255, 253, 0.84);
  --ghost-bg: rgba(248, 255, 252, 0.86);
  --line: #9eead8;
  --line-soft: #d1f7ee;
  --primary: #1aa982;
  --primary-dark: #0a8265;
  --primary-gradient: linear-gradient(135deg, #15a87f, #6ee5c7);
  --primary-hover: linear-gradient(135deg, #078d6a 0%, #22c79a 52%, #94f0dc 100%);
  --app-bg:
    linear-gradient(135deg, rgba(224, 255, 246, 0.96), rgba(245, 255, 252, 0.94)),
    #e8fff7;
  --topbar-bg:
    linear-gradient(135deg, rgba(113, 224, 196, 0.95), rgba(203, 255, 242, 0.97) 44%, rgba(96, 206, 184, 0.9));
  --calendar-guide-bg: linear-gradient(180deg, rgba(171, 236, 219, 0.98), rgba(215, 252, 242, 0.96));
  --calendar-time-bg: linear-gradient(90deg, rgba(152, 226, 210, 0.98), rgba(218, 255, 246, 0.98));
  --cell-a: linear-gradient(180deg, rgba(244, 255, 251, 0.88), rgba(229, 251, 244, 0.78));
  --cell-b: linear-gradient(180deg, rgba(226, 249, 242, 0.86), rgba(213, 244, 236, 0.78));
  --cell-hover: linear-gradient(180deg, rgba(199, 248, 235, 0.92), rgba(235, 255, 249, 0.86));
  --month-color: #0a8265;
  --greeting-color: #245f55;
  --name-color: #087a63;
  --name-stain:
    radial-gradient(ellipse at 50% 48%, rgba(241, 255, 251, 0.86) 0 20%, transparent 42%),
    radial-gradient(circle at 13% 42%, rgba(0, 136, 106, 0.48) 0 14%, transparent 29%),
    radial-gradient(circle at 30% 28%, rgba(31, 188, 150, 0.46) 0 18%, transparent 36%),
    radial-gradient(circle at 62% 69%, rgba(129, 232, 204, 0.4) 0 18%, transparent 35%),
    radial-gradient(circle at 84% 40%, rgba(0, 126, 103, 0.46) 0 20%, transparent 39%),
    linear-gradient(112deg, rgba(19, 157, 124, 0.48), rgba(131, 235, 210, 0.6), rgba(27, 145, 121, 0.45));
  --name-splatter:
    radial-gradient(circle at 16% 78%, rgba(0, 126, 103, 0.16) 0 5%, transparent 9%),
    radial-gradient(circle at 88% 17%, rgba(31, 188, 150, 0.14) 0 4%, transparent 8%),
    radial-gradient(circle at 98% 55%, rgba(15, 112, 92, 0.12) 0 6%, transparent 12%);
  --name-glow: rgba(15, 112, 92, 0.16);
  --name-stroke: rgba(0, 100, 82, 0.16);
}

body[data-theme="amarillo"] {
  --bg: #fff9df;
  --surface: rgba(255, 253, 239, 0.82);
  --surface-strong: rgba(255, 253, 244, 0.97);
  --field-bg: rgba(255, 254, 246, 0.9);
  --ghost-bg: rgba(255, 253, 241, 0.88);
  --line: #f0d67a;
  --line-soft: #f8edbb;
  --primary: #e8b923;
  --primary-dark: #a97c00;
  --primary-gradient: linear-gradient(135deg, #dfaa14, #ffe27e);
  --primary-hover: linear-gradient(135deg, #be8700 0%, #ecc23d 52%, #fff0a9 100%);
  --app-bg:
    linear-gradient(135deg, rgba(255, 248, 207, 0.98), rgba(255, 242, 174, 0.94)),
    #fff9df;
  --topbar-bg:
    linear-gradient(135deg, rgba(255, 218, 107, 0.94), rgba(255, 246, 198, 0.96) 47%, rgba(255, 229, 142, 0.9));
  --calendar-guide-bg: linear-gradient(180deg, rgba(247, 223, 146, 0.98), rgba(255, 246, 205, 0.96));
  --calendar-time-bg: linear-gradient(90deg, rgba(244, 216, 132, 0.98), rgba(255, 249, 219, 0.98));
  --cell-a: linear-gradient(180deg, rgba(255, 254, 246, 0.88), rgba(255, 249, 224, 0.78));
  --cell-b: linear-gradient(180deg, rgba(255, 247, 211, 0.82), rgba(255, 241, 187, 0.7));
  --cell-hover: linear-gradient(180deg, rgba(255, 238, 167, 0.92), rgba(255, 252, 229, 0.86));
  --month-color: #ad7d00;
  --greeting-color: #725b18;
  --name-color: #b47c00;
  --name-stain:
    radial-gradient(ellipse at 50% 48%, rgba(255, 253, 228, 0.88) 0 20%, transparent 42%),
    radial-gradient(circle at 12% 43%, rgba(213, 148, 0, 0.5) 0 14%, transparent 30%),
    radial-gradient(circle at 29% 29%, rgba(240, 190, 35, 0.52) 0 18%, transparent 36%),
    radial-gradient(circle at 58% 70%, rgba(255, 221, 94, 0.45) 0 18%, transparent 35%),
    radial-gradient(circle at 84% 40%, rgba(194, 128, 0, 0.44) 0 20%, transparent 39%),
    linear-gradient(112deg, rgba(212, 151, 0, 0.46), rgba(255, 224, 105, 0.62), rgba(199, 132, 0, 0.42));
  --name-splatter:
    radial-gradient(circle at 16% 78%, rgba(194, 128, 0, 0.14) 0 5%, transparent 9%),
    radial-gradient(circle at 88% 17%, rgba(213, 148, 0, 0.12) 0 4%, transparent 8%),
    radial-gradient(circle at 98% 55%, rgba(163, 112, 0, 0.1) 0 6%, transparent 12%);
  --name-glow: rgba(171, 120, 0, 0.16);
  --name-stroke: rgba(151, 101, 0, 0.16);
}

body[data-theme="verde"] {
  --bg: #effcef;
  --surface: rgba(249, 255, 249, 0.8);
  --surface-strong: rgba(249, 255, 250, 0.97);
  --field-bg: rgba(252, 255, 252, 0.88);
  --ghost-bg: rgba(249, 255, 250, 0.88);
  --line: #a4e0ab;
  --line-soft: #d9f4dc;
  --primary: #70bf7a;
  --primary-dark: #3b8f47;
  --primary-gradient: linear-gradient(135deg, #55ad62, #aee8b5);
  --primary-hover: linear-gradient(135deg, #3f954b 0%, #72c57c 52%, #cef4d2 100%);
  --app-bg:
    linear-gradient(135deg, rgba(235, 252, 235, 0.98), rgba(247, 255, 244, 0.93)),
    #effcef;
  --topbar-bg:
    linear-gradient(135deg, rgba(137, 218, 146, 0.94), rgba(223, 250, 226, 0.97) 48%, rgba(155, 225, 162, 0.9));
  --calendar-guide-bg: linear-gradient(180deg, rgba(187, 234, 193, 0.98), rgba(226, 251, 229, 0.96));
  --calendar-time-bg: linear-gradient(90deg, rgba(173, 226, 180, 0.98), rgba(236, 255, 238, 0.98));
  --cell-a: linear-gradient(180deg, rgba(250, 255, 250, 0.88), rgba(235, 250, 237, 0.78));
  --cell-b: linear-gradient(180deg, rgba(229, 248, 231, 0.84), rgba(217, 243, 220, 0.76));
  --cell-hover: linear-gradient(180deg, rgba(205, 244, 211, 0.92), rgba(240, 255, 242, 0.86));
  --month-color: #3b8f47;
  --greeting-color: #2e6540;
  --name-color: #348a42;
  --name-stain:
    radial-gradient(ellipse at 50% 48%, rgba(246, 255, 247, 0.88) 0 20%, transparent 42%),
    radial-gradient(circle at 12% 43%, rgba(54, 152, 68, 0.48) 0 14%, transparent 30%),
    radial-gradient(circle at 29% 29%, rgba(100, 197, 111, 0.48) 0 18%, transparent 36%),
    radial-gradient(circle at 58% 70%, rgba(177, 235, 183, 0.44) 0 18%, transparent 35%),
    radial-gradient(circle at 84% 40%, rgba(43, 137, 58, 0.45) 0 20%, transparent 39%),
    linear-gradient(112deg, rgba(62, 157, 75, 0.48), rgba(174, 234, 181, 0.62), rgba(55, 134, 68, 0.42));
  --name-splatter:
    radial-gradient(circle at 16% 78%, rgba(43, 137, 58, 0.15) 0 5%, transparent 9%),
    radial-gradient(circle at 88% 17%, rgba(100, 197, 111, 0.13) 0 4%, transparent 8%),
    radial-gradient(circle at 98% 55%, rgba(38, 120, 52, 0.11) 0 6%, transparent 12%);
  --name-glow: rgba(43, 137, 58, 0.16);
  --name-stroke: rgba(38, 120, 52, 0.16);
}

body[data-theme="morado"] {
  --bg: #f6f0ff;
  --surface: rgba(252, 249, 255, 0.82);
  --surface-strong: rgba(253, 250, 255, 0.97);
  --field-bg: rgba(254, 252, 255, 0.9);
  --ghost-bg: rgba(253, 250, 255, 0.88);
  --line: #c9b3f2;
  --line-soft: #eadcff;
  --primary: #a77be8;
  --primary-dark: #7549bb;
  --primary-gradient: linear-gradient(135deg, #8b63d6, #d0b7ff);
  --primary-hover: linear-gradient(135deg, #7146ba 0%, #a176ea 52%, #e2d2ff 100%);
  --app-bg:
    linear-gradient(135deg, rgba(246, 240, 255, 0.98), rgba(244, 252, 255, 0.92)),
    #f6f0ff;
  --topbar-bg:
    linear-gradient(135deg, rgba(177, 139, 232, 0.94), rgba(235, 223, 255, 0.96) 47%, rgba(193, 168, 239, 0.9));
  --calendar-guide-bg: linear-gradient(180deg, rgba(215, 196, 246, 0.98), rgba(241, 234, 255, 0.96));
  --calendar-time-bg: linear-gradient(90deg, rgba(204, 183, 242, 0.98), rgba(246, 240, 255, 0.98));
  --cell-a: linear-gradient(180deg, rgba(254, 252, 255, 0.9), rgba(246, 240, 255, 0.78));
  --cell-b: linear-gradient(180deg, rgba(239, 231, 255, 0.84), rgba(229, 219, 250, 0.74));
  --cell-hover: linear-gradient(180deg, rgba(225, 211, 255, 0.92), rgba(250, 247, 255, 0.86));
  --month-color: #7549bb;
  --greeting-color: #4d4174;
  --name-color: #724bc0;
  --name-stain:
    radial-gradient(ellipse at 50% 48%, rgba(253, 250, 255, 0.88) 0 20%, transparent 42%),
    radial-gradient(circle at 12% 43%, rgba(106, 67, 183, 0.48) 0 14%, transparent 30%),
    radial-gradient(circle at 29% 29%, rgba(150, 109, 227, 0.48) 0 18%, transparent 36%),
    radial-gradient(circle at 58% 70%, rgba(208, 188, 255, 0.44) 0 18%, transparent 35%),
    radial-gradient(circle at 84% 40%, rgba(91, 56, 164, 0.45) 0 20%, transparent 39%),
    linear-gradient(112deg, rgba(112, 73, 190, 0.48), rgba(202, 181, 255, 0.62), rgba(96, 63, 166, 0.42));
  --name-splatter:
    radial-gradient(circle at 16% 78%, rgba(91, 56, 164, 0.15) 0 5%, transparent 9%),
    radial-gradient(circle at 88% 17%, rgba(150, 109, 227, 0.13) 0 4%, transparent 8%),
    radial-gradient(circle at 98% 55%, rgba(82, 50, 148, 0.11) 0 6%, transparent 12%);
  --name-glow: rgba(91, 56, 164, 0.16);
  --name-stroke: rgba(82, 50, 148, 0.16);
}

body[data-theme="rosa"] {
  --bg: #fff0fa;
  --surface: rgba(255, 246, 252, 0.84);
  --surface-strong: rgba(255, 247, 253, 0.98);
  --field-bg: rgba(255, 250, 254, 0.92);
  --ghost-bg: rgba(255, 247, 253, 0.9);
  --line: #ee8fc8;
  --line-soft: #f8cfe7;
  --primary: #e878b7;
  --primary-dark: #be4d8e;
  --primary-gradient: linear-gradient(135deg, #e35ca8, #f7aed8);
  --primary-hover: linear-gradient(135deg, #cc3f91 0%, #ee78bc 52%, #ffc3e5 100%);
  --app-bg:
    linear-gradient(135deg, rgba(255, 232, 247, 0.98), rgba(253, 240, 250, 0.96) 52%, rgba(248, 229, 243, 0.94)),
    #fff0fa;
  --topbar-bg:
    linear-gradient(135deg, rgba(235, 100, 177, 0.9), rgba(255, 205, 235, 0.96) 48%, rgba(248, 181, 222, 0.92));
  --calendar-guide-bg: linear-gradient(180deg, rgba(247, 183, 222, 0.96), rgba(255, 226, 244, 0.98));
  --calendar-time-bg: linear-gradient(90deg, rgba(242, 170, 214, 0.96), rgba(255, 231, 246, 0.98));
  --cell-a: linear-gradient(180deg, rgba(255, 250, 254, 0.92), rgba(253, 235, 247, 0.82));
  --cell-b: linear-gradient(180deg, rgba(250, 226, 241, 0.9), rgba(246, 217, 235, 0.8));
  --cell-hover: linear-gradient(180deg, rgba(248, 201, 231, 0.94), rgba(255, 242, 250, 0.9));
  --month-color: #be4d8e;
  --greeting-color: #694061;
  --name-color: #bd4f92;
  --name-stain:
    radial-gradient(ellipse at 50% 48%, rgba(255, 249, 253, 0.88) 0 20%, transparent 42%),
    radial-gradient(circle at 12% 43%, rgba(195, 55, 139, 0.48) 0 14%, transparent 30%),
    radial-gradient(circle at 29% 29%, rgba(235, 119, 185, 0.48) 0 18%, transparent 36%),
    radial-gradient(circle at 58% 70%, rgba(255, 188, 224, 0.44) 0 18%, transparent 35%),
    radial-gradient(circle at 84% 40%, rgba(169, 42, 119, 0.45) 0 20%, transparent 39%),
    linear-gradient(112deg, rgba(198, 72, 148, 0.48), rgba(255, 186, 224, 0.62), rgba(163, 48, 122, 0.42));
  --name-splatter:
    radial-gradient(circle at 16% 78%, rgba(189, 79, 146, 0.16) 0 5%, transparent 9%),
    radial-gradient(circle at 88% 17%, rgba(213, 97, 162, 0.14) 0 4%, transparent 8%),
    radial-gradient(circle at 98% 55%, rgba(174, 63, 132, 0.12) 0 6%, transparent 12%);
  --name-glow: rgba(174, 63, 132, 0.18);
  --name-stroke: rgba(150, 46, 112, 0.18);
}

body[data-theme="noche"] {
  --bg: #070706;
  --panel: rgba(12, 11, 9, 0.86);
  --surface: rgba(16, 14, 10, 0.88);
  --surface-strong: rgba(10, 9, 7, 0.98);
  --field-bg: rgba(6, 6, 5, 0.92);
  --ghost-bg: rgba(24, 21, 15, 0.9);
  --line: #5b4a26;
  --line-soft: #2d2719;
  --text: #f5ebd1;
  --muted: #d2c09a;
  --primary: #c4a052;
  --primary-dark: #ead083;
  --primary-gradient: linear-gradient(135deg, #2b2110 0%, #6e5725 46%, #d7b86b 100%);
  --primary-hover: linear-gradient(135deg, #3a2b12 0%, #8a6a2a 48%, #efcf78 100%);
  --app-bg:
    linear-gradient(135deg, rgba(3, 3, 3, 0.99), rgba(17, 15, 11, 0.98) 58%, rgba(6, 6, 5, 0.99)),
    #070706;
  --topbar-bg:
    linear-gradient(135deg, rgba(6, 6, 5, 0.99), rgba(20, 17, 11, 0.98) 46%, rgba(8, 8, 7, 0.99));
  --calendar-guide-bg: linear-gradient(180deg, rgba(54, 44, 23, 0.98), rgba(18, 16, 11, 0.98));
  --calendar-time-bg: linear-gradient(90deg, rgba(45, 36, 18, 0.98), rgba(12, 11, 8, 0.98));
  --cell-a: linear-gradient(180deg, rgba(8, 8, 7, 0.96), rgba(14, 13, 10, 0.94));
  --cell-b: linear-gradient(180deg, rgba(18, 16, 11, 0.96), rgba(13, 12, 9, 0.94));
  --cell-hover: linear-gradient(180deg, rgba(49, 39, 20, 0.96), rgba(18, 15, 10, 0.94));
  --month-color: #b99846;
  --greeting-color: #d7c79e;
  --name-color: #f1d483;
  --name-stain:
    radial-gradient(ellipse at 50% 48%, rgba(255, 239, 186, 0.2) 0 20%, transparent 42%),
    radial-gradient(circle at 12% 43%, rgba(163, 121, 39, 0.58) 0 14%, transparent 30%),
    radial-gradient(circle at 29% 29%, rgba(214, 179, 101, 0.54) 0 18%, transparent 36%),
    radial-gradient(circle at 58% 70%, rgba(240, 207, 120, 0.34) 0 18%, transparent 35%),
    radial-gradient(circle at 84% 40%, rgba(104, 78, 25, 0.55) 0 20%, transparent 39%),
    linear-gradient(112deg, rgba(56, 42, 15, 0.66), rgba(186, 146, 63, 0.56), rgba(37, 29, 12, 0.62));
  --name-splatter:
    radial-gradient(circle at 16% 78%, rgba(215, 184, 107, 0.18) 0 5%, transparent 9%),
    radial-gradient(circle at 88% 17%, rgba(173, 132, 53, 0.16) 0 4%, transparent 8%),
    radial-gradient(circle at 98% 55%, rgba(132, 95, 34, 0.14) 0 6%, transparent 12%);
  --name-glow: rgba(215, 184, 107, 0.22);
  --name-stroke: rgba(215, 184, 107, 0.2);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

body[data-theme="noche"] .ghost-btn,
body[data-theme="noche"] .small-btn,
body[data-theme="noche"] .select,
body[data-theme="noche"] .field {
  color: var(--text);
}

body[data-theme="noche"] .logo {
  box-shadow: inset 0 0 0 1px rgba(215, 184, 107, 0.12);
}

body[data-theme="noche"] .topbar {
  box-shadow: none;
}

body[data-theme="noche"] .calendar {
  box-shadow: inset 0 0 0 1px rgba(215, 184, 107, 0.1);
}

body[data-theme="rosa"] .header-greeting strong::before {
  opacity: 0.34;
  filter: blur(0.35px) saturate(1.03);
}

body[data-theme="rosa"] .header-greeting strong::after {
  display: none;
}

body[data-theme="rosa"] .header-greeting strong {
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.82),
    0 2px 8px rgba(174, 63, 132, 0.16);
  -webkit-text-stroke: 0.16px rgba(150, 46, 112, 0.14);
}

body[data-theme="amarillo"] .primary-btn,
body[data-theme="amarillo"] .ghost-btn,
body[data-theme="amarillo"] .small-btn,
body[data-theme="amarillo"] .chip-btn,
body[data-theme="amarillo"] .select,
body[data-theme="amarillo"] .field {
  box-shadow: 0 7px 18px rgba(166, 118, 0, 0.08);
}

body[data-theme="amarillo"] .header-greeting strong::after {
  opacity: 0.14;
}

body[data-theme="amarillo"] .header-greeting strong {
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.76),
    0 2px 8px rgba(171, 120, 0, 0.14);
  -webkit-text-stroke: 0.16px rgba(151, 101, 0, 0.14);
}

body[data-theme="perla"] {
  --bg: #f4fdff;
  --surface: rgba(255, 255, 255, 0.78);
  --surface-strong: rgba(252, 254, 255, 0.97);
  --field-bg: rgba(255, 255, 255, 0.88);
  --ghost-bg: rgba(252, 254, 255, 0.88);
  --line: #b9e7f6;
  --line-soft: #e1f5fb;
  --primary: #4aa8c9;
  --primary-dark: #247fa0;
  --primary-gradient: linear-gradient(135deg, #3b9fc1, #a6e2f4);
  --primary-hover: linear-gradient(135deg, #227f9f 0%, #58b8d5 52%, #c2eef8 100%);
  --app-bg:
    linear-gradient(135deg, rgba(250, 254, 255, 0.98), rgba(232, 249, 255, 0.96)),
    #f4fdff;
  --topbar-bg:
    linear-gradient(135deg, rgba(234, 251, 255, 0.98), rgba(200, 239, 250, 0.96) 48%, rgba(174, 224, 240, 0.88));
  --calendar-guide-bg: linear-gradient(180deg, rgba(202, 235, 246, 0.98), rgba(234, 250, 255, 0.96));
  --calendar-time-bg: linear-gradient(90deg, rgba(196, 232, 245, 0.98), rgba(241, 253, 255, 0.98));
  --cell-a: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(240, 250, 253, 0.78));
  --cell-b: linear-gradient(180deg, rgba(235, 248, 252, 0.84), rgba(227, 242, 248, 0.74));
  --cell-hover: linear-gradient(180deg, rgba(219, 244, 252, 0.92), rgba(249, 254, 255, 0.86));
  --month-color: #247fa0;
  --greeting-color: #31576a;
  --name-color: #2b8aae;
  --name-stain:
    radial-gradient(ellipse at 50% 48%, rgba(255, 255, 255, 0.88) 0 20%, transparent 42%),
    radial-gradient(circle at 12% 43%, rgba(48, 145, 178, 0.42) 0 14%, transparent 30%),
    radial-gradient(circle at 29% 29%, rgba(122, 205, 228, 0.42) 0 18%, transparent 36%),
    radial-gradient(circle at 58% 70%, rgba(206, 239, 248, 0.44) 0 18%, transparent 35%),
    radial-gradient(circle at 84% 40%, rgba(38, 129, 163, 0.4) 0 20%, transparent 39%),
    linear-gradient(112deg, rgba(70, 158, 188, 0.42), rgba(190, 232, 244, 0.62), rgba(54, 136, 166, 0.36));
  --name-splatter:
    radial-gradient(circle at 16% 78%, rgba(48, 145, 178, 0.13) 0 5%, transparent 9%),
    radial-gradient(circle at 88% 17%, rgba(122, 205, 228, 0.12) 0 4%, transparent 8%),
    radial-gradient(circle at 98% 55%, rgba(38, 129, 163, 0.1) 0 6%, transparent 12%);
  --name-glow: rgba(38, 129, 163, 0.14);
  --name-stroke: rgba(38, 129, 163, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background: var(--app-bg);
  overflow-x: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(440px, 100%);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
  box-shadow: var(--shadow);
}

.login-card.is-wide {
  width: min(680px, 100%);
}

.login-card.is-onboarding {
  width: min(820px, 100%);
}

.onboarding-shell {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--primary) 11%, transparent), transparent 46%),
    var(--app-bg);
}

.onboarding-brand {
  margin-bottom: 18px;
}

.onboarding-brand h1 {
  font-size: 26px;
}

.onboarding-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.onboarding-step {
  min-height: 62px;
  display: grid;
  grid-template-columns: 30px 1fr;
  grid-template-rows: auto auto;
  column-gap: 9px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: var(--ghost-bg);
}

.onboarding-step span {
  grid-row: 1 / 3;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  background: var(--surface);
  font-weight: 900;
}

.onboarding-step strong,
.onboarding-step small {
  line-height: 1.1;
}

.onboarding-step small {
  font-size: 11px;
  font-weight: 700;
}

.onboarding-step.is-complete {
  color: var(--text);
  background: color-mix(in srgb, var(--primary) 9%, var(--surface));
}

.onboarding-step.is-complete span {
  color: #fff;
  border-color: var(--primary-dark);
  background: var(--primary-dark);
}

.onboarding-step.is-active {
  color: #fff;
  border-color: var(--primary);
  background: var(--primary-gradient);
  box-shadow: 0 9px 22px color-mix(in srgb, var(--primary) 24%, transparent);
}

.onboarding-step.is-active span {
  color: var(--primary-dark);
  border-color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.92);
}

.onboarding-account {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 18px;
  padding: 10px 12px;
  border-block: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 13px;
}

.onboarding-account strong {
  color: var(--text);
  overflow-wrap: anywhere;
}

.text-btn {
  padding: 0;
  border: 0;
  color: var(--primary-dark);
  background: transparent;
  font-weight: 800;
}

.text-btn:hover,
.text-btn:focus-visible {
  text-decoration: underline;
}

.onboarding-intro,
.auth-heading {
  margin: 2px 0 14px;
}

.onboarding-intro span,
.auth-heading span,
.activation-kicker {
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.onboarding-intro h2,
.auth-heading h2,
.activation-lock h2 {
  margin: 5px 0;
  font-size: 22px;
}

.onboarding-intro p,
.auth-heading p,
.activation-lock p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.onboarding-grid .span-two {
  grid-column: 1 / -1;
}

.onboarding-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin-bottom: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
}

.onboarding-summary div {
  min-width: 0;
  padding: 12px;
  background: var(--surface);
}

.onboarding-summary span,
.onboarding-summary strong {
  display: block;
}

.onboarding-summary span {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.onboarding-summary strong {
  overflow-wrap: anywhere;
}

.activation-lock {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(260px, 0.85fr);
  gap: 22px;
  align-items: end;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--primary) 12%, transparent), transparent 68%),
    var(--surface);
}

.activation-lock label {
  margin: 0;
}

.auth-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.success-notice {
  border-color: color-mix(in srgb, var(--green) 48%, var(--line));
  background: color-mix(in srgb, var(--green) 9%, var(--surface));
}

.brand-row {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 24px;
}

.logo {
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: #050912;
  overflow: hidden;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.06),
    0 8px 20px rgba(0, 0, 0, 0.12);
}

.logo img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
}

.brand-row h1,
.brand-row p {
  margin: 0;
}

.brand-row h1 {
  font-size: 28px;
}

.brand-row p {
  color: var(--muted);
}

.login-card label {
  display: block;
  margin: 18px 0 8px;
  color: var(--muted);
  font-weight: 700;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 4px 0 18px;
}

.auth-tabs button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  background: var(--ghost-bg);
  font-weight: 800;
}

.auth-tabs button.active {
  color: var(--on-primary);
  border-color: var(--accent-strong);
  background: linear-gradient(135deg, var(--accent), var(--accent-soft));
  box-shadow: 0 10px 24px rgba(44, 148, 196, 0.18);
}

.auth-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 16px;
}

.license-field {
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.field,
.select {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  background: var(--field-bg);
}

.primary-btn,
.ghost-btn,
.danger-btn,
.small-btn,
.chip-btn {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-height: 36px;
  padding: 7px 14px;
  color: var(--text);
  background: var(--ghost-bg);
  box-shadow: 0 8px 22px rgba(44, 148, 196, 0.1);
  transform: translateY(0);
  transition:
    transform 150ms ease,
    box-shadow 150ms ease,
    border-color 150ms ease,
    background 150ms ease,
  filter 150ms ease;
}

.primary-btn::after,
.ghost-btn::after,
.danger-btn::after,
.small-btn::after,
.chip-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(110deg, transparent 0 22%, rgba(255, 255, 255, 0.42) 45%, transparent 68% 100%);
  opacity: 0;
  transform: translateX(-55%);
  transition:
    opacity 150ms ease,
    transform 240ms ease;
}

.primary-btn {
  border-color: var(--primary);
  color: #fff;
  background: var(--primary-gradient);
  font-weight: 800;
}

.primary-btn:hover,
.primary-btn:focus-visible {
  border-color: var(--primary-dark);
  background: var(--primary-hover);
  box-shadow:
    0 13px 26px rgba(21, 139, 196, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.42);
  transform: translateY(-3px);
  filter: saturate(1.1) brightness(1.03);
}

.danger-btn {
  border-color: #bd1e24;
  color: #fff;
  background: linear-gradient(135deg, #d71e28, #f05a60);
  font-weight: 800;
}

.danger-btn:hover,
.danger-btn:focus-visible {
  border-color: #a9151c;
  background:
    linear-gradient(135deg, #c91823 0%, #ef3c47 52%, #ff747b 100%);
  box-shadow:
    0 13px 26px rgba(176, 30, 38, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.32);
  transform: translateY(-3px);
  filter: saturate(1.08) brightness(1.03);
}

.ghost-btn:hover,
.ghost-btn:focus-visible,
.small-btn:hover,
.small-btn:focus-visible,
.chip-btn:hover,
.chip-btn:focus-visible {
  border-color: var(--primary);
  background:
    linear-gradient(135deg, var(--surface-strong), var(--surface));
  box-shadow:
    0 12px 24px rgba(42, 139, 180, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  transform: translateY(-3px);
  filter: saturate(1.05);
}

.primary-btn:hover::after,
.primary-btn:focus-visible::after,
.ghost-btn:hover::after,
.ghost-btn:focus-visible::after,
.danger-btn:hover::after,
.danger-btn:focus-visible::after,
.small-btn:hover::after,
.small-btn:focus-visible::after,
.chip-btn:hover::after,
.chip-btn:focus-visible::after {
  opacity: 1;
  transform: translateX(55%);
}

.primary-btn:active,
.ghost-btn:active,
.danger-btn:active,
.small-btn:active,
.chip-btn:active {
  transform: translateY(-1px);
}

.small-btn {
  min-width: 46px;
  min-height: 36px;
  padding: 6px 10px;
  font-weight: 800;
}

.chip-btn {
  min-height: 42px;
  font-weight: 800;
}

.app-shell {
  min-height: 100vh;
  overflow-x: hidden;
}

.topbar {
  position: relative;
  display: block;
  width: 100%;
  max-width: 100vw;
  min-height: 132px;
  padding: 10px 8px 8px;
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--line);
  box-shadow: none;
  overflow: hidden;
}

.clinic-brand {
  display: flex;
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding-top: 0;
}

.clinic-brand .logo {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  font-size: 23px;
}

.clinic-brand h2,
.clinic-brand p {
  margin: 0;
}

.clinic-brand h2 {
  font-size: 17px;
  white-space: nowrap;
}

.clinic-brand p {
  font-size: 14px;
}

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

.main-tools {
  display: flex;
  flex-direction: column;
  gap: 7px;
  align-items: stretch;
  justify-content: start;
  width: min(100%, 1080px);
  padding-top: 8px;
  min-width: 0;
  margin-left: 0;
}

.tool-row {
  display: grid;
  grid-template-columns: 44px 64px 44px 94px 184px 170px 206px;
  gap: 8px;
  align-items: center;
  justify-content: start;
}

.secondary-row {
  grid-template-columns: 198px 164px 56px 136px;
}

.main-tools .primary-btn,
.main-tools .ghost-btn,
.main-tools .danger-btn {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  padding: 6px 14px;
  font-size: 16px;
  line-height: 1.1;
  white-space: nowrap;
  overflow: visible;
}

.main-tools .small-btn {
  width: 46px;
  min-width: 46px;
}

.main-tools .today-btn {
  width: 68px;
}

.main-tools .danger-btn {
  min-width: 0;
}

.icon-btn {
  position: relative;
  display: grid;
  place-items: center;
  padding-inline: 0;
  font-size: 18px;
}

.badge {
  position: absolute;
  top: -7px;
  right: -7px;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: #6acdf1;
  font-size: 12px;
  font-weight: 800;
}

.right-tools {
  position: absolute;
  top: 12px;
  right: 10px;
  width: min(34vw, 650px);
  display: grid;
  grid-template-columns: 1fr;
  gap: 9px;
  justify-items: end;
  min-width: 0;
  overflow: hidden;
  padding-top: 0;
}

.right-bottom {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  width: 100%;
  min-width: 0;
  padding-top: 4px;
}

.right-actions {
  display: flex;
  gap: 9px;
  align-items: center;
  flex-shrink: 0;
}

.mobile-actions {
  display: none;
}

.range {
  width: 100%;
  text-align: right;
  font-size: 18px;
  font-weight: 800;
  white-space: nowrap;
}

.hello {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  min-width: 0;
  overflow: hidden;
  font-size: 20px;
  font-weight: 800;
  color: var(--muted);
  white-space: nowrap;
}

.header-greeting {
  position: absolute;
  top: 10px;
  left: clamp(330px, 24vw, 470px);
  right: calc(min(30vw, 590px) + 28px);
  z-index: 1;
  pointer-events: none;
  font-family: "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  font-size: 28px;
  font-style: italic;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--greeting-color);
  overflow: visible;
  text-shadow: 0 2px 14px rgba(255, 255, 255, 0.55);
}

.greeting-text {
  position: relative;
}

.greeting-text::after {
  content: "";
  position: absolute;
  left: 7%;
  right: 3%;
  bottom: -5px;
  height: 3px;
  border-radius: 999px;
  background:
    linear-gradient(90deg, transparent, var(--primary), color-mix(in srgb, var(--primary) 48%, #ffffff 52%), transparent);
  transform: rotate(-1deg);
}

.hello strong {
  color: var(--name-color);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 30px;
  font-style: italic;
}

.header-greeting strong {
  position: relative;
  margin-left: 18px;
  padding: 0 12px 2px;
  font-family: "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  font-size: 38px;
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 0.92;
  color: var(--name-color);
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.96),
    0 0 1px var(--name-stroke),
    0 3px 10px var(--name-glow);
  isolation: isolate;
  -webkit-text-stroke: 0.18px var(--name-stroke);
}

.header-greeting strong::before {
  content: "";
  position: absolute;
  inset: -10px -22px -9px -10px;
  z-index: -1;
  background: var(--name-stain);
  clip-path: polygon(2% 45%, 8% 30%, 17% 22%, 30% 25%, 42% 16%, 54% 21%, 66% 15%, 78% 24%, 91% 20%, 99% 39%, 93% 53%, 98% 67%, 84% 74%, 70% 69%, 58% 82%, 44% 75%, 31% 86%, 18% 76%, 6% 79%, 0 62%);
  filter: blur(0.45px) saturate(1.12);
  opacity: 0.5;
  transform: rotate(-2deg) scale(1.08);
}

.header-greeting strong::after {
  content: "";
  position: absolute;
  inset: -12px -24px -10px -11px;
  z-index: -2;
  background: var(--name-splatter);
  opacity: 0.18;
}

.right-tools .select {
  width: 68%;
  min-height: 38px;
  padding-block: 6px;
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease,
    background 150ms ease,
    transform 150ms ease;
}

.right-tools .select:hover,
.right-tools .select:focus {
  border-color: var(--primary);
  background:
    linear-gradient(135deg, var(--surface-strong), var(--surface));
  box-shadow:
    0 10px 22px rgba(42, 139, 180, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.86);
  transform: translateY(-2px);
}

.right-actions .primary-btn,
.right-actions .ghost-btn {
  min-height: 36px;
  padding: 6px 12px;
  font-size: 15px;
}

@media (max-width: 1500px) {
  .topbar {
    grid-template-columns: minmax(230px, 1fr) minmax(460px, 620px);
    gap: 8px 10px;
    padding-inline: 12px;
  }

  .main-tools {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    max-width: none;
    gap: 8px;
    padding-left: 0;
    margin-left: 0;
  }

  .right-tools {
    grid-column: 2;
    grid-row: 1;
  }

  .clinic-brand {
    grid-column: 1;
    grid-row: 1;
  }

  .main-tools .primary-btn,
  .main-tools .ghost-btn,
  .main-tools .danger-btn {
    min-height: 32px;
    min-width: 0;
    padding-inline: 14px;
    font-size: 13px;
  }

  .main-tools .danger-btn {
    min-width: 0;
  }

  .tool-row {
    grid-template-columns: 38px 56px 38px 80px 150px 140px 166px;
    gap: 7px;
  }

  .secondary-row {
    grid-template-columns: 166px 138px 48px 120px;
  }
}

@media (max-width: 1180px) {
  .topbar {
    grid-template-columns: 1fr;
  }

  .clinic-brand,
  .right-tools,
  .main-tools {
    grid-column: 1;
  }

  .right-tools {
    justify-items: stretch;
  }

  .range {
    text-align: left;
  }

  .right-bottom {
    justify-content: space-between;
  }

  .hello {
    justify-content: flex-start;
  }

  .main-tools {
    grid-row: auto;
    padding-left: 0;
    width: 100%;
  }

  .tool-row,
  .secondary-row {
    grid-template-columns: 40px 60px 40px repeat(4, minmax(112px, 1fr));
  }

  .secondary-row {
    grid-template-columns: minmax(142px, 1fr) minmax(122px, 1fr) 52px minmax(112px, 1fr);
  }

  .main-tools .primary-btn,
  .main-tools .ghost-btn,
  .main-tools .danger-btn {
    min-height: 32px;
    min-width: 0;
    padding-inline: 12px;
    font-size: 13px;
  }

  .main-tools .danger-btn {
    min-width: 0;
  }

  .tool-row {
    grid-template-columns: 40px 60px 40px repeat(4, minmax(110px, 1fr));
  }

  .secondary-row {
    grid-template-columns: minmax(140px, 1fr) minmax(120px, 1fr) 52px minmax(110px, 1fr);
  }
}

@media (max-width: 1500px) {
  .hello {
    font-size: 17px;
  }

  .hello strong {
    font-size: 26px;
  }

  .range {
    font-size: 16px;
  }

  .right-actions .primary-btn,
  .right-actions .ghost-btn {
    min-height: 34px;
    padding-inline: 9px;
    font-size: 14px;
  }
}

.right-tools .select {
  width: 70%;
}

.content {
  padding: 18px 18px 36px;
  max-width: 100vw;
  overflow-x: hidden;
}

.status-strip {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 36px;
  padding: 3px 12px;
  margin-bottom: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.online {
  display: flex;
  gap: 7px;
  align-items: center;
  font-size: 17px;
  font-weight: 800;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(31, 154, 87, 0.1);
}

.month-title {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 28px;
  font-weight: 800;
  font-style: italic;
  color: var(--month-color);
}

.calendar {
  display: grid;
  grid-template-columns: 90px repeat(7, minmax(0, 1fr));
  width: 100%;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}

.cell {
  min-height: 39px;
  padding: 6px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line-soft);
  transition:
    background 150ms ease,
    box-shadow 150ms ease;
}

.calendar .cell:not(.head):not(.time):nth-child(8n+2),
.calendar .cell:not(.head):not(.time):nth-child(8n+4),
.calendar .cell:not(.head):not(.time):nth-child(8n+6),
.calendar .cell:not(.head):not(.time):nth-child(8n+8) {
  background: var(--cell-a);
}

.calendar .cell:not(.head):not(.time):nth-child(8n+3),
.calendar .cell:not(.head):not(.time):nth-child(8n+5),
.calendar .cell:not(.head):not(.time):nth-child(8n+7) {
  background: var(--cell-b);
}

.cell:not(.head):not(.time):hover {
  background: var(--cell-hover);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 56%, transparent);
}

.cell:nth-child(8n) {
  border-right: 0;
}

.head,
.time {
  background: var(--calendar-guide-bg);
  border-color: var(--line);
  color: var(--text);
  font-weight: 900;
  text-align: center;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.72);
}

.head {
  min-height: 31px;
  padding: 4px 6px;
  box-shadow: inset 0 -1px 0 rgba(71, 181, 225, 0.45);
}

.time {
  background: var(--calendar-time-bg);
  border-right: 1px solid var(--line);
  font-size: 16px;
}

.calendar .head:first-child {
  background: var(--calendar-time-bg);
  box-shadow:
    inset -1px 0 0 var(--line),
    inset 0 -1px 0 var(--line);
}

.day-name {
  display: block;
  line-height: 1.05;
  font-size: 17px;
}

.day-date {
  display: block;
  margin-top: 1px;
  font-size: 12px;
  line-height: 1.05;
  color: var(--text);
}

.today-col {
  box-shadow: inset 0 5px 0 var(--primary);
}

.appointment {
  position: relative;
  isolation: isolate;
  min-height: 31px;
  padding: 5px 8px;
  border-radius: 7px;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  overflow: hidden;
  cursor: pointer;
  background:
    linear-gradient(135deg,
      color-mix(in srgb, var(--doctor-color) 76%, #ffffff 24%) 0%,
      var(--doctor-color) 48%,
      color-mix(in srgb, var(--doctor-color) 74%, #004e83 26%) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.32),
    0 5px 14px rgba(31, 124, 184, 0.12);
  transition:
    transform 150ms ease,
    box-shadow 150ms ease,
    filter 150ms ease;
}

.appointment::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(110deg, rgba(255, 255, 255, 0.3), transparent 38%, rgba(0, 57, 95, 0.12));
  opacity: 0.72;
}

.appointment strong {
  position: relative;
  z-index: 1;
  display: block;
  font-size: 13px;
  line-height: 1.1;
}

.appointment:hover {
  z-index: 2;
  transform: translateY(-3px) scale(1.012);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.42),
    0 10px 22px rgba(31, 124, 184, 0.24);
  filter: saturate(1.08) brightness(1.04);
}

.appointment span {
  position: relative;
  z-index: 1;
  display: block;
  font-size: 11px;
  font-weight: 500;
}

.appointment {
  text-shadow: 0 1px 2px rgba(0, 42, 74, 0.24);
}

.appointment > * {
  position: relative;
  z-index: 1;
}

.muted-appointment {
  filter: saturate(0.45);
  opacity: 0.62;
}

.appointment.continuation {
  min-height: 31px;
  opacity: 0.76;
  background:
    linear-gradient(135deg,
      color-mix(in srgb, var(--doctor-color) 48%, #ffffff 52%) 0%,
      color-mix(in srgb, var(--doctor-color) 62%, #ffffff 38%) 100%);
}

.blank-slot {
  height: 100%;
  min-height: 31px;
  border-radius: 7px;
  cursor: pointer;
  transition:
    transform 150ms ease,
    background 150ms ease,
    box-shadow 150ms ease;
}

.blank-slot:hover {
  transform: translateY(-2px);
  background: var(--cell-hover);
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--primary) 58%, transparent),
    0 8px 18px rgba(42, 139, 180, 0.13);
}

.mobile-days,
.mobile-question,
.floating-actions {
  display: none;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(20, 34, 44, 0.62);
}

.modal {
  width: min(760px, 100%);
  max-height: min(86vh, 900px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
  box-shadow: var(--shadow);
}

.modal-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--surface-strong);
}

.modal h2,
.modal h3 {
  margin: 0;
}

.modal-body {
  padding: 18px;
}

.calendar-modal {
  width: min(760px, calc(100vw - 44px));
  border-color: color-mix(in srgb, var(--primary) 36%, var(--line));
  border-radius: 10px;
  background:
    linear-gradient(135deg,
      color-mix(in srgb, var(--surface-strong) 94%, var(--primary) 6%) 0%,
      color-mix(in srgb, var(--surface) 78%, var(--primary) 22%) 48%,
      color-mix(in srgb, var(--surface-strong) 88%, #ffffff 12%) 100%);
  box-shadow:
    0 22px 54px rgba(10, 24, 35, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.calendar-modal .modal-head {
  padding: 14px 16px 12px;
  background:
    linear-gradient(90deg,
      color-mix(in srgb, var(--surface-strong) 94%, var(--primary) 6%),
      color-mix(in srgb, var(--surface) 86%, var(--primary) 14%));
}

.calendar-modal .modal-head h2 {
  font-size: 22px;
  letter-spacing: 0;
}

.calendar-modal .modal-head .small-btn {
  width: 48px;
  height: 44px;
  border-color: color-mix(in srgb, var(--primary) 46%, var(--line));
  color: var(--text);
  background:
    linear-gradient(145deg,
      color-mix(in srgb, var(--surface-strong) 96%, #ffffff 4%),
      color-mix(in srgb, var(--surface) 82%, var(--primary) 18%));
  box-shadow:
    0 8px 18px color-mix(in srgb, var(--primary) 14%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.calendar-modal .modal-body {
  padding: 16px;
}

.month-picker {
  display: grid;
  gap: 14px;
}

.month-nav {
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  align-items: center;
  gap: 10px;
}

.month-nav h3 {
  margin: 0;
  color: var(--primary-strong);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 32px;
  font-style: italic;
  text-align: center;
  text-shadow:
    0 8px 18px color-mix(in srgb, var(--primary) 18%, transparent),
    0 1px 0 rgba(255, 255, 255, 0.5);
}

.month-arrow {
  width: 48px;
  height: 48px;
  border-color: color-mix(in srgb, var(--primary) 48%, var(--line));
  color: var(--text);
  background:
    linear-gradient(145deg,
      color-mix(in srgb, var(--surface-strong) 72%, #ffffff 28%),
      color-mix(in srgb, var(--primary) 16%, var(--surface) 84%));
  font-size: 28px;
  box-shadow:
    0 10px 22px color-mix(in srgb, var(--primary) 14%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.month-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  padding: 0 2px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
  text-align: center;
}

.month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.month-day {
  min-height: 48px;
  border: 1px solid color-mix(in srgb, var(--primary) 28%, var(--line-soft));
  border-radius: 9px;
  color: var(--text);
  background:
    linear-gradient(145deg,
      color-mix(in srgb, var(--surface-strong) 82%, #ffffff 18%) 0%,
      color-mix(in srgb, var(--surface) 72%, var(--primary) 28%) 100%);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 25px;
  font-style: italic;
  font-weight: 900;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.66),
    inset 0 -10px 18px color-mix(in srgb, var(--primary) 5%, transparent),
    0 7px 15px color-mix(in srgb, var(--primary) 9%, transparent);
  transition:
    transform 150ms ease,
    box-shadow 150ms ease,
    border-color 150ms ease,
    background 150ms ease;
}

.month-day:hover,
.month-day:focus-visible {
  transform: translateY(-3px) scale(1.015);
  border-color: var(--primary);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    inset 0 -10px 18px color-mix(in srgb, var(--primary) 8%, transparent),
    0 14px 26px color-mix(in srgb, var(--primary) 22%, transparent);
}

.month-day:nth-child(odd) {
  background:
    linear-gradient(145deg,
      color-mix(in srgb, var(--surface-strong) 88%, var(--primary) 12%) 0%,
      color-mix(in srgb, var(--surface) 70%, #ffffff 30%) 54%,
      color-mix(in srgb, var(--primary) 12%, var(--surface-strong) 88%) 100%);
}

.outside-month {
  color: color-mix(in srgb, var(--muted) 62%, transparent);
  opacity: 0.66;
}

.selected-day {
  color: var(--on-primary);
  border-color: color-mix(in srgb, var(--primary) 88%, #ffffff 12%);
  background:
    linear-gradient(135deg,
      color-mix(in srgb, var(--primary) 74%, #ffffff 26%) 0%,
      color-mix(in srgb, var(--primary) 92%, var(--primary-strong) 8%) 48%,
      color-mix(in srgb, var(--primary-strong) 78%, var(--primary) 22%) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.44),
    inset 0 -12px 18px rgba(0, 0, 0, 0.08),
    0 16px 30px color-mix(in srgb, var(--primary) 34%, transparent);
}

.real-today {
  position: relative;
  color: var(--on-primary);
  border-color: color-mix(in srgb, var(--accent) 72%, var(--primary) 28%);
  background:
    linear-gradient(135deg,
      color-mix(in srgb, var(--accent) 78%, #ffffff 22%) 0%,
      color-mix(in srgb, var(--primary) 78%, var(--accent) 22%) 52%,
      color-mix(in srgb, var(--primary-strong) 78%, var(--accent) 22%) 100%);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.42),
    inset 0 -12px 18px rgba(0, 0, 0, 0.08),
    0 16px 30px color-mix(in srgb, var(--accent) 34%, transparent);
}

.real-today::after {
  content: "Hoy";
  position: absolute;
  top: 5px;
  right: 8px;
  padding: 1px 7px 2px;
  border-radius: 999px;
  color: var(--on-primary);
  background: rgba(255, 255, 255, 0.2);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
  line-height: 1.2;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.24);
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.theme-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.theme-card {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  background:
    linear-gradient(135deg, var(--surface-strong), var(--surface));
  text-align: left;
  box-shadow: 0 8px 22px rgba(42, 139, 180, 0.1);
  transition:
    transform 150ms ease,
    box-shadow 150ms ease,
    border-color 150ms ease,
    background 150ms ease;
}

.theme-card:hover,
.theme-card:focus-visible,
.active-theme {
  transform: translateY(-3px);
  border-color: var(--primary);
  box-shadow:
    0 14px 30px rgba(42, 139, 180, 0.2),
    inset 0 0 0 1px rgba(255, 255, 255, 0.64);
}

.active-theme {
  background:
    linear-gradient(135deg, var(--surface-strong), var(--cell-hover));
}

.theme-swatches {
  display: flex;
  gap: 6px;
}

.theme-swatches i {
  width: 34px;
  height: 22px;
  border: 1px solid rgba(9, 47, 72, 0.14);
  border-radius: 999px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.56);
}

.theme-card strong {
  font-size: 18px;
}

.theme-card small {
  color: var(--muted);
  font-weight: 700;
}

.info-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: left;
  transition:
    transform 150ms ease,
    box-shadow 150ms ease,
    border-color 150ms ease;
}

.info-card:hover {
  transform: translateY(-2px);
  border-color: rgba(54, 181, 230, 0.62);
  box-shadow: 0 10px 24px rgba(42, 139, 180, 0.16);
}

.danger-card {
  border-color: rgba(223, 47, 53, 0.42);
  background:
    linear-gradient(135deg, rgba(255, 249, 249, 0.86), rgba(255, 230, 232, 0.7));
}

.danger-card h3 {
  color: #b91f27;
}

.info-card h3,
.info-card p {
  margin: 0;
}

.info-card p {
  margin-top: 10px;
  color: var(--muted);
  font-weight: 700;
}

.notification-list,
.detail-list {
  display: grid;
  gap: 12px;
}

.notice,
.detail-item {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.read-notice {
  opacity: 0.72;
}

.notice strong,
.detail-item strong {
  display: block;
  margin-bottom: 4px;
}

.notice-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.form-grid {
  display: grid;
  gap: 14px;
}

.form-grid label {
  display: grid;
  gap: 8px;
  font-weight: 800;
}

.textarea {
  min-height: 180px;
  resize: vertical;
}

.bottom-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.mobile-top-label {
  display: none;
}

/* Functional desktop demo modules */
.demo-note,
.form-note {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
}

.v1-modal {
  width: min(840px, 100%);
}

.history-modal {
  width: min(1500px, calc(100vw - 26px));
  max-height: calc(100vh - 22px);
}

.history-modal .modal-body {
  padding: 16px;
}

.v1-modal .form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.v1-modal .form-grid > .form-note,
.v1-modal .form-grid > .bottom-actions,
.v1-modal .form-grid > label:has(.textarea),
.v1-modal .form-grid > #v1-color-picker {
  grid-column: 1 / -1;
}

.v1-modal .detail-list > .form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.appointment {
  width: 100%;
  border: 0;
  text-align: left;
}

.form-note {
  padding: 10px 12px;
  border-left: 3px solid var(--primary);
  border-radius: 4px;
  background: color-mix(in srgb, var(--primary) 8%, transparent);
}

.color-picker {
  display: grid;
  gap: 8px;
}

.color-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.color-swatch {
  position: relative;
  display: inline-grid;
  width: 27px;
  height: 27px;
  cursor: pointer;
}

.color-swatch input {
  position: absolute;
  opacity: 0;
}

.color-swatch i {
  display: block;
  width: 100%;
  height: 100%;
  border: 2px solid transparent;
  border-radius: 50%;
  background: var(--swatch);
  box-shadow: inset 0 1px 1px rgba(255,255,255,.45);
}

.color-swatch input:checked + i {
  transform: scale(1.16);
  border-color: var(--text);
}

.finance-totals,
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.finance-totals > div,
.stats-grid span {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  font-weight: 700;
}

.finance-totals span {
  color: var(--muted);
  font-size: 12px;
}

.finance-totals strong {
  font-size: 21px;
}

.file-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.file-button input {
  position: absolute;
  inset: 0;
  width: 100%;
  opacity: 0;
  cursor: pointer;
}

.qr-placeholder {
  display: grid;
  place-items: center;
  gap: 12px;
  min-height: 220px;
  padding: 24px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  text-align: center;
  background: var(--surface);
}

.qr-placeholder strong {
  font-size: 24px;
}

.clinical-home,
.clinical-patient,
.clinical-entry,
.clinical-sheet {
  display: grid;
  gap: 16px;
}

.clinical-toolbar,
.clinical-patient-head,
.sheet-document-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.clinical-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.clinical-results,
.sheet-list {
  display: grid;
  gap: 10px;
}

.clinical-card,
.sheet-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.clinical-card strong,
.clinical-card span,
.clinical-card small,
.sheet-card span,
.sheet-card strong,
.sheet-card small {
  display: block;
}

.clinical-card small,
.sheet-card small {
  margin-top: 4px;
  color: var(--muted);
}

.dots-btn {
  min-width: 36px;
  font-size: 21px;
  line-height: 1;
}

.clinical-patient h3 {
  margin: 0 0 3px;
}

.clinical-patient-head > div span {
  color: var(--muted);
}

.clinical-patient-input {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.clinical-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.clinical-fields label {
  display: grid;
  gap: 7px;
  font-weight: 800;
}

.clinical-fields label:nth-child(4),
.clinical-fields label:nth-child(5),
.clinical-fields label:nth-child(6) {
  grid-column: 1 / -1;
}

.compact-area {
  min-height: 86px;
}

.sheet-document {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--field-bg);
}

.sheet-document-head {
  padding-bottom: 16px;
  border-bottom: 2px solid var(--primary);
}

.sheet-document-head h3 {
  margin: 4px 0;
  font-size: 26px;
}

.sheet-document-head > div > span {
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
}

.sheet-document-head > small {
  color: var(--muted);
  text-align: right;
}

.sheet-document-body {
  display: grid;
  gap: 16px;
  padding-top: 16px;
}

.sheet-document-body div {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-soft);
}

.sheet-document-body span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.sheet-document-body p {
  margin: 5px 0 0;
  line-height: 1.5;
}

.sheet-seal {
  margin-top: 18px;
  padding: 10px;
  border-left: 3px solid var(--primary);
  color: var(--muted);
  font-size: 12px;
  font-style: italic;
}

.clinical-full-form {
  display: grid;
  gap: 22px;
  padding-bottom: 12px;
}

.clinical-hero {
  display: flex;
  justify-content: space-between;
  gap: 28px;
  padding: 22px 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(110deg, color-mix(in srgb, var(--primary) 14%, var(--surface-strong)), var(--surface-strong) 48%, color-mix(in srgb, #e996ca 14%, var(--surface-strong)));
}

.clinical-hero-brand {
  display: flex;
  align-items: center;
  gap: 22px;
}

.clinical-form-logo {
  width: 112px;
  height: 112px;
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #07101b;
}

.clinical-form-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.clinical-hero h1,
.clinical-hero p {
  margin: 0;
}

.clinical-hero h1 {
  font-size: 34px;
}

.clinical-hero p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 16px;
  font-weight: 700;
}

.clinical-hero-meta {
  display: grid;
  grid-template-columns: minmax(190px, 1fr);
  align-content: center;
  gap: 12px;
  width: min(390px, 100%);
}

.clinical-hero-meta label,
.clinical-grid > label,
.wide-field {
  display: grid;
  gap: 7px;
  font-weight: 800;
}

.clinical-section {
  padding: 18px 22px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(115deg, color-mix(in srgb, var(--surface-strong) 90%, var(--primary) 10%), var(--surface-strong) 62%, color-mix(in srgb, var(--surface-strong) 90%, #eb9fc8 10%));
}

.clinical-section h3 {
  margin: 0 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 25px;
}

.clinical-section-body {
  display: grid;
  gap: 18px;
}

.clinical-grid {
  display: grid;
  gap: 14px;
}

.clinical-grid.three-columns {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.clinical-grid.two-columns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.medical-block,
.choice-group {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface-strong) 88%, var(--primary) 12%);
}

.choice-group > div {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.choice-option,
.check-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: var(--field-bg);
  font-weight: 800;
}

.choice-option input,
.check-option input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary-dark);
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.check-option {
  min-height: 48px;
  padding: 10px;
}

.odontogram-grid {
  display: grid;
  grid-template-columns: repeat(16, minmax(0, 1fr));
  gap: 7px;
}

.tooth-btn {
  display: grid;
  min-height: 72px;
  align-content: center;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  background: var(--field-bg);
  cursor: pointer;
  transition: transform 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.tooth-btn strong {
  font-size: 18px;
}

.tooth-btn small {
  color: var(--muted);
  font-weight: 800;
}

.tooth-btn:hover,
.tooth-btn.is-selected {
  transform: translateY(-2px);
  border-color: var(--primary-dark);
  background: var(--primary-gradient);
  box-shadow: 0 8px 18px color-mix(in srgb, var(--primary) 28%, transparent);
}

.tooth-btn.is-selected,
.tooth-btn.is-selected small {
  color: #fff;
}

.wide-field {
  margin-top: 14px;
}

.clinical-actions {
  justify-content: flex-end;
}

.sheet-view-section {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
}

.sheet-view-section h3 {
  margin: 0 0 10px;
  color: var(--primary-dark);
  font-size: 17px;
}

.sheet-view-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.sheet-view-grid > div {
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: var(--surface);
}

.sheet-view-grid span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.sheet-view-grid p {
  margin: 5px 0 0;
  line-height: 1.4;
}

@media (max-width: 860px) {
  .login-shell {
    align-items: start;
    padding: 12px;
  }

  .login-card,
  .login-card.is-wide,
  .login-card.is-onboarding {
    width: 100%;
    padding: 18px;
  }

  .auth-grid,
  .onboarding-summary,
  .activation-lock {
    grid-template-columns: 1fr;
  }

  .onboarding-grid .span-two {
    grid-column: auto;
  }

  .onboarding-steps {
    gap: 5px;
  }

  .onboarding-step {
    min-height: 54px;
    grid-template-columns: 24px 1fr;
    padding: 7px;
  }

  .onboarding-step span {
    width: 24px;
    height: 24px;
  }

  .onboarding-step small {
    display: none;
  }

  .onboarding-account {
    grid-template-columns: 1fr auto;
  }

  .onboarding-account > span {
    display: none;
  }

  .auth-actions {
    flex-direction: column-reverse;
  }

  .auth-actions button {
    width: 100%;
  }

  .v1-modal .form-grid,
  .v1-modal .detail-list > .form-grid,
  .finance-totals,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .clinical-toolbar,
  .clinical-patient-head,
  .clinical-card,
  .sheet-card,
  .sheet-document-head {
    align-items: stretch;
    flex-direction: column;
  }

  .clinical-fields,
  .clinical-patient-input {
    grid-template-columns: 1fr;
  }

  .clinical-hero,
  .clinical-hero-brand {
    align-items: stretch;
    flex-direction: column;
  }

  .clinical-hero-meta {
    width: 100%;
  }

  .clinical-grid.three-columns,
  .clinical-grid.two-columns,
  .check-grid,
  .sheet-view-grid {
    grid-template-columns: 1fr;
  }

  .odontogram-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  body {
    background: var(--app-bg);
  }

  .topbar {
    display: block;
    padding: 12px 8px 10px;
  }

  .clinic-brand {
    margin-bottom: 8px;
  }

  .clinic-brand .logo {
    width: 52px;
    height: 52px;
    border-radius: 12px;
  }

  .main-tools {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 9px;
  }

  .main-tools .desktop-only,
  .right-tools .desktop-only {
    display: none;
  }

  .mobile-actions {
    display: flex;
    justify-content: flex-end;
  }

  .right-bottom {
    display: none;
  }

  .right-tools {
    display: grid;
    justify-items: stretch;
    margin-top: 8px;
  }

  .right-tools .select {
    width: 100%;
    min-height: 56px;
    font-size: 24px;
    font-weight: 800;
  }

  .hello {
    display: block;
    margin: 8px 0 10px;
    font-size: 20px;
  }

  .hello strong {
    display: block;
    font-size: 44px;
  }

  .range {
    font-size: 13px;
  }

  .mobile-top-label {
    display: block;
    margin: 8px 0;
    min-height: 56px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    text-align: center;
    font-size: 24px;
    font-weight: 800;
  }

  .content {
    padding: 10px 8px 26px;
  }

  .status-strip {
    grid-template-columns: 1fr auto;
    min-height: 54px;
  }

  .month-title {
    font-size: 28px;
  }

  .calendar {
    grid-template-columns: 90px minmax(240px, 1fr);
    border: 0;
    gap: 9px 10px;
    background: transparent;
    overflow: visible;
  }

  .calendar .head {
    display: none;
  }

  .calendar .cell:not(.time):not(.mobile-active) {
    display: none;
  }

  .cell {
    min-height: 132px;
    border: 0;
    border-radius: 12px;
    background: var(--surface);
  }

  .time {
    display: grid;
    place-items: center;
    min-height: 132px;
    font-size: 28px;
    border-radius: 12px;
  }

  .appointment,
  .blank-slot {
    min-height: 112px;
    display: grid;
    align-content: center;
    padding: 18px;
    font-size: 30px;
  }

  .appointment span {
    font-size: 16px;
  }

  .blank-slot::after {
    content: "Disponible";
    font-size: 42px;
    font-weight: 800;
  }

  .mobile-days {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 10px 0 8px;
    border-bottom: 4px solid rgba(120, 145, 158, 0.32);
  }

  .mobile-day {
    min-width: 190px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
  }

  .mobile-day.active {
    box-shadow: inset 0 -3px 0 var(--primary);
    background: var(--cell-hover);
  }

  .mobile-day strong {
    display: block;
    font-size: 28px;
  }

  .mobile-question {
    display: grid;
    grid-template-columns: 34px 1fr 34px;
    gap: 8px;
    align-items: center;
    margin: 18px 0;
    font-size: 30px;
    font-weight: 900;
    text-align: center;
  }

  .floating-actions {
    position: fixed;
    right: 12px;
    bottom: 68px;
    z-index: 10;
    display: grid;
    gap: 10px;
  }

  .float-btn {
    width: 100px;
    min-height: 82px;
    border: 0;
    border-radius: 24px;
    color: #fff;
    background: var(--primary-gradient);
    box-shadow: 0 16px 30px rgba(20, 91, 118, 0.22);
    font-size: 20px;
    font-weight: 900;
  }

  .cards-grid {
    grid-template-columns: 1fr;
  }
}

.pwa-install-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(10, 22, 28, 0.48);
  backdrop-filter: blur(7px);
}

.pwa-install-card {
  width: min(460px, 100%);
  overflow: hidden;
  border: 1px solid rgba(83, 190, 224, 0.42);
  border-radius: 18px;
  background:
    linear-gradient(140deg, rgba(255, 255, 255, 0.96), rgba(226, 250, 255, 0.9)),
    var(--surface);
  box-shadow: 0 30px 75px rgba(6, 30, 43, 0.32);
  color: var(--text);
}

.pwa-install-head {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 14px;
  align-items: center;
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--line);
}

.pwa-install-head img {
  width: 58px;
  height: 58px;
  border-radius: 14px;
  object-fit: cover;
  box-shadow: 0 12px 25px rgba(5, 40, 52, 0.18);
}

.pwa-install-head h2 {
  margin: 0 0 4px;
  font-size: 22px;
}

.pwa-install-head p,
.pwa-install-body p {
  margin: 0;
  color: var(--muted);
}

.pwa-install-body {
  display: grid;
  gap: 10px;
  padding: 22px 24px;
  line-height: 1.45;
}

.pwa-install-body small {
  color: var(--muted);
  font-weight: 700;
}

.pwa-install-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 0 24px 24px;
}

.pwa-install-actions .ghost-btn,
.pwa-install-actions .primary-btn {
  min-width: 130px;
}

.clinic-dashboard {
  width: min(1040px, 100%);
  margin: 0 auto;
  padding: clamp(12px, 3vw, 32px);
  color: var(--text);
}
.clinic-header, .clinic-section-head, .clinic-identity, .clinic-nav, .clinic-week-tools, .clinic-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
.clinic-header, .clinic-section-head, .clinic-nav { justify-content: space-between; }
.clinic-header h1 { margin: 4px 0; }
.clinic-header small, .clinic-booking small { color: var(--muted); }
.clinic-section {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: clamp(15px, 3vw, 30px);
  background: var(--surface-strong);
}
.clinic-nav { margin: 18px 0; }
.clinic-nav label, .clinic-week-tools label { display: inline-flex; align-items: center; gap: 8px; }
.clinic-week-tools { margin: 12px 0 18px; }
.clinic-week-tools .field { width: auto; }
.clinic-section h2 { margin: 0 0 12px; }
.clinic-day { margin: 24px 0 8px; }
.clinic-booking {
  width: 100%;
  display: grid;
  grid-template-columns: 70px 1fr auto;
  gap: 16px;
  align-items: center;
  background: var(--surface);
  color: var(--text);
  text-align: left;
  font: inherit;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin: 4px 0;
  padding: 12px 16px;
}
.clinic-booking span { min-width: 0; overflow-wrap: anywhere; }
.clinic-booking small { display: block; }
.clinic-notes, .clinic-history dd { white-space: pre-wrap; overflow-wrap: anywhere; }
.clinic-history dt { font-weight: 650; margin-top: 12px; }
.clinic-history dd { margin: 3px 0 10px; }
.clinic-section summary { cursor: pointer; padding: 10px 0; }
.clinic-section [data-form-error] { color: var(--text); font-weight: 650; }
@media (max-width: 560px) {
  .clinic-booking { grid-template-columns: 60px 1fr; gap: 6px 12px; }
  .clinic-booking > span:last-child:not(:nth-child(2)) { grid-column: 2; }
  .clinic-week-tools label { flex-basis: 100%; order: -1; }
}
.clinic-panel-frame {
  display: block;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  border: 0;
  background: #f5f7fa;
}
#app.clinic-panel-active { display: block; width: 100%; max-width: none; padding: 0; }
