@import url('https://fonts.googleapis.com/css2?family=Inter:ital,wght@0,400;0,500;0,600;0,700;0,800;0,900;1,400;1,600&display=swap');

:root {
    --bg: #060c1a;
    --card: #0c1525;
    --card-light: #111e35;
    --card-bg: #0c1525;
    --border: rgba(255, 255, 255, 0.08);
    --accent: #38bdf8;
    --accent-2: #fbbf24;
    --text: #eef4ff;
    --muted: #8ab3d4;
    --success: #34d399;
    --danger: #fb7185;
    --shadow: 0 24px 64px rgba(0, 0, 0, 0.65);
    --radius: 14px;
}

body[data-theme="light"] {
    --bg: #f1f5f9;
    --card: #ffffff;
    --card-light: #f8fafc;
    --card-bg: #ffffff;
    --border: #e2e8f0;
    --accent: #2563eb;
    --accent-2: #f59e0b;
    --text: #0f172a;
    --muted: #64748b;
    --success: #059669;
    --danger: #dc2626;
    --shadow: 0 1px 3px rgba(0,0,0,0.05), 0 4px 20px rgba(15,23,42,0.07);
    --radius: 14px;
}

* {
    box-sizing: border-box;
}

*:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
}

html {
    scroll-behavior: smooth;
    scrollbar-gutter: stable;
}

body {
    margin: 0;
    font-family: "Inter", "Segoe UI", system-ui, sans-serif;
    background:
        radial-gradient(ellipse 80% 45% at 10% -8%, rgba(99,102,241,0.28) 0%, transparent 55%),
        radial-gradient(ellipse 55% 30% at 92% 2%, rgba(56,189,248,0.13) 0%, transparent 50%),
        radial-gradient(ellipse 65% 55% at 50% 108%, rgba(168,85,247,0.11) 0%, transparent 50%),
        #04070e;
    color: var(--text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-feature-settings: "cv11", "salt";
}

body[data-theme="light"] {
    background: #f1f5f9;
}

.app {
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app {
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px max(36px, calc((100vw - 1200px) / 2 + 48px));
    position: sticky;
    top: 0;
    backdrop-filter: blur(16px) saturate(1.4);
    background: rgba(9, 15, 31, 0.92);
    z-index: 10;
    gap: 16px;
    flex-wrap: wrap;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.topbar h1 {
    margin: 0;
    font-size: clamp(15px, 1.5rem, 21px);
    white-space: normal;
    line-height: 1.25;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.brand-line2 {
    display: block;
    font-size: 0.82em;
    opacity: 0.85;
    font-weight: 500;
}

body[data-theme="light"] .topbar {
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.topbar::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent) 0%, #6366f1 50%, #a855f7 100%);
    pointer-events: none;
    z-index: 11;
    opacity: 0.55;
}

body[data-theme="light"] .topbar::before {
    background: linear-gradient(90deg, #2563eb 0%, #6366f1 50%, #8b5cf6 100%);
    opacity: 1;
}

.top-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.brand {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
    flex: 1;
}

.logo {
    height: 56px;
    width: auto;
    max-width: 140px;
    object-fit: contain;
    flex-shrink: 0;
}

.subtitle {
    color: var(--muted);
    margin: 4px 0 0;
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lang-toggle {
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(17, 26, 52, 0.8);
    color: var(--text);
    padding: 9px 20px;
    border-radius: 999px;
    cursor: pointer;
    display: flex;
    gap: 10px;
    align-items: center;
    box-shadow: 0 4px 16px rgba(0,0,0,0.25), inset 0 1px 0 rgba(255,255,255,0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    font-size: 13.5px;
    font-weight: 500;
    letter-spacing: 0.01em;
}

body[data-theme="light"] .lang-toggle {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #0f172a;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.07);
    font-weight: 500;
}

.lang-toggle, .primary, .secondary, .ghost {
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.lang-toggle:hover {
    transform: translateY(-2px) scale(1.02);
}

.lang-toggle .lang-en {
    opacity: 0.5;
}

.lang-toggle.is-en .lang-es {
    opacity: 0.5;
}

.lang-toggle.is-en .lang-en {
    opacity: 1;
}

.content {
    padding: 32px 48px 96px;
    display: grid;
    gap: 28px;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

/* Paired button group */
.btn-group {
    display: inline-flex;
    gap: 0;
    flex-shrink: 0;
}
.btn-group > button {
    border-radius: 0;
    border-right-width: 0;
    margin: 0;
}
.btn-group > button:first-child {
    border-radius: 12px 0 0 12px;
}
.btn-group > button:last-child {
    border-radius: 0 12px 12px 0;
    border-right-width: 1px;
    border-left: 1px solid rgba(255,255,255,0.12);
}
body[data-theme="light"] .btn-group > button:last-child {
    border-left-color: rgba(15,23,42,0.12);
}

.toolbar .sort-select,
.toolbar #favoriteToggle,
.toolbar #exportProgress,
.toolbar #showShortcuts,
.toolbar .service-count,
.toolbar .save-pill {
    display: none !important;
}

.toolbar .search-box {
    flex: 1;
    max-width: 600px;
}

.toolbar .ghost {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    white-space: nowrap;
}

.toolbar .ghost svg {
    flex-shrink: 0;
}

.sort-select {
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(17, 26, 46, 0.8);
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sort-select:hover {
    border-color: rgba(35, 201, 255, 0.3);
    background: rgba(17, 26, 46, 0.9);
}

body[data-theme="light"] .sort-select {
    background: #ffffff;
    border-color: rgba(15, 23, 42, 0.15);
}

body[data-theme="light"] .sort-select:hover {
    border-color: rgba(35, 201, 255, 0.4);
}

.service-count {
    padding: 10px 16px;
    border-radius: 999px;
    background: rgba(35, 201, 255, 0.15);
    color: var(--accent);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.search-box {
    flex: 1 1 280px;
}

.search-box input {
    width: 100%;
    padding: 13px 20px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(17, 26, 52, 0.85);
    color: var(--text);
    font-size: 14.5px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.25), inset 0 1px 0 rgba(255,255,255,0.05);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-box input:focus {
    outline: none;
    border-color: rgba(35, 201, 255, 0.5);
    box-shadow: 0 0 0 3px rgba(35,201,255,0.12), 0 2px 16px rgba(0,0,0,0.25), inset 0 1px 0 rgba(255,255,255,0.05);
}

body[data-theme="light"] .search-box input {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 1px 4px rgba(15,23,42,0.06);
}

body[data-theme="light"] .search-box input:focus {
    border-color: rgba(37, 99, 235, 0.5);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1), 0 2px 12px rgba(15,23,42,0.08);
}

.save-pill {
    padding: 10px 16px;
    border-radius: 999px;
    background: rgba(61, 220, 151, 0.15);
    color: var(--success);
    font-size: 13px;
}

#favoriteToggle.is-active {
    box-shadow: 0 0 0 1px rgba(255, 183, 3, 0.4);
}

.intro-card {
    position: relative;
    padding: 40px 52px;
    margin-bottom: 4px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, rgba(35, 201, 255, 0.18) 0%, rgba(99, 102, 241, 0.15) 50%, rgba(255, 183, 3, 0.12) 100%);
    box-shadow: var(--shadow), 0 0 0 1px rgba(35, 201, 255, 0.12);
    overflow: hidden;
    cursor: pointer;
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.intro-card:hover {
    box-shadow: var(--shadow), 0 0 0 2px rgba(35, 201, 255, 0.4);
    transform: translateY(-1px);
}

.intro-card:active {
    transform: translateY(0);
}

body[data-theme="light"] .intro-card:hover {
    box-shadow: 0 28px 72px rgba(15, 23, 42, 0.4), 0 8px 32px rgba(99, 102, 241, 0.2);
}

body[data-theme="light"] .intro-card.intro-card--image:hover {
    box-shadow: 0 8px 32px rgba(15, 23, 42, 0.1), 0 2px 8px rgba(15, 23, 42, 0.05);
    border-color: #cbd5e1;
}

.intro-search-hint {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 14px;
    padding: 7px 16px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    font-size: 13px;
    color: rgba(255, 255, 255, 0.75);
    pointer-events: none;
    transition: background 0.2s;
}

.intro-card:hover .intro-search-hint {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
}

body[data-theme="light"] .intro-search-hint {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(255, 255, 255, 0.16);
    color: rgba(255, 255, 255, 0.65);
}

body[data-theme="light"] .intro-card:hover .intro-search-hint {
    background: rgba(255, 255, 255, 0.16);
    color: rgba(255, 255, 255, 0.92);
}

.intro-card h2 {
    font-size: clamp(22px, 2.8vw, 36px);
    font-weight: 900;
    margin: 0 0 10px;
    background: linear-gradient(135deg, #fff 20%, #6ee7ff 60%, #a78bfa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.045em;
    line-height: 1.1;
}

body[data-theme="light"] .intro-card h2 {
    background: linear-gradient(135deg, #f0f9ff 0%, #7dd3fc 45%, #c4b5fd 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
body[data-theme="light"] .intro-card p {
    color: rgba(186, 230, 255, 0.78);
}

.intro-card p {
    margin: 0;
    color: rgba(180, 210, 255, 0.85);
    font-size: 15px;
    line-height: 1.7;
    max-width: 600px;
    font-weight: 400;
}

.intro-card::after {
    content: "";
    position: absolute;
    inset: -40% 0 auto 0;
    height: 220px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
    transform: translateX(-120%);
    animation: sweep 6s ease-in-out infinite;
    pointer-events: none;
}

body[data-theme="light"] .intro-card::after {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
}

/* Eyebrow label — text-mode intro card only */
.intro-card:not(.intro-card--image)::before {
    content: "◈  SERVICIOS CONSULARES";
    position: absolute;
    top: 20px;
    left: 52px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.18em;
    color: rgba(35, 201, 255, 0.7);
    text-transform: uppercase;
    pointer-events: none;
    z-index: 2;
}

body[data-theme="light"] .intro-card:not(.intro-card--image)::before {
    color: rgba(125, 211, 252, 0.7);
}

.intro-card:not(.intro-card--image) {
    padding-top: 54px;
}

body[data-theme="light"] .intro-card {
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #130c2e 100%);
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.3), 0 8px 24px rgba(15, 23, 42, 0.15);
    border: none;
}

/* Image hero: clean white with soft lavender glow */
body[data-theme="light"] .intro-card.intro-card--image {
    background: linear-gradient(135deg, #f0f4ff 0%, #fafafe 55%, #f5f0ff 100%);
    box-shadow: 0 4px 32px rgba(99,102,241,0.1), 0 1px 4px rgba(15,23,42,0.05);
    border: 1px solid rgba(99,102,241,0.12);
}

body[data-theme="light"] .intro-card.intro-card--image .glow {
    display: block;
    background: radial-gradient(circle, rgba(99,102,241,0.12), transparent 60%);
    width: 380px;
    height: 380px;
    top: -130px;
    right: -100px;
}

.intro-card .glow {
    position: absolute;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(35, 201, 255, 0.35), transparent 60%);
    top: -120px;
    right: -120px;
    animation: pulse 6s ease-in-out infinite;
}

body[data-theme="light"] .intro-card .glow {
    background: radial-gradient(circle, rgba(56, 189, 248, 0.3), transparent 60%);
    width: 400px;
    height: 400px;
    top: -150px;
    right: -110px;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

@keyframes sweep {
    0% { transform: translateX(-120%); }
    50% { transform: translateX(120%); }
    100% { transform: translateX(120%); }
}

.services {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    align-items: start;
    perspective: 1200px;
}

.service-card {
    height: auto;
    padding: 24px;
    border-radius: var(--radius);
    background: linear-gradient(160deg, var(--card-light) 0%, var(--card) 100%);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.09);
    display: grid;
    grid-template-rows: auto 140px auto auto;
    gap: 12px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
    animation: cardEntrance 0.55s cubic-bezier(0.16, 1, 0.3, 1) both;
    position: relative;
    overflow: hidden;
    scroll-margin-top: 90px;
}

/* Fun backgrounds when enabled */
body[data-fun-backgrounds="true"] .service-card:nth-child(6n+1) {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(168, 85, 247, 0.06));
}

body[data-fun-backgrounds="true"] .service-card:nth-child(6n+2) {
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.08), rgba(251, 146, 60, 0.06));
}

body[data-fun-backgrounds="true"] .service-card:nth-child(6n+3) {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.08), rgba(34, 211, 238, 0.06));
}

body[data-fun-backgrounds="true"] .service-card:nth-child(6n+4) {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(52, 211, 153, 0.06));
}

body[data-fun-backgrounds="true"] .service-card:nth-child(6n+5) {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.08), rgba(251, 191, 36, 0.06));
}

body[data-fun-backgrounds="true"] .service-card:nth-child(6n+6) {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.08), rgba(249, 115, 22, 0.06));
}

/* Light mode backgrounds */
body[data-theme="light"][data-fun-backgrounds="true"] .service-card:nth-child(6n+1) {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.06), rgba(168, 85, 247, 0.04));
}

body[data-theme="light"][data-fun-backgrounds="true"] .service-card:nth-child(6n+2) {
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.06), rgba(251, 146, 60, 0.04));
}

body[data-theme="light"][data-fun-backgrounds="true"] .service-card:nth-child(6n+3) {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.06), rgba(34, 211, 238, 0.04));
}

body[data-theme="light"][data-fun-backgrounds="true"] .service-card:nth-child(6n+4) {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.06), rgba(52, 211, 153, 0.04));
}

body[data-theme="light"][data-fun-backgrounds="true"] .service-card:nth-child(6n+5) {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.06), rgba(251, 191, 36, 0.04));
}

body[data-theme="light"][data-fun-backgrounds="true"] .service-card:nth-child(6n+6) {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.06), rgba(249, 115, 22, 0.04));
}

.service-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), rgba(99,102,241,0.8), var(--accent-2));
    border-radius: var(--radius) var(--radius) 0 0;
    opacity: 0.45;
    transition: opacity 0.3s ease;
    z-index: 1;
}

/* Per-card accent stripe colors */
.service-card:nth-child(6n+1)::before { background: linear-gradient(90deg, #6366f1, #8b5cf6); }
.service-card:nth-child(6n+2)::before { background: linear-gradient(90deg, #0ea5e9, #6366f1); }
.service-card:nth-child(6n+3)::before { background: linear-gradient(90deg, #10b981, #06b6d4); }
.service-card:nth-child(6n+4)::before { background: linear-gradient(90deg, #f59e0b, #f97316); }
.service-card:nth-child(6n+5)::before { background: linear-gradient(90deg, #ec4899, #a855f7); }
.service-card:nth-child(6n+6)::before { background: linear-gradient(90deg, #23c9ff, #6366f1); }

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0 0 1px rgba(56,189,248,0.3), 0 20px 56px rgba(56,189,248,0.14), 0 8px 24px rgba(0,0,0,0.4);
    border-color: rgba(56,189,248,0.28);
}

body[data-theme="light"] .service-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 40px rgba(15,23,42,0.13), 0 4px 12px rgba(15,23,42,0.07);
    border-color: #94a3b8;
}

.service-card:hover::before {
    opacity: 1;
}

body[data-theme="light"] .service-card::before { opacity: 0.55; }
body[data-theme="light"] .service-card:hover::before { opacity: 1; }

.service-card:nth-child(2n) {
    animation-delay: 0.1s;
}

.service-card:nth-child(3n) {
    animation-delay: 0.2s;
}

.service-card:nth-child(4n) {
    animation-delay: 0.3s;
}

@keyframes cardEntrance {
    from {
        opacity: 0;
        transform: perspective(800px) rotateX(12deg) translateY(40px) scale(0.95);
        filter: blur(2px);
    }
    to {
        opacity: 1;
        transform: perspective(800px) rotateX(0deg) translateY(0) scale(1);
        filter: blur(0);
    }
}

@keyframes cardGlow {
    0%, 100% {
        box-shadow: 0 0 0 rgba(35, 201, 255, 0);
    }
    50% {
        box-shadow: 0 18px 50px rgba(35, 201, 255, 0.08);
    }
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.service-title {
    margin: 0;
    font-size: 20px;
    font-weight: 800;
    color: var(--text);
    flex: 1;
    line-height: 1.2;
    letter-spacing: -0.03em;
    text-shadow: 0 0 32px rgba(35,201,255,0.18), 0 2px 4px rgba(0,0,0,0.25);
}

body[data-theme="light"] .service-title {
    text-shadow: none;
    color: #0f172a;
    font-size: 18px;
}

.req-count-chip {
    display: none;
}

body[data-theme="light"] .service-card {
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.1);
    box-shadow: 0 2px 10px rgba(15,23,42,0.06), 0 1px 3px rgba(15,23,42,0.04);
}

/* Per-card light-mode tinting */
body[data-theme="light"] .service-card:nth-child(6n+1) { background: linear-gradient(to bottom, rgba(99,102,241,0.04) 0%, #ffffff 18%); }
body[data-theme="light"] .service-card:nth-child(6n+2) { background: linear-gradient(to bottom, rgba(14,165,233,0.05) 0%, #ffffff 18%); }
body[data-theme="light"] .service-card:nth-child(6n+3) { background: linear-gradient(to bottom, rgba(16,185,129,0.05) 0%, #ffffff 18%); }
body[data-theme="light"] .service-card:nth-child(6n+4) { background: linear-gradient(to bottom, rgba(245,158,11,0.05) 0%, #ffffff 18%); }
body[data-theme="light"] .service-card:nth-child(6n+5) { background: linear-gradient(to bottom, rgba(236,72,153,0.04) 0%, #ffffff 18%); }
body[data-theme="light"] .service-card:nth-child(6n+6) { background: linear-gradient(to bottom, rgba(35,201,255,0.04) 0%, #ffffff 18%); }

.service-desc {
    font-size: 14px;
    color: var(--muted);
    line-height: 1.65;
    overflow: visible;
    overflow-wrap: break-word;
    word-break: break-word;
}

.service-desc a {
    color: var(--accent);
    text-decoration: none;
    overflow-wrap: break-word;
    word-break: break-all;
}

.service-desc ul,
.service-desc ol {
    margin: 8px 0 0 20px;
    padding: 0;
}

.service-desc li {
    margin: 4px 0;
}

/* Paragraph chunks in card description */
.service-desc .desc-block {
    display: block;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 10px;
    padding: 8px 12px;
    margin: 5px 0;
    font-size: 13px;
    line-height: 1.55;
    color: var(--text);
}

body[data-theme="light"] .service-desc .desc-block {
    background: rgba(15, 23, 42, 0.035);
    border-color: rgba(15,23,42,0.08);
}

.service-image {
    height: 100%;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

body[data-theme="light"] .service-image {
    background: #f8fafc;
    border-color: #e2e8f0;
}

.service-image.is-empty {
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed rgba(255, 255, 255, 0.1);
}

body[data-theme="light"] .service-image.is-empty {
    border-color: rgba(15, 23, 42, 0.12);
    background: rgba(15, 23, 42, 0.04);
}

.service-image-img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    object-position: center;
}

.card-footer {
    margin-top: auto;
}

.front-actions {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
}

.price-value {
    display: inline-block;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, var(--accent), rgba(99,102,241,0.9));
    padding: 4px 14px 4px 11px;
    border-radius: 999px;
    letter-spacing: 0.02em;
    box-shadow: 0 2px 12px rgba(35, 201, 255, 0.35), inset 0 1px 0 rgba(255,255,255,0.2);
}

body[data-theme="light"] .price-value {
    background: linear-gradient(135deg, #2563eb, #4f46e5);
    color: #fff;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.action-favorite {
    font-size: 20px;
    line-height: 1;
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--muted);
    transition: all 0.3s ease;
}

.action-favorite:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.1);
}

.action-favorite.is-active {
    color: var(--accent-2);
    background: rgba(255, 183, 3, 0.2);
}

.primary, .secondary, .ghost {
    border: none;
    border-radius: 12px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    font-family: inherit;
}

.primary {
    position: relative;
    overflow: hidden;
}

.primary::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.35), transparent 60%);
    opacity: 0;
    transform: scale(0.2);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.primary:active::after {
    opacity: 1;
    transform: scale(1.6);
}

.primary {
    background: linear-gradient(135deg, var(--accent), #0ea5e9);
    color: #04111f;
    font-weight: 600;
    box-shadow: 0 8px 20px rgba(56, 189, 248, 0.32);
}

body[data-theme="light"] .primary {
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.2);
}

.secondary {
    background: rgba(255, 255, 255, 0.07);
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, 0.11);
}

body[data-theme="light"] .secondary {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    color: var(--text);
    box-shadow: 0 1px 3px rgba(15,23,42,0.06);
}

.ghost {
    background: transparent;
    color: var(--muted);
}

.primary:focus, .secondary:focus, .ghost:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.primary:hover, .secondary:hover, .ghost:hover {
    transform: translateY(-2px);
}

.primary:hover {
    transform: translateY(-3px) scale(1.02);
}

.secondary:hover {
    transform: translateY(-2px) scale(1.01);
}

.primary:active, .secondary:active, .ghost:active {
    transform: translateY(0) scale(0.98);
}

.icon-button {
    align-self: flex-end;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 10px;
    color: var(--text);
    padding: 6px 10px;
    cursor: pointer;
}

.requirements {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    color: var(--text);
}

.progress {
    display: grid;
    gap: 6px;
}

.progress-track {
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    position: relative;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--accent), var(--success));
    transition: width 0.3s ease;
}

.progress-bar {
    animation: shimmerBar 3s linear infinite;
    background-size: 200% 100%;
}

@keyframes shimmerBar {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

.progress-text {
    font-size: 12px;
    color: var(--muted);
    margin-top: 6px;
    display: inline-block;
}

.requirements li {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: start;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    transition: background 0.2s ease, transform 0.2s ease;
    flex-wrap: nowrap;
}

.requirements li:hover {
    transform: translateY(-1px);
}

body[data-theme="light"] .requirements li {
    background: rgba(15, 23, 42, 0.04);
}

.requirements input {
    accent-color: var(--accent);
}

.requirements .req-desc {
    font-size: 12px;
    color: var(--muted);
    margin-left: 0;
    margin-top: 4px;
    grid-column: 2 / -1;
    line-height: 1.4;
}

.requirements.nested {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-left: 20px;
    margin-top: 8px;
    padding-left: 12px;
    border-left: 2px solid rgba(255, 255, 255, 0.1);
}

body[data-theme="light"] .requirements.nested {
    border-left-color: rgba(15, 23, 42, 0.15);
}

body[data-theme="light"] .requirements.nested {
    border-left-color: rgba(15, 23, 42, 0.15);
}

.req-badge {
    margin-left: auto;
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(245, 158, 11, 0.18);
    color: var(--accent-2);
    grid-column: 3 / 4;
    justify-self: end;
    align-self: start;
}

.requirements li span {
    font-weight: 500;
    line-height: 1.5;
}

.requirements li > span:not(.req-badge) {
    grid-column: 2 / 3;
    word-break: break-word;
}

.requirements li input[type="checkbox"] {
    margin-top: 2px;
    width: 18px;
    height: 18px;
    grid-column: 1 / 2;
    cursor: pointer;
    flex-shrink: 0;
}

.requirements li.checked {
    background: rgba(61, 220, 151, 0.15);
    color: var(--success);
    border-color: rgba(61, 220, 151, 0.3);
}

body[data-theme="light"] .requirements li.checked {
    background: rgba(61, 220, 151, 0.08);
    border-color: rgba(61, 220, 151, 0.25);
}

.requirements li.checked .req-badge {
    background: rgba(61, 220, 151, 0.25);
    color: var(--success);
}

.requirements .req-question {
    grid-column: 2 / -1;
    padding-top: 4px;
}

.requirements .req-question select {
    width: 100%;
}

.price-box {
    margin-top: auto;
    padding: 16px;
    border-radius: 16px;
    background: rgba(255, 183, 3, 0.14);
    display: grid;
    gap: 4px;
}

.price-value {
    font-size: 24px;
    font-weight: 700;
}

.price-note {
    color: var(--muted);
    font-size: 13px;
}

.card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.empty-state {
    display: none;
    text-align: center;
    padding: 48px 24px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--muted);
    font-size: 16px;
}

body[data-theme="light"] .empty-state {
    background: rgba(15, 23, 42, 0.04);
}

.admin-body {
    background: var(--bg);
    color: var(--text);
}

body[data-theme="light"].admin-body {
    background: #eef2f9;
}

.admin-login {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 24px;
}

.login-card {
    background: var(--card);
    padding: 32px;
    border-radius: var(--radius);
    width: min(420px, 90vw);
    box-shadow: var(--shadow);
    display: grid;
    gap: 16px;
}

body[data-theme="light"] .login-card {
    background: #ffffff;
    box-shadow: 0 10px 40px rgba(15, 23, 42, 0.12);
}

body[data-theme="light"] .login-card h1,
body[data-theme="light"] .login-card h2,
body[data-theme="light"] .login-card label,
body[data-theme="light"] .login-card p {
    color: #0f172a;
}

.login-card label {
    display: grid;
    gap: 8px;
}

.modal-content label {
    display: grid;
    gap: 10px;
}

.login-card input, .modal-content input, .modal-content textarea {
    background: #0f1830;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 12px 16px;
    color: var(--text);
    font-size: 15px;
    line-height: 1.5;
}

body[data-theme="light"] .login-card input,
body[data-theme="light"] .modal-content input,
body[data-theme="light"] .modal-content textarea {
    background: #ffffff;
    border-color: rgba(15, 23, 42, 0.12);
    color: #0f172a;
}

.modal-content label,
.modal-content legend,
.modal-content h3,
.modal-content span,
.modal-content p,
.modal-content fieldset,
.modal-content .checkbox-row,
.modal-content .inline-check {
    color: var(--text);
}

.modal-content h3 {
    margin: 0;
    font-size: 22px;
    padding-bottom: 16px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.modal-content label {
    font-weight: 600;
}

.modal-content label > span:first-child {
    font-size: 14px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 6px;
}

.modal-content label > span:first-child {
    font-size: 14px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 6px;
}

.modal-content textarea::placeholder,
.modal-content input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.modal-content fieldset {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 12px;
    padding: 16px 18px;
    display: grid;
    gap: 10px;
    margin: 0;
}

.modal-content fieldset legend {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
    padding: 2px 10px;
    background: var(--card);
    border-radius: 4px;
}

body[data-theme="light"] .modal-content fieldset {
    background: #f8fafc;
    border-color: #e2e8f0;
}

body[data-theme="light"] .modal-content fieldset legend {
    background: #ffffff;
}

.modal-content input[type="checkbox"] {
    accent-color: var(--accent);
}

/* Fix: checkbox/radio labels must be flex rows, not grid stacks */
.modal-content fieldset label,
.modal-content .checkbox-row label,
.modal-content label.inline-check,
.modal-content label.radio-row,
.modal-content label.service-perm-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    cursor: pointer;
}

.modal-content label.service-perm-item {
    font-weight: 400;
}

.radio-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    font-size: 14px;
    padding: 4px 0;
    cursor: pointer;
}

.radio-row input[type="radio"] {
    accent-color: var(--accent);
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.specific-services-wrap {
    margin-top: 10px;
    padding: 12px;
    border-radius: 10px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
}

.field-hint {
    font-size: 12px;
    color: var(--muted);
    margin: 0 0 10px;
}

.service-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 180px;
    overflow-y: auto;
    padding-right: 4px;
}

.service-perm-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 400;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 6px;
    transition: background 0.15s;
}

.service-perm-item:hover {
    background: rgba(255,255,255,0.05);
}

body[data-theme="light"] .specific-services-wrap {
    background: #f8fafc;
    border-color: #e2e8f0;
}

body[data-theme="light"] .service-perm-item:hover {
    background: #f1f5f9;
}

.tooltip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: var(--muted);
    font-size: 12px;
    margin-left: 6px;
    cursor: help;
}

/* ── User modal narrow width ── */
.user-modal {
    width: min(540px, 94vw) !important;
    gap: 16px;
}

/* ── Form block: replaces fieldsets in user modals ── */
.form-block {
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 14px;
    overflow: hidden;
}

body[data-theme="light"] .form-block {
    border-color: #e2e8f0;
}

.form-block-title {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 9px 14px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--accent);
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

body[data-theme="light"] .form-block-title {
    background: #f8fafc;
    border-bottom-color: #e2e8f0;
}

.form-block-body {
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ── Stacked label (text + input below it) ── */
.field-label {
    display: flex !important;
    flex-direction: column;
    gap: 5px;
    font-weight: 500;
}

.field-label > span:first-child {
    font-size: 12px;
    color: var(--muted);
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
}

body[data-theme="light"] .field-label > span:first-child {
    color: #64748b;
}

/* ── Inline checkbox/radio row ── */
.perm-check-row {
    display: flex !important;
    align-items: center !important;
    gap: 9px;
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 8px;
    margin: 0;
    transition: background 0.15s;
    line-height: 1.3;
}

.perm-check-row:hover {
    background: rgba(255, 255, 255, 0.06);
}

body[data-theme="light"] .perm-check-row:hover {
    background: rgba(15, 23, 42, 0.05);
}

.perm-check-row input[type="checkbox"],
.perm-check-row input[type="radio"] {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    accent-color: var(--accent);
    cursor: pointer;
    margin: 0;
}

trix-editor {
    background: #0f1830;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: var(--text);
    min-height: 160px;
    padding: 14px 16px;
    font-size: 15px;
    line-height: 1.6;
    pointer-events: auto !important;
    cursor: text !important;
    display: block;
    position: relative;
    z-index: 1;
}

trix-editor:empty:before {
    content: attr(placeholder);
    color: rgba(255, 255, 255, 0.4);
    pointer-events: none;
}

body[data-theme="light"] trix-editor:empty:before {
    color: rgba(15, 23, 42, 0.4);
}

trix-editor:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-color: var(--accent);
}

body[data-theme="light"] trix-editor {
    background: #ffffff;
    border-color: rgba(15, 23, 42, 0.12);
    color: #0f172a;
}

trix-toolbar .trix-button {
    color: var(--text);
}

trix-toolbar .trix-button-group {
    border-radius: 10px;
    overflow: hidden;
    border-color: rgba(255, 255, 255, 0.1);
}

trix-toolbar .trix-button {
    background: rgba(255, 255, 255, 0.06);
}

body[data-theme="light"] trix-toolbar .trix-button {
    color: #0f172a;
}

body[data-theme="light"] trix-toolbar .trix-button {
    background: rgba(15, 23, 42, 0.06);
}

trix-toolbar .trix-button--icon {
    filter: invert(1);
}

body[data-theme="light"] trix-toolbar .trix-button--icon {
    filter: none;
}

trix-toolbar {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    padding: 6px;
    margin-bottom: 8px;
}

body[data-theme="light"] trix-toolbar {
    background: rgba(15, 23, 42, 0.05);
}

trix-editor [contenteditable] {
    -webkit-user-modify: read-write !important;
    user-select: text !important;
    pointer-events: auto !important;
}

trix-editor .trix-content {
    pointer-events: auto !important;
    cursor: text !important;
}

/* ── Hero caption ───────────────────────────────────────────── */
.intro-card .hero-caption,
.intro-card .hero-caption-2,
.intro-card .hero-caption-3 {
    display: block;
    width: 100%;
    max-width: none;
    text-align: center;
    padding: 0 12px;
    font-size: 0.95rem;
    color: var(--text);
    line-height: 1.5;
}

/* In light mode the image card is white, so captions must be dark */
body[data-theme="light"] .intro-card.intro-card--image .hero-caption,
body[data-theme="light"] .intro-card.intro-card--image .hero-caption-2,
body[data-theme="light"] .intro-card.intro-card--image .hero-caption-3 {
    color: #334155;
}
.intro-card .hero-caption {
    margin: 10px 0 0;
    opacity: 0.82;
}
.intro-card .hero-caption-2 {
    margin-top: 4px;
    opacity: 0.7;
}
.intro-card .hero-caption-3 {
    margin-top: 4px;
    opacity: 0.6;
}
.intro-card .hero-caption b,
.intro-card .hero-caption strong,
.intro-card .hero-caption-2 b,
.intro-card .hero-caption-2 strong,
.intro-card .hero-caption-3 b,
.intro-card .hero-caption-3 strong {
    font-weight: 900;
}

/* ── Image lightbox ──────────────────────────────────────────── */
.img-lightbox-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0,0,0,0.88);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.img-lightbox-overlay.is-open {
    opacity: 1;
}
.img-lightbox-inner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 94vw;
    max-height: 92vh;
    cursor: default;
}
.img-lightbox-img {
    max-width: 90vw;
    max-height: 88vh;
    width: auto;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 8px 60px rgba(0,0,0,0.7);
    transition: transform 0.25s ease;
    transform-origin: center center;
    user-select: none;
    cursor: zoom-in;
}
.img-lightbox-img.zoomed {
    cursor: zoom-out;
}
.img-lightbox-close {
    position: absolute;
    top: -18px;
    right: -18px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.15);
    color: #fff;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(6px);
    transition: background 0.15s;
    z-index: 1;
}
.img-lightbox-close:hover {
    background: rgba(255,255,255,0.28);
}
/* Inline requirement images look clickable */
.requirements-content figure.attachment img,
.requirements-content .attachment--preview img {
    cursor: zoom-in;
}

/* Trix inline image: full width, no filename caption
   Applied both inside the editor AND in the rendered modal */
trix-editor .attachment--preview,
.attachment--preview,
figure.attachment {
    width: 100% !important;
    max-width: 100% !important;
    display: block;
    margin: 8px 0;
}
trix-editor .attachment--preview img,
trix-editor .attachment__content img,
.attachment--preview img,
figure.attachment img {
    width: 100% !important;
    height: auto !important;
    display: block;
    border-radius: 6px;
}
trix-editor .attachment__caption,
trix-editor .attachment__name,
trix-editor .attachment__size,
.attachment__caption,
.attachment__name,
.attachment__size,
figcaption.attachment__caption {
    display: none !important;
}

.form-section {
    background: rgba(255, 255, 255, 0.03);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

body[data-theme="light"] .form-section {
    background: rgba(15, 23, 42, 0.03);
    border-color: rgba(15, 23, 42, 0.08);
}

.image-preview {
    border-radius: 14px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.04);
    min-height: 120px;
    display: grid;
    place-items: center;
}

.image-preview img {
    width: 100%;
    max-height: 180px;
    object-fit: contain;
}

.image-preview .muted {
    color: var(--muted);
}

/* ── Admin inline images manager ── */
.inline-images-existing {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
}

.inline-img-item {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.inline-img-item img {
    width: 100%;
    height: auto;
    display: block;
    max-height: 220px;
    object-fit: contain;
}

.inline-img-remove {
    position: absolute;
    top: 6px;
    right: 6px;
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(220, 38, 38, 0.85);
    backdrop-filter: blur(4px);
    color: #fff;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    font-weight: 500;
}

.inline-img-remove input[type="checkbox"] {
    width: 14px;
    height: 14px;
    cursor: pointer;
    accent-color: #fff;
}

.inline-images-preview {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.trix-dialogs {
    color: var(--text);
}

.trix-dialog--link {
    background: var(--card);
    border-radius: 12px;
}

body[data-theme="light"] .trix-dialog--link {
    background: #ffffff;
}

.admin-shell {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
    background: var(--bg);
}

.admin-sidebar {
    background: #0b1220;
    padding: 0;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

body[data-theme="light"] .admin-sidebar {
    background: #1e293b;
}

/* Brand block */
.admin-sidebar .brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 28px 20px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
}

.admin-sidebar .brand .logo {
    height: 56px;
    width: auto;
    object-fit: contain;
}

.admin-sidebar .brand-text {
    text-align: center;
}

.admin-sidebar .brand-text h2 {
    margin: 0 0 2px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.5);
}

.admin-sidebar .brand-text p {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
}

/* Nav links */
.admin-sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 14px 12px;
    flex: 1;
}

.admin-sidebar nav a,
.admin-sidebar .sidebar-logout {
    color: rgba(255, 255, 255, 0.65);
    text-decoration: none;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.15s, color 0.15s;
}

.admin-sidebar nav a:hover,
.admin-sidebar .sidebar-logout:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

/* Logout pinned at bottom */
.sidebar-footer {
    padding: 12px;
    border-top: 1px solid rgba(255,255,255,0.07);
}

.admin-sidebar .sidebar-logout {
    width: 100%;
    color: rgba(255,255,255,0.45);
    font-size: 13px;
}

.admin-content {
    padding: 24px 32px;
    max-width: 1400px;
    min-width: 0;
    overflow-x: hidden;
}

body[data-theme="light"] .admin-content {
    background: #f1f5f9;
}

.admin-header {
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 20px;
    border-radius: 16px;
    background: var(--card);
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

body[data-theme="light"] .admin-header {
    background: #ffffff;
    border-color: rgba(15, 23, 42, 0.08);
    box-shadow: 0 1px 3px rgba(15,23,42,0.06), 0 4px 16px rgba(15,23,42,0.05);
}

.admin-header h1 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
}

.admin-header p {
    margin: 0;
    font-size: 13px;
    color: var(--muted);
    flex-basis: 100%;
    order: 10;
}

.admin-toggle {
    margin-left: auto;
}

.alert {
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 16px;
}

.alert.success {
    background: rgba(61, 220, 151, 0.2);
    color: var(--success);
}

.alert.error {
    background: rgba(255, 107, 107, 0.2);
    color: var(--danger);
}

.panel-section {
    margin-bottom: 24px;
}

.panel-section {
    background: var(--card);
    border-radius: 16px;
    padding: 20px 22px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

body[data-theme="light"] .panel-section {
    background: #ffffff;
    border-color: rgba(15, 23, 42, 0.08);
    box-shadow: 0 1px 3px rgba(15,23,42,0.05), 0 4px 16px rgba(15,23,42,0.05);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

body[data-theme="light"] .section-header {
    border-bottom-color: #f1f5f9;
}

.section-header h2 {
    font-size: 15px;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.01em;
}

.header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.service-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.service-tile {
    background: var(--card-light);
    padding: 0;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    gap: 0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.09);
    overflow: hidden;
}

.service-tile:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: rgba(56, 189, 248, 0.4);
}

body[data-theme="light"] .service-tile {
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.1);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

body[data-theme="light"] .service-tile:hover {
    border-color: #94a3b8;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.11);
}

/* Drag handle in tile context — compact top bar */
.service-tile .drag-handle {
    width: 100%;
    padding: 5px 0 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.02);
}

body[data-theme="light"] .service-tile .drag-handle {
    border-bottom-color: #e2e8f0;
    background: #fafbfc;
}

.service-tile {
    position: relative;
}

/* Tile image strip */
.tile-img-wrap {
    width: 100%;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.04);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
    overflow: hidden;
}

.tile-img-wrap.tile-img-empty {
    height: 40px;
    background: rgba(255, 255, 255, 0.02);
}

body[data-theme="light"] .tile-img-wrap {
    background: #f8fafc;
    border-bottom-color: #e2e8f0;
}

body[data-theme="light"] .tile-img-wrap.tile-img-empty {
    background: #f1f5f9;
}

.tile-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}

/* Tile inner content */
.service-tile h3 {
    font-size: 14px;
    font-weight: 600;
    margin: 0;
    padding: 12px 14px 4px;
    line-height: 1.3;
}

.service-tile p {
    font-size: 12px;
    color: var(--muted);
    margin: 0;
    padding: 0 14px 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5;
}

.service-tile .meta-row {
    padding: 0 14px;
    flex-wrap: wrap;
}

.service-tile .tile-actions {
    padding: 10px 14px 14px;
    margin-top: auto;
}

body[data-theme="light"] .service-tile,
body[data-theme="light"] .user-card {
    background: #ffffff;
}

body[data-theme="light"] .modal-content {
    background: #ffffff;
    color: #0f172a;
}

body[data-theme="light"] .modal-content h3,
body[data-theme="light"] .modal-content label,
body[data-theme="light"] .modal-content legend,
body[data-theme="light"] .modal-content span,
body[data-theme="light"] .modal-content p {
    color: #0f172a;
}

.meta-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 4px;
}

.badge {
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
}

.badge.active {
    background: rgba(52, 211, 153, 0.15);
    color: var(--success);
}

.badge.inactive {
    background: rgba(251, 113, 133, 0.15);
    color: var(--danger);
}

.meta {
    color: var(--muted);
    font-size: 12px;
}

.tile-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.tile-actions .secondary,
.tile-actions .ghost,
.tile-actions .primary {
    padding: 5px 12px;
    font-size: 12px;
}

.inline {
    display: inline;
}

.service-list, .user-list {
    display: grid;
    gap: 14px;
}

.user-card {
    background: var(--card-light);
    padding: 18px;
    border-radius: 16px;
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 14px;
}

@media (max-width: 900px) {
    .user-card {
        grid-template-columns: 1fr;
        align-items: start;
    }
}

.modal {
    border: none;
    border-radius: 20px;
    padding: 0;
    background: transparent;
}

.modal::backdrop {
    background: rgba(3, 6, 12, 0.6);
    backdrop-filter: blur(6px);
}

.modal-content {
    background: var(--card);
    padding: 32px;
    border-radius: 20px;
    display: grid;
    gap: 20px;
    width: min(900px, 94vw);
    box-shadow: var(--shadow);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content label,
.modal-content .req-item-header {
    min-width: 0;
}

.modal-content input,
.modal-content textarea,
.modal-content select,
trix-editor {
    width: 100%;
    max-width: 100%;
}

.field-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.checkbox-row {
    display: flex;
    gap: 12px;
}

.form-section {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.form-section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-section {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.form-section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Service Modal Fullscreen */
.service-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(3, 6, 12, 0.95);
    backdrop-filter: blur(12px);
    z-index: 1000;
    overflow-y: auto;
    animation: fadeIn 0.3s ease;
    perspective: 2000px;
}

body[data-theme="light"] .service-modal {
    background: rgba(241, 245, 249, 0.88);
    backdrop-filter: blur(20px);
}

.service-modal.is-open {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.service-modal-content {
    background: var(--card);
    border-radius: 0;
    max-width: none;
    width: 100%;
    height: 100vh;
    max-height: 100vh;
    box-shadow: none;
    position: relative;
    animation: slideUp 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* round the decor layer to nothing since container is fullscreen */
.modal-bg-decor {
    border-radius: 0;
}

/* ══════════════════════════════════════════════
   DECORATIVE MODAL BACKGROUND - Geometric Design
   ══════════════════════════════════════════════ */

.modal-bg-decor {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
    border-radius: 24px;
}

/* ── Bold top accent bar ── */
.decor-topbar {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 5px;
    border-radius: 24px 24px 0 0;
    z-index: 2;
}

/* ── Sunburst rays from top-right corner ── */
.decor-rays {
    position: absolute;
    top: -200px;
    right: -200px;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    opacity: 0.07;
    animation: raysRotate 60s linear infinite;
}

@keyframes raysRotate {
    to { transform: rotate(360deg); }
}

/* ── Concentric rings ── */
.decor-ring {
    position: absolute;
    border-radius: 50%;
    border-style: solid;
    opacity: 0.08;
}

.decor-ring.ring-1 {
    width: 400px; height: 400px;
    top: -160px; right: -100px;
    border-width: 2px;
    animation: ringPulse 8s ease-in-out infinite;
}

.decor-ring.ring-2 {
    width: 300px; height: 300px;
    top: -110px; right: -50px;
    border-width: 1.5px;
    animation: ringPulse 8s ease-in-out infinite;
    animation-delay: -2.5s;
}

.decor-ring.ring-3 {
    width: 200px; height: 200px;
    top: -60px; right: 0px;
    border-width: 1px;
    animation: ringPulse 8s ease-in-out infinite;
    animation-delay: -5s;
}

@keyframes ringPulse {
    0%, 100% { opacity: 0.06; transform: scale(1); }
    50% { opacity: 0.14; transform: scale(1.06); }
}

/* ── Wave silhouette at bottom ── */
.decor-wave {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 160px;
    opacity: 0.06;
    clip-path: polygon(
        0% 65%, 4% 58%, 8% 52%, 13% 48%, 18% 46%,
        24% 48%, 30% 54%, 36% 60%, 40% 58%,
        45% 50%, 50% 42%, 55% 38%, 60% 40%,
        65% 46%, 70% 55%, 75% 60%, 80% 56%,
        85% 48%, 90% 42%, 95% 44%, 100% 50%,
        100% 100%, 0% 100%
    );
}

/* ── Diagonal stripe band across bottom-left ── */
.decor-stripes {
    position: absolute;
    bottom: -20px; left: -20px;
    width: 350px; height: 350px;
    opacity: 0.04;
    transform: rotate(-25deg);
}

/* ── Scattered dot pattern ── */
.decor-dots {
    position: absolute;
    inset: 0;
    opacity: 0.4;
    background-image:
        radial-gradient(circle, currentColor 1.2px, transparent 1.2px);
    background-size: 32px 32px;
    background-position: 8px 8px;
    mask-image: linear-gradient(160deg, transparent 10%, rgba(0,0,0,0.3) 40%, transparent 70%);
    -webkit-mask-image: linear-gradient(160deg, transparent 10%, rgba(0,0,0,0.3) 40%, transparent 70%);
}


/* ═══════════════════════════════════
   COLOR THEMES - 6 rotating palettes
   ═══════════════════════════════════ */

/* ─── Theme 1: Indigo / Violet ─── */
.service-modal[data-color-theme="1"] .decor-topbar {
    background: linear-gradient(90deg, #6366f1, #a855f7, #818cf8);
}
.service-modal[data-color-theme="1"] .decor-rays {
    background: conic-gradient(
        from 0deg, #6366f1 0deg, transparent 15deg, transparent 30deg,
        #a855f7 30deg, transparent 45deg, transparent 60deg,
        #818cf8 60deg, transparent 75deg, transparent 90deg,
        #6366f1 90deg, transparent 105deg, transparent 120deg,
        #a855f7 120deg, transparent 135deg, transparent 150deg,
        #818cf8 150deg, transparent 165deg, transparent 180deg,
        #6366f1 180deg, transparent 195deg, transparent 210deg,
        #a855f7 210deg, transparent 225deg, transparent 240deg,
        #818cf8 240deg, transparent 255deg, transparent 270deg,
        #6366f1 270deg, transparent 285deg, transparent 300deg,
        #a855f7 300deg, transparent 315deg, transparent 330deg,
        #818cf8 330deg, transparent 345deg, transparent 360deg
    );
}
.service-modal[data-color-theme="1"] .decor-ring { border-color: #818cf8; }
.service-modal[data-color-theme="1"] .decor-wave { background: linear-gradient(90deg, #6366f1, #a855f7); }
.service-modal[data-color-theme="1"] .decor-stripes {
    background: repeating-linear-gradient(45deg, #818cf8 0px, #818cf8 3px, transparent 3px, transparent 14px);
}
.service-modal[data-color-theme="1"] .decor-dots { color: #a5b4fc; }
.service-modal[data-color-theme="1"] .service-modal-content {
    background: linear-gradient(170deg, var(--card) 0%, var(--card) 50%, rgba(99, 102, 241, 0.07) 100%);
}

/* ─── Theme 2: Rose / Coral ─── */
.service-modal[data-color-theme="2"] .decor-topbar {
    background: linear-gradient(90deg, #ec4899, #fb7185, #f97316);
}
.service-modal[data-color-theme="2"] .decor-rays {
    background: conic-gradient(
        from 0deg, #ec4899 0deg, transparent 15deg, transparent 30deg,
        #fb7185 30deg, transparent 45deg, transparent 60deg,
        #f97316 60deg, transparent 75deg, transparent 90deg,
        #ec4899 90deg, transparent 105deg, transparent 120deg,
        #fb7185 120deg, transparent 135deg, transparent 150deg,
        #f97316 150deg, transparent 165deg, transparent 180deg,
        #ec4899 180deg, transparent 195deg, transparent 210deg,
        #fb7185 210deg, transparent 225deg, transparent 240deg,
        #f97316 240deg, transparent 255deg, transparent 270deg,
        #ec4899 270deg, transparent 285deg, transparent 300deg,
        #fb7185 300deg, transparent 315deg, transparent 330deg,
        #f97316 330deg, transparent 345deg, transparent 360deg
    );
}
.service-modal[data-color-theme="2"] .decor-ring { border-color: #fb7185; }
.service-modal[data-color-theme="2"] .decor-wave { background: linear-gradient(90deg, #ec4899, #f97316); }
.service-modal[data-color-theme="2"] .decor-stripes {
    background: repeating-linear-gradient(45deg, #fb7185 0px, #fb7185 3px, transparent 3px, transparent 14px);
}
.service-modal[data-color-theme="2"] .decor-dots { color: #fda4af; }
.service-modal[data-color-theme="2"] .service-modal-content {
    background: linear-gradient(170deg, var(--card) 0%, var(--card) 50%, rgba(251, 113, 133, 0.07) 100%);
}

/* ─── Theme 3: Cyan / Teal ─── */
.service-modal[data-color-theme="3"] .decor-topbar {
    background: linear-gradient(90deg, #06b6d4, #22d3ee, #38bdf8);
}
.service-modal[data-color-theme="3"] .decor-rays {
    background: conic-gradient(
        from 0deg, #06b6d4 0deg, transparent 15deg, transparent 30deg,
        #22d3ee 30deg, transparent 45deg, transparent 60deg,
        #38bdf8 60deg, transparent 75deg, transparent 90deg,
        #06b6d4 90deg, transparent 105deg, transparent 120deg,
        #22d3ee 120deg, transparent 135deg, transparent 150deg,
        #38bdf8 150deg, transparent 165deg, transparent 180deg,
        #06b6d4 180deg, transparent 195deg, transparent 210deg,
        #22d3ee 210deg, transparent 225deg, transparent 240deg,
        #38bdf8 240deg, transparent 255deg, transparent 270deg,
        #06b6d4 270deg, transparent 285deg, transparent 300deg,
        #22d3ee 300deg, transparent 315deg, transparent 330deg,
        #38bdf8 330deg, transparent 345deg, transparent 360deg
    );
}
.service-modal[data-color-theme="3"] .decor-ring { border-color: #22d3ee; }
.service-modal[data-color-theme="3"] .decor-wave { background: linear-gradient(90deg, #06b6d4, #38bdf8); }
.service-modal[data-color-theme="3"] .decor-stripes {
    background: repeating-linear-gradient(45deg, #22d3ee 0px, #22d3ee 3px, transparent 3px, transparent 14px);
}
.service-modal[data-color-theme="3"] .decor-dots { color: #67e8f9; }
.service-modal[data-color-theme="3"] .service-modal-content {
    background: linear-gradient(170deg, var(--card) 0%, var(--card) 50%, rgba(34, 211, 238, 0.07) 100%);
}

/* ─── Theme 4: Emerald / Lime ─── */
.service-modal[data-color-theme="4"] .decor-topbar {
    background: linear-gradient(90deg, #10b981, #34d399, #4ade80);
}
.service-modal[data-color-theme="4"] .decor-rays {
    background: conic-gradient(
        from 0deg, #10b981 0deg, transparent 15deg, transparent 30deg,
        #34d399 30deg, transparent 45deg, transparent 60deg,
        #4ade80 60deg, transparent 75deg, transparent 90deg,
        #10b981 90deg, transparent 105deg, transparent 120deg,
        #34d399 120deg, transparent 135deg, transparent 150deg,
        #4ade80 150deg, transparent 165deg, transparent 180deg,
        #10b981 180deg, transparent 195deg, transparent 210deg,
        #34d399 210deg, transparent 225deg, transparent 240deg,
        #4ade80 240deg, transparent 255deg, transparent 270deg,
        #10b981 270deg, transparent 285deg, transparent 300deg,
        #34d399 300deg, transparent 315deg, transparent 330deg,
        #4ade80 330deg, transparent 345deg, transparent 360deg
    );
}
.service-modal[data-color-theme="4"] .decor-ring { border-color: #34d399; }
.service-modal[data-color-theme="4"] .decor-wave { background: linear-gradient(90deg, #10b981, #4ade80); }
.service-modal[data-color-theme="4"] .decor-stripes {
    background: repeating-linear-gradient(45deg, #34d399 0px, #34d399 3px, transparent 3px, transparent 14px);
}
.service-modal[data-color-theme="4"] .decor-dots { color: #6ee7b7; }
.service-modal[data-color-theme="4"] .service-modal-content {
    background: linear-gradient(170deg, var(--card) 0%, var(--card) 50%, rgba(52, 211, 153, 0.07) 100%);
}

/* ─── Theme 5: Amber / Gold ─── */
.service-modal[data-color-theme="5"] .decor-topbar {
    background: linear-gradient(90deg, #f59e0b, #fbbf24, #fcd34d);
}
.service-modal[data-color-theme="5"] .decor-rays {
    background: conic-gradient(
        from 0deg, #f59e0b 0deg, transparent 15deg, transparent 30deg,
        #fbbf24 30deg, transparent 45deg, transparent 60deg,
        #fcd34d 60deg, transparent 75deg, transparent 90deg,
        #f59e0b 90deg, transparent 105deg, transparent 120deg,
        #fbbf24 120deg, transparent 135deg, transparent 150deg,
        #fcd34d 150deg, transparent 165deg, transparent 180deg,
        #f59e0b 180deg, transparent 195deg, transparent 210deg,
        #fbbf24 210deg, transparent 225deg, transparent 240deg,
        #fcd34d 240deg, transparent 255deg, transparent 270deg,
        #f59e0b 270deg, transparent 285deg, transparent 300deg,
        #fbbf24 300deg, transparent 315deg, transparent 330deg,
        #fcd34d 330deg, transparent 345deg, transparent 360deg
    );
}
.service-modal[data-color-theme="5"] .decor-ring { border-color: #fbbf24; }
.service-modal[data-color-theme="5"] .decor-wave { background: linear-gradient(90deg, #f59e0b, #fcd34d); }
.service-modal[data-color-theme="5"] .decor-stripes {
    background: repeating-linear-gradient(45deg, #fbbf24 0px, #fbbf24 3px, transparent 3px, transparent 14px);
}
.service-modal[data-color-theme="5"] .decor-dots { color: #fde68a; }
.service-modal[data-color-theme="5"] .service-modal-content {
    background: linear-gradient(170deg, var(--card) 0%, var(--card) 50%, rgba(251, 191, 36, 0.07) 100%);
}

/* ─── Theme 6: Scarlet / Orange ─── */
.service-modal[data-color-theme="6"] .decor-topbar {
    background: linear-gradient(90deg, #ef4444, #f87171, #fb923c);
}
.service-modal[data-color-theme="6"] .decor-rays {
    background: conic-gradient(
        from 0deg, #ef4444 0deg, transparent 15deg, transparent 30deg,
        #f87171 30deg, transparent 45deg, transparent 60deg,
        #fb923c 60deg, transparent 75deg, transparent 90deg,
        #ef4444 90deg, transparent 105deg, transparent 120deg,
        #f87171 120deg, transparent 135deg, transparent 150deg,
        #fb923c 150deg, transparent 165deg, transparent 180deg,
        #ef4444 180deg, transparent 195deg, transparent 210deg,
        #f87171 210deg, transparent 225deg, transparent 240deg,
        #fb923c 240deg, transparent 255deg, transparent 270deg,
        #ef4444 270deg, transparent 285deg, transparent 300deg,
        #f87171 300deg, transparent 315deg, transparent 330deg,
        #fb923c 330deg, transparent 345deg, transparent 360deg
    );
}
.service-modal[data-color-theme="6"] .decor-ring { border-color: #f87171; }
.service-modal[data-color-theme="6"] .decor-wave { background: linear-gradient(90deg, #ef4444, #fb923c); }
.service-modal[data-color-theme="6"] .decor-stripes {
    background: repeating-linear-gradient(45deg, #f87171 0px, #f87171 3px, transparent 3px, transparent 14px);
}
.service-modal[data-color-theme="6"] .decor-dots { color: #fca5a5; }
.service-modal[data-color-theme="6"] .service-modal-content {
    background: linear-gradient(170deg, var(--card) 0%, var(--card) 50%, rgba(248, 113, 113, 0.07) 100%);
}


/* ═══════════ Light mode design adjustments ═══════════ */
body[data-theme="light"] .decor-rays { opacity: 0.05; }
body[data-theme="light"] .decor-ring { opacity: 0.06; }
body[data-theme="light"] .decor-wave { opacity: 0.05; }
body[data-theme="light"] .decor-stripes { opacity: 0.03; }
body[data-theme="light"] .decor-dots { opacity: 0.25; }
body[data-theme="light"] .decor-topbar { opacity: 0.9; }

/* ── Realistic book-page flip - stays bright like real paper ── */
.service-modal {
    perspective: 1600px;
    perspective-origin: 50% 40%;
}

.service-modal-content.page-turn-next {
    animation: pageTurnNext 1.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
    transform-origin: left center;
    transform-style: preserve-3d;
    backface-visibility: hidden;
    will-change: transform;
}

.service-modal-content.page-turn-prev {
    animation: pageTurnPrev 1.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
    transform-origin: right center;
    transform-style: preserve-3d;
    backface-visibility: hidden;
    will-change: transform;
}

/*
  Real paper stays light - shadow only creeps in at the very edge of the curl.
  The page bends slightly (skewY) as it lifts, then flips at the spine (90°),
  new content swings open, and it lands with a soft overshoot bounce.
  Max brightness drop: ~15% at the narrowest point - like a page held at 90°
  catching a little less light, not disappearing into darkness.
*/
@keyframes pageTurnNext {
    0%   {
        transform: perspective(1600px) rotateY(0deg) scale(1);
        box-shadow: 0 24px 60px rgba(0,0,0,0.35);
    }
    6%   {
        transform: perspective(1600px) rotateY(-7deg) scale(0.998) skewY(0.4deg);
        box-shadow: -6px 26px 58px rgba(0,0,0,0.38);
    }
    30%  {
        transform: perspective(1600px) rotateY(-48deg) scale(0.978) skewY(1.2deg);
        box-shadow: -32px 20px 56px rgba(0,0,0,0.42);
        filter: brightness(0.93);
    }
    44%  {
        transform: perspective(1600px) rotateY(-90deg) scale(0.96);
        box-shadow: -70px 14px 70px rgba(0,0,0,0.45);
        filter: brightness(0.86);
    }
    45%  {
        transform: perspective(1600px) rotateY(90deg) scale(0.96);
        box-shadow:  70px 14px 70px rgba(0,0,0,0.45);
        filter: brightness(0.86);
    }
    62%  {
        transform: perspective(1600px) rotateY(38deg) scale(0.982) skewY(-1deg);
        box-shadow:  28px 20px 54px rgba(0,0,0,0.40);
        filter: brightness(0.94);
    }
    80%  {
        transform: perspective(1600px) rotateY(9deg) scale(0.997) skewY(-0.3deg);
        box-shadow:   8px 24px 52px rgba(0,0,0,0.36);
        filter: brightness(0.98);
    }
    88%  {
        transform: perspective(1600px) rotateY(-2.5deg) scale(1.001);
        box-shadow:  -2px 26px 56px rgba(0,0,0,0.34);
    }
    95%  {
        transform: perspective(1600px) rotateY(1deg) scale(1);
    }
    100% {
        transform: perspective(1600px) rotateY(0deg) scale(1);
        box-shadow: 0 24px 60px rgba(0,0,0,0.35);
        filter: brightness(1);
    }
}

@keyframes pageTurnPrev {
    0%   {
        transform: perspective(1600px) rotateY(0deg) scale(1);
        box-shadow: 0 24px 60px rgba(0,0,0,0.35);
    }
    6%   {
        transform: perspective(1600px) rotateY(7deg) scale(0.998) skewY(-0.4deg);
        box-shadow:  6px 26px 58px rgba(0,0,0,0.38);
    }
    30%  {
        transform: perspective(1600px) rotateY(48deg) scale(0.978) skewY(-1.2deg);
        box-shadow:  32px 20px 56px rgba(0,0,0,0.42);
        filter: brightness(0.93);
    }
    44%  {
        transform: perspective(1600px) rotateY(90deg) scale(0.96);
        box-shadow:  70px 14px 70px rgba(0,0,0,0.45);
        filter: brightness(0.86);
    }
    45%  {
        transform: perspective(1600px) rotateY(-90deg) scale(0.96);
        box-shadow: -70px 14px 70px rgba(0,0,0,0.45);
        filter: brightness(0.86);
    }
    62%  {
        transform: perspective(1600px) rotateY(-38deg) scale(0.982) skewY(1deg);
        box-shadow: -28px 20px 54px rgba(0,0,0,0.40);
        filter: brightness(0.94);
    }
    80%  {
        transform: perspective(1600px) rotateY(-9deg) scale(0.997) skewY(0.3deg);
        box-shadow:  -8px 24px 52px rgba(0,0,0,0.36);
        filter: brightness(0.98);
    }
    88%  {
        transform: perspective(1600px) rotateY(2.5deg) scale(1.001);
        box-shadow:   2px 26px 56px rgba(0,0,0,0.34);
    }
    95%  {
        transform: perspective(1600px) rotateY(-1deg) scale(1);
    }
    100% {
        transform: perspective(1600px) rotateY(0deg) scale(1);
        box-shadow: 0 24px 60px rgba(0,0,0,0.35);
        filter: brightness(1);
    }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(40px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Modal Header (title + action buttons) ── */
.service-modal-header {
    padding: 22px max(32px, calc((100% - 840px) / 2));
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.05) 0%, transparent 100%);
    position: relative;
    z-index: 1;
}

body[data-theme="light"] .service-modal-header {
    border-bottom-color: rgba(15, 23, 42, 0.08);
}

.service-modal-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    flex: 1;
    line-height: 1.25;
    letter-spacing: -0.02em;
}

.service-modal-header .action-share,
.service-modal-header .action-print {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.service-modal-header .action-share:hover,
.service-modal-header .action-print:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

body[data-theme="light"] .service-modal-header .action-share,
body[data-theme="light"] .service-modal-header .action-print {
    background: rgba(15, 23, 42, 0.08);
}

body[data-theme="light"] .service-modal-header .action-share:hover,
body[data-theme="light"] .service-modal-header .action-print:hover {
    background: rgba(15, 23, 42, 0.15);
}

.service-modal-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: var(--text);
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.service-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1) rotate(90deg);
}

.service-modal-close:active {
    transform: scale(0.95);
}

body[data-theme="light"] .service-modal-close {
    background: rgba(15, 23, 42, 0.08);
}

body[data-theme="light"] .service-modal-close:hover {
    background: rgba(15, 23, 42, 0.15);
}

/* Modal description blocks - outlined div per paragraph */
.modal-desc-block {
    display: block;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-left: 3px solid var(--accent);
    border-radius: 0 10px 10px 0;
    background: rgba(255, 255, 255, 0.04);
    padding: 12px 16px;
    margin: 8px 0;
    font-size: 15px;
    line-height: 1.7;
    color: var(--text);
    transition: background 0.2s ease;
}

.modal-desc-block:hover {
    background: rgba(255, 255, 255, 0.07);
}

body[data-theme="light"] .modal-desc-block {
    border-color: rgba(15, 23, 42, 0.12);
    border-left-color: var(--accent);
    background: rgba(15, 23, 42, 0.03);
}

body[data-theme="light"] .modal-desc-block:hover {
    background: rgba(15, 23, 42, 0.06);
}

.modal-description {
    margin-bottom: 24px;
}

/* ── Section eyebrow label ── */
.modal-section-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-section-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.12);
}

body[data-theme="light"] .modal-section-label::after {
    background: rgba(15, 23, 42, 0.1);
}

/* ── Section wrapper ── */
.modal-section {
    margin-bottom: 24px;
}

/* Service image inside modal - small, scrolls with content */
.modal-service-image {
    width: 100%;
    max-height: 160px;
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.04);
    flex-shrink: 0;
}

body[data-theme="light"] .modal-service-image {
    background: rgba(15, 23, 42, 0.04);
}

.modal-service-image img {
    width: 100%;
    height: 160px;
    object-fit: contain;
    object-position: center;
    display: block;
}

/* ── Inline images gallery in modal ── */
.modal-inline-images {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin: 0 0 20px 0;
}

.modal-inline-img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
    object-fit: contain;
    background: rgba(255, 255, 255, 0.03);
}

body[data-theme="light"] .modal-inline-img {
    background: rgba(15, 23, 42, 0.03);
}

.service-modal-body {
    padding: 36px max(32px, calc((100% - 840px) / 2));
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    min-height: 0;
    max-width: 100%;
    width: 100%;
    color: var(--text);
    position: relative;
    z-index: 1;
    overflow-wrap: break-word;
    word-break: break-word;
}

.modal-scroll-indicator {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(35, 201, 255, 0.15);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(35, 201, 255, 0.3);
    color: var(--accent);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    z-index: 10;
    animation: subtleBounce 2s ease-in-out infinite;
    box-shadow: 0 4px 12px rgba(35, 201, 255, 0.2);
}

.modal-scroll-indicator:hover {
    background: rgba(35, 201, 255, 0.25);
    transform: scale(1.1);
    animation: none;
}

.modal-scroll-indicator:active {
    transform: scale(0.95);
}

body[data-theme="light"] .modal-scroll-indicator {
    background: rgba(37, 99, 235, 0.12);
    border-color: rgba(37, 99, 235, 0.25);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

body[data-theme="light"] .modal-scroll-indicator:hover {
    background: rgba(37, 99, 235, 0.2);
}

@keyframes subtleBounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-8px);
    }
}

/* .requirements-header removed - now uses .modal-section + .modal-section-label */

.requirements-content {
    padding: 20px 24px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    line-height: 1.7;
    color: var(--text);
    overflow-wrap: break-word;
    word-break: break-word;
}

.requirements-content ul,
.requirements-content ol {
    margin: 12px 0;
    padding-left: 24px;
}

.requirements-content li {
    margin: 8px 0;
}

.requirements-content p {
    margin: 12px 0;
}

.requirements-content strong,
.requirements-content b {
    color: var(--accent);
}

/* Light mode: force all modal text to dark */
body[data-theme="light"] .service-modal-content {
    color: #0f172a !important;
}

body[data-theme="light"] .service-modal-content h2,
body[data-theme="light"] .service-modal-content h3,
body[data-theme="light"] .service-modal-content p,
body[data-theme="light"] .service-modal-content li,
body[data-theme="light"] .service-modal-content span,
body[data-theme="light"] .service-modal-content div:not(.price-section):not(.additional-fees-section) {
    color: #0f172a !important;
}

body[data-theme="light"] .requirements-content {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #0f172a !important;
}

body[data-theme="light"] .requirements-content * {
    color: #0f172a !important;
}

body[data-theme="light"] .requirements-content strong,
body[data-theme="light"] .requirements-content b {
    color: #1d4ed8 !important;
}

/* Preserve accent colors for price/fee elements in light mode */
body[data-theme="light"] .price-section .price-value {
    background: rgba(37, 99, 235, 0.1) !important;
    color: #1d4ed8 !important;
    box-shadow: none !important;
}

body[data-theme="light"] .price-section .price-label,
body[data-theme="light"] .price-section .price-note {
    color: var(--muted) !important;
}

body[data-theme="light"] .additional-fees-section .fees-label {
    color: #d97706 !important;
}

body[data-theme="light"] .fee-item span:last-child,
body[data-theme="light"] .total-fee-value {
    color: #d97706 !important;
}

.price-section {
    margin-top: 24px;
    border-radius: 18px;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(35, 201, 255, 0.1), rgba(99, 102, 241, 0.08));
    border: 1px solid rgba(35, 201, 255, 0.22);
}

body[data-theme="light"] .price-section {
    background: linear-gradient(135deg, rgba(35, 201, 255, 0.08), rgba(99, 102, 241, 0.05));
    border-color: rgba(35, 201, 255, 0.2);
}

.price-section-inner {
    padding: 20px 24px;
}

.price-main-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.price-main-row .price-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
}

.price-main-row .price-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--accent);
    line-height: 1;
}

.price-main-row .price-value small {
    font-size: 13px;
    font-weight: 500;
    opacity: 0.7;
    margin-left: 4px;
}

.price-section .price-note {
    font-size: 12px;
    color: var(--muted);
    margin-top: 6px;
}

.price-tiers-list {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

body[data-theme="light"] .price-tiers-list {
    border-top-color: rgba(0, 0, 0, 0.08);
}

.price-tier-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    margin-bottom: 8px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    transition: background 0.2s;
}

.price-tier-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

body[data-theme="light"] .price-tier-item {
    background: rgba(0, 0, 0, 0.02);
}

body[data-theme="light"] .price-tier-item:hover {
    background: rgba(0, 0, 0, 0.04);
}

.price-tier-item .tier-name {
    font-size: 14px;
    font-weight: 500;
}

.price-tier-item .tier-price {
    font-size: 16px;
    font-weight: 600;
    color: var(--accent);
}

.price-tiers-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.price-tier-header {
    display: flex;
    gap: 8px;
    padding: 8px 12px;
    margin-bottom: 4px;
    font-size: 13px;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: rgba(var(--accent-rgb), 0.08);
    border-radius: 6px;
}

.price-tier-header span:nth-child(1),
.price-tier-header span:nth-child(2) {
    flex: 1;
    min-width: 0;
}

.price-tier-header span:nth-child(3) {
    max-width: 120px;
    width: 120px;
}

.price-tier-header span:nth-child(4) {
    width: 48px;
    flex-shrink: 0;
}

.price-tier-row {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

body[data-theme="light"] .price-tier-row {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.05);
}

.price-tier-row input {
    flex: 1;
    min-width: 0;
}

.price-tier-row button {
    flex-shrink: 0;
    padding: 8px 12px;
    font-size: 13px;
}

.additional-fees-section {
    margin-top: 20px;
    padding: 20px;
    border-radius: 12px;
    background: rgba(251, 191, 36, 0.08);
    border: 2px solid rgba(251, 191, 36, 0.3);
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.1);
}

body[data-theme="light"] .additional-fees-section {
    background: rgba(251, 191, 36, 0.05);
    border-color: rgba(251, 191, 36, 0.2);
}

.additional-fees-section .fees-label {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    color: #fbbf24;
    letter-spacing: 0.8px;
    margin-bottom: 14px;
}

.fees-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.fee-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    padding: 8px 12px;
    color: var(--text);
    background: rgba(251, 191, 36, 0.05);
    border: 1px solid rgba(251, 191, 36, 0.2);
    border-radius: 6px;
}

.fee-item span:last-child {
    color: #fbbf24;
    font-weight: 600;
}

.total-fee {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    margin-top: 12px;
    border-top: 2px solid rgba(251, 191, 36, 0.3);
    font-size: 16px;
}

.total-fee-value {
    color: #fbbf24;
    font-size: 22px;
    font-weight: 700;
}

.service-modal-footer {
    display: none;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: none;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.btn-icon:active {
    transform: translateY(0);
}

.btn-icon svg {
    flex-shrink: 0;
}

body[data-theme="light"] .btn-icon {
    background: rgba(15, 23, 42, 0.08);
}

body[data-theme="light"] .btn-icon:hover {
    background: rgba(15, 23, 42, 0.12);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
}

.modal-nav-btn {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    color: var(--text);
    font-size: 28px;
    font-weight: 300;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}

body[data-theme="light"] .modal-nav-btn {
    background: rgba(15, 23, 42, 0.08);
    border-color: rgba(15, 23, 42, 0.15);
}

body[data-theme="light"] .modal-nav-btn:hover {
    background: rgba(15, 23, 42, 0.12);
    border-color: rgba(35, 201, 255, 0.3);
}

.modal-nav-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 8px 24px rgba(35, 201, 255, 0.3);
}

.modal-nav-btn.animating {
    animation: navSlide 0.5s ease;
}

@keyframes navSlide {
    0% { transform: translateY(-50%) scale(1); }
    40% { transform: translateY(-50%) scale(0.9); }
    100% { transform: translateY(-50%) scale(1); }
}

.modal-nav-btn.prev {
    left: 20px;
}

.modal-nav-btn.next {
    right: 20px;
}

.modal-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

@media (max-width: 600px) {
    .service-modal.is-open {
        padding: 0;
        align-items: stretch;
    }
    
    .service-modal-content {
        max-width: 100%;
        width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .service-modal-content.initial-open {
        animation: expandToFullscreen 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    @keyframes expandToFullscreen {
        0% {
            width: 90%;
            height: 70vh;
            border-radius: 24px;
            opacity: 0.3;
            transform: scale(0.85) translateY(30px);
        }
        50% {
            opacity: 0.7;
            transform: scale(0.95) translateY(10px);
        }
        100% {
            width: 100%;
            height: 100vh;
            border-radius: 0;
            opacity: 1;
            transform: scale(1) translateY(0);
        }
    }
    
    .service-modal-header {
        padding: 24px 20px;
    }
    
    .service-modal-header h2 {
        font-size: 20px;
        line-height: 1.3;
    }
    
    .service-modal-body {
        padding: 24px 20px;
        font-size: 17px;
        line-height: 1.7;
    }
    
    .requirements-content {
        font-size: 17px;
        line-height: 1.8;
    }
    
    .requirements-content ul,
    .requirements-content ol {
        padding-left: 28px;
    }
    
    .requirements-content li {
        margin: 12px 0;
    }
    
    .service-modal-footer {
        padding: 20px;
        gap: 10px;
        flex-wrap: wrap;
    }
    
    .btn-icon {
        flex: 1 1 auto;
        min-width: 0;
        font-size: 15px;
        padding: 12px 14px;
    }
    
    .modal-nav-btn {
        width: 44px;
        height: 44px;
        font-size: 22px;
    }
    
    .modal-nav-btn.prev {
        left: 8px;
    }
    
    .modal-nav-btn.next {
        right: 8px;
    }
    
    .modal-scroll-indicator {
        bottom: 80px;
        right: 16px;
    }
    
    .requirements-header h3 {
        font-size: 18px;
    }
    
    .price-section {
        padding: 16px;
    }
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 32px;
    right: 32px;
    padding: 16px 24px;
    border-radius: 12px;
    background: rgba(17, 26, 46, 0.95);
    backdrop-filter: blur(12px);
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
    z-index: 10000;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    max-width: 420px;
    line-height: 1.5;
}

body[data-theme="light"] .toast {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.2);
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-success {
    border-left: 4px solid var(--success);
}

.toast-error {
    border-left: 4px solid #ef4444;
}

.toast-info {
    border-left: 4px solid var(--accent);
}

@media (max-width: 600px) {
    .toast {
        bottom: 16px;
        right: 16px;
        left: 16px;
    }
}

fieldset {
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 12px;
    display: grid;
    gap: 8px;
}

.inline-check {
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 16px;
    margin-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-actions--sticky {
    position: sticky;
    bottom: 0;
    background: var(--card);
    padding: 14px 24px;
    margin: 0 -28px -28px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0 0 var(--radius) var(--radius);
    z-index: 2;
    justify-content: stretch;
}

.modal-actions--sticky button {
    flex: 1;
    padding: 12px 16px;
    font-size: 14px;
}

.modal-actions--sticky button.primary {
    order: -1;
}

body[data-theme="light"] .modal-actions--sticky {
    background: #ffffff;
    border-top-color: #e2e8f0;
}

.modal-actions button {
    min-width: 120px;
    padding: 12px 24px;
}

.req-builder {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 20px;
    display: grid;
    gap: 14px;
}

body[data-theme="light"] .req-builder {
    background: rgba(15, 23, 42, 0.04);
}

.req-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.req-header > span {
    font-size: 15px;
    font-weight: 600;
}

.req-list {
    display: grid;
    gap: 12px;
}

.req-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 16px;
    display: grid;
    gap: 12px;
    transition: all 0.2s ease;
}

.req-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
}

.req-question {
    display: grid;
    gap: 6px;
}

.req-question select {
    background: #0f1830;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 8px 10px;
    color: var(--text);
}

body[data-theme="light"] .req-question select {
    background: #ffffff;
    border-color: rgba(15, 23, 42, 0.12);
    color: #0f172a;
}

.req-item-header {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.req-item-header input[type="text"] {
    min-width: 200px;
    flex: 1;
}

.req-children {
    display: grid;
    gap: 8px;
    margin-left: 16px;
}

@media (max-width: 900px) {
    .topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        padding: 16px 20px;
    }

    .top-actions {
        width: 100%;
        flex-wrap: wrap;
        gap: 10px;
    }

    .top-actions button {
        flex: 1;
        min-width: 140px;
    }

    .toolbar {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 12px;
    }

    .toolbar .ghost {
        padding: 8px 10px;
        font-size: 12px;
    }
    
    .toolbar .ghost span {
        display: none;
    }

    .search-box {
        flex: 1 1 100%;
        order: -1;
    }
    
    .sort-select {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .service-count {
        padding: 8px 12px;
        font-size: 12px;
    }

    .save-pill {
        display: none;
    }

    .services:not([data-view="icon"]) {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .front-actions {
        flex-direction: row;
        align-items: center;
    }

    .req-item-header {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: min(96vw, 680px);
        max-height: 90vh;
        padding: 20px 16px;
    }

    /* Tablet: override any inline max-width so modals don't bleed off screen */
    dialog.modal .modal-content {
        max-width: min(96vw, 680px) !important;
        width: min(96vw, 680px) !important;
    }

    .logo {
        height: 52px;
    }

    .field-grid {
        grid-template-columns: 1fr;
    }

    .header-actions {
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: 8px;
    }

    .admin-shell {
        grid-template-columns: 1fr;
    }

    /* Sidebar becomes a horizontal top strip on mobile */
    .admin-sidebar {
        display: flex;
        flex-direction: row;
        align-items: center;
        flex-wrap: wrap;
        padding: 12px 16px;
        gap: 10px;
        position: sticky;
        top: 0;
        z-index: 20;
        height: auto;
        backdrop-filter: blur(12px);
        background: rgba(14, 22, 43, 0.97) !important;
        border-bottom: 1px solid rgba(255,255,255,0.08);
    }

    body[data-theme="light"] .admin-sidebar {
        background: rgba(30, 41, 59, 0.97) !important;
    }

    .admin-sidebar .brand {
        flex: 0 0 auto;
        flex-direction: row;
        padding: 0;
        border-bottom: none;
        gap: 10px;
        align-items: center;
    }

    .admin-sidebar .brand .logo {
        height: 32px;
    }

    .admin-sidebar .brand-text {
        text-align: left;
    }

    .admin-sidebar .brand-text h2 {
        font-size: 10px;
    }

    .admin-sidebar .brand-text p {
        font-size: 13px;
    }

    .admin-sidebar nav {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 4px;
        flex: 1;
        padding: 0;
    }

    .admin-sidebar nav a {
        padding: 7px 11px;
        font-size: 13px;
        white-space: nowrap;
    }

    .sidebar-footer {
        padding: 0;
        border-top: none;
    }

    .admin-sidebar .sidebar-logout {
        padding: 7px 11px;
        font-size: 13px;
        width: auto;
    }

    .admin-content {
        padding: 20px 16px;
        overflow-x: hidden;
    }

    .service-card {
        animation: fadeIn 0.5s ease-out;
    }

    .section-header {
        flex-wrap: wrap;
        gap: 10px;
    }

    .section-header h2 {
        flex: 1 1 auto;
    }
}

@media (max-width: 600px) {
    body {
        font-size: 16px;
    }

    .topbar {
        padding: 16px 20px;
        position: static;
        gap: 12px;
    }

    .brand h1 {
        font-size: 18px;
    }

    .brand {
        flex: 1 1 100%;
    }

    .content {
        padding: 20px 16px 64px;
    }

    .intro-card {
        padding: 22px;
    }

    .services:not([data-view="icon"]) {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .services[data-view="icon"] {
        grid-template-columns: repeat(3, 1fr);
    }

    .service-card {
        height: auto;
        min-height: 360px;
        animation: fadeIn 0.5s ease-out;
    }

    .service-image {
        height: 200px;
    }

    .primary, .secondary, .ghost {
        padding: 14px 18px;
        font-size: 16px;
        border-radius: 14px;
    }

    .action-favorite,
    .icon-button {
        padding: 10px 12px;
        border-radius: 12px;
    }

    .requirements {
        max-height: none;
        min-height: 0;
    }

    .requirements li {
        align-items: flex-start;
        gap: 12px;
        padding: 14px;
    }

    .requirements .req-desc {
        margin-left: 0;
    }

    .requirements li {
        padding: 14px;
    }

    .card-actions {
        gap: 10px;
        flex-direction: column;
    }

    .card-actions button {
        width: 100%;
    }

    .search-box input {
        padding: 14px 16px;
        font-size: 16px;
    }

    .lang-toggle {
        padding: 12px 16px;
    }
}

/* ============================================
   ADMIN - TABLET / MOBILE SPECIFICS
   ============================================ */
@media (max-width: 768px) {
    .admin-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 14px 16px;
    }

    .admin-toggle {
        margin-left: 0;
    }

    .admin-header h1 {
        font-size: 20px;
    }

    .panel-section {
        padding: 16px 14px;
    }

    .service-grid {
        grid-template-columns: 1fr;
    }

    .tile-actions {
        flex-wrap: wrap;
    }
}

/* ── Admin: tablet portrait (601–768 px) ── */
@media (min-width: 601px) and (max-width: 768px) {
    .analytics-charts-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .analytics-chart-card {
        padding: 14px;
    }
    .chart-box {
        height: 160px;
    }
    .chart-box-sm {
        height: 130px;
    }
    dialog.modal {
        max-width: 100%;
        width: 100%;
        margin: 0;
        max-height: 100vh;
        max-height: 100dvh;
        overflow-y: auto;
    }
    dialog.modal .modal-content {
        width: 100% !important;
        max-width: 100% !important;
        max-height: none !important;
        overflow-y: visible !important;
        box-sizing: border-box !important;
    }
}

@media (max-width: 600px) {
    /* Full-width modals on small phones */
    dialog.modal {
        padding: 0;
        width: 100%;
        max-width: 100%;
        margin: 0;
        max-height: 100vh;
        max-height: 100dvh;
        overflow-y: auto;
    }

    dialog.modal .modal-content {
        width: 100% !important;
        max-width: 100% !important;
        max-height: none !important;
        border-radius: 12px !important;
        padding: 16px 14px 24px !important;
        overflow-y: visible !important;
        box-sizing: border-box !important;
    }

    .modal {
        border-radius: 0;
    }

    .modal-actions {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .field-grid {
        grid-template-columns: 1fr;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .header-actions {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
    }

    .header-actions .primary,
    .header-actions .secondary,
    .header-actions .ghost {
        flex: 1 1 auto;
        text-align: center;
    }

    /* Analytics — force single column on narrow screens */
    .analytics-charts-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .analytics-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    /* Analytics chart cards must not overflow their column */
    .analytics-chart-card {
        min-width: 0;
        overflow: hidden;
        padding: 12px;
    }

    .analytics-chart-card h3 {
        font-size: 11px;
        margin-bottom: 8px;
    }

    /* Chart boxes shrink further on small phones */
    .chart-box {
        height: 120px !important;
    }

    .chart-box-sm {
        height: 100px !important;
    }

    /* Tables — always horizontally scrollable */
    .analytics-table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* IP log modal table min-width so columns don't collapse */
    #ipLogTable {
        min-width: 480px;
    }
}

/* ============================================
   QUESTION FLOW TOGGLE - PROMINENT ADMIN OPTION
   ============================================ */

.question-flow-option {
    margin: 16px 0;
    padding: 4px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(139, 92, 246, 0.2));
    border-radius: 16px;
    animation: pulseGlow 3s ease-in-out infinite;
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
    }
    50% {
        box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
    }
}

.question-flow-toggle {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: var(--card);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.question-flow-toggle:hover {
    background: var(--card-light);
}

.question-flow-toggle input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.question-flow-toggle .toggle-slider {
    width: 56px;
    height: 30px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    position: relative;
    flex-shrink: 0;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.15);
}

.question-flow-toggle .toggle-slider::after {
    content: "";
    position: absolute;
    width: 22px;
    height: 22px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.question-flow-toggle input:checked + .toggle-slider {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    border-color: transparent;
}

.question-flow-toggle input:checked + .toggle-slider::after {
    transform: translateX(26px);
}

.question-flow-toggle .toggle-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.question-flow-toggle .toggle-icon {
    font-size: 28px;
    line-height: 1;
}

.question-flow-toggle .toggle-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.question-flow-toggle .toggle-text strong {
    font-size: 16px;
    color: var(--text);
}

.question-flow-toggle .toggle-text small {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.4;
}

body[data-theme="light"] .question-flow-toggle .toggle-slider {
    background: rgba(15, 23, 42, 0.1);
    border-color: rgba(15, 23, 42, 0.15);
}

/* ============================================
/* ============================================
   STEP-BY-STEP QUESTION WIZARD
   ============================================ */

.question-wizard {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.question-wizard .wizard-progress {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(147, 51, 234, 0.1));
    border-radius: 16px;
    border: 1px solid rgba(59, 130, 246, 0.25);
}

.wizard-progress-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    overflow: hidden;
}

.wizard-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    border-radius: 4px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.wizard-progress .step-indicator {
    display: flex;
    gap: 6px;
}

.wizard-progress .step-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.wizard-progress .step-dot.active {
    background: #3b82f6;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

.wizard-progress .step-dot.complete {
    background: #10b981;
}

.wizard-progress .step-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    text-align: center;
}

.wizard-steps-container {
    min-height: 200px;
    position: relative;
}

.question-wizard .wizard-step {
    opacity: 0;
    transform: translateX(50px);
    max-height: 0;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.question-wizard .wizard-step.active {
    opacity: 1;
    transform: translateX(0);
    max-height: 1000px;
}

.question-wizard .wizard-step.exit-left {
    opacity: 0;
    transform: translateX(-50px);
}

.question-wizard .wizard-step.exit-right {
    opacity: 0;
    transform: translateX(50px);
}

.wizard-step-content {
    padding: 24px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.wizard-step-content h3 {
    margin: 0 0 16px 0;
    font-size: 18px;
    color: var(--text);
}

.wizard-step-content .question-text {
    font-size: 16px;
    color: var(--text);
    margin-bottom: 16px;
}

.wizard-step-content .question-select {
    width: 100%;
    padding: 14px 18px;
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.wizard-step-content .question-select:focus {
    border-color: #3b82f6;
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.wizard-step-content .sub-requirements {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.wizard-navigation {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.wizard-nav-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 24px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.wizard-nav-btn.prev {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text);
}

.wizard-nav-btn.prev:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.15);
}

.wizard-nav-btn.next {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    margin-left: auto;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.wizard-nav-btn.next.complete {
    background: linear-gradient(135deg, #10b981, #059669);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.wizard-nav-btn.next.complete:hover:not(:disabled) {
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.wizard-nav-btn.next:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.wizard-nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
}

.wizard-nav-btn svg {
    width: 18px;
    height: 18px;
}

/* Admin Page Turn Animations */
.admin-page-turn {
    animation: adminPageFlip 0.5s ease-out;
}

@keyframes adminPageFlip {
    0% { 
        opacity: 0;
        transform: perspective(1000px) rotateY(-90deg) scale(0.9);
    }
    50% {
        opacity: 0.5;
    }
    100% { 
        opacity: 1;
        transform: perspective(1000px) rotateY(0) scale(1);
    }
}

/* Admin Modal Animations */
dialog.admin-modal {
    animation: modalSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

dialog.admin-modal::backdrop {
    animation: backdropFade 0.3s ease-out;
}

@keyframes modalSlideIn {
    0% {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes backdropFade {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

/* Smooth content transitions */
.fade-slide-enter {
    opacity: 0;
    transform: translateY(10px);
}

.fade-slide-enter-active {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.3s ease-out;
}

body[data-theme="light"] .wizard-step-content {
    background: rgba(15, 23, 42, 0.03);
    border-color: rgba(15, 23, 42, 0.1);
}

body[data-theme="light"] .wizard-progress {
    background: rgba(59, 130, 246, 0.05);
}

body[data-theme="light"] .wizard-step-content .question-select {
    background: white;
    border-color: rgba(15, 23, 42, 0.15);
}

/* ============================================
   ENHANCED MOBILE & DESKTOP RESPONSIVENESS
   ============================================ */

/* Large Desktop (1400px+) */
@media (min-width: 1400px) {
    .services {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .content {
        padding: 40px 60px 100px;
    }
    
    .service-card {
        height: 600px;
    }
}

/* Tablet Landscape (900px - 1200px) */
@media (min-width: 900px) and (max-width: 1200px) {
    .services {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .service-card {
        height: 520px;
        padding: 20px;
    }
    
    .service-image {
        height: 160px;
    }
}

/* Tablet Portrait (600px - 900px) */
@media (min-width: 600px) and (max-width: 899px) {
    .topbar {
        padding: 16px 24px;
    }
    
    .content {
        padding: 24px 24px 60px;
    }
    
    .services {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    
    .service-card {
        height: auto;
        min-height: 420px;
        padding: 18px;
    }
    
    .service-image {
        height: 140px;
    }
    
    .service-modal-content {
        width: min(90vw, 700px);
    }
    
    .wizard-navigation {
        flex-wrap: wrap;
    }
    
    .wizard-nav-btn {
        flex: 1;
        min-width: 120px;
        justify-content: center;
    }
}

/* Mobile Large (480px - 600px) */
@media (min-width: 480px) and (max-width: 599px) {
    .topbar {
        padding: 14px 16px;
    }
    
    .brand h1 {
        font-size: 16px;
    }
    
    .subtitle {
        font-size: 12px;
    }
    
    .logo {
        height: 44px;
    }
    
    .content {
        padding: 16px 16px 48px;
        gap: 16px;
    }
    
    .intro-card {
        padding: 18px;
    }
    
    .intro-card h2 {
        font-size: 18px;
    }
    
    .services {
        grid-template-columns: 1fr;
        gap: 14px;
    }
    
    .service-card {
        height: auto;
        min-height: 380px;
        padding: 16px;
        grid-template-rows: auto auto 1fr auto;
    }
    
    .service-image {
        height: 160px;
    }
    
    .service-modal-content {
        width: 100vw;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .service-modal.is-open {
        padding: 0;
    }
}

/* Mobile Small (< 480px) */
@media (max-width: 479px) {
    .topbar {
        padding: 12px 12px;
        gap: 10px;
    }
    
    .brand {
        gap: 10px;
    }
    
    .brand h1 {
        font-size: 14px;
        line-height: 1.2;
    }
    
    .subtitle {
        display: none;
    }
    
    .logo {
        height: 40px;
        max-width: 100px;
    }
    
    .top-actions {
        gap: 8px;
    }
    
    .lang-toggle {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .secondary {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .content {
        padding: 12px 10px 40px;
        gap: 12px;
    }
    
    .intro-card {
        padding: 16px;
        border-radius: 16px;
    }
    
    .intro-card h2 {
        font-size: 16px;
        margin-bottom: 8px;
    }
    
    .intro-card p {
        font-size: 13px;
    }
    
    .toolbar {
        gap: 8px;
    }
    
    .search-box input {
        padding: 12px 14px;
        font-size: 15px;
    }
    
    .sort-select {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    .service-count {
        padding: 6px 10px;
        font-size: 11px;
    }
    
    #favoriteToggle {
        padding: 10px 12px;
        font-size: 12px;
    }
    
    .services {
        gap: 12px;
    }
    
    .service-card {
        height: auto;
        min-height: 340px;
        padding: 14px;
        border-radius: 16px;
        grid-template-rows: auto auto 1fr auto;
    }
    
    .card-header {
        gap: 8px;
    }
    
    .service-title {
        font-size: 16px;
    }
    
    .req-count-chip {
        font-size: 11px;
        padding: 4px 8px;
    }
    
    .service-image {
        height: 140px;
        border-radius: 12px;
    }
    
    .service-desc {
        font-size: 13px;
    }
    
    .price-value {
        font-size: 18px;
    }
    
    /* Modal is already fullscreen on desktop; keep mobile consistent */
    .service-modal.is-open {
        padding: 0;
    }
    
    .service-modal-content {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
    }
    
    .service-modal-header {
        padding: 16px;
        position: sticky;
        top: 0;
        background: var(--card);
        z-index: 5;
    }
    
    .service-modal-header h2 {
        font-size: 20px;
        font-weight: 700;
        letter-spacing: -0.02em;
    }
    
    .service-modal-body {
        padding: 16px;
        padding-bottom: 100px;
    }
    
    .service-modal-footer {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 12px 16px;
        background: var(--card);
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        z-index: 10;
    }
    
    .modal-nav-btn {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }
    
    /* Wizard mobile */
    .question-wizard .wizard-progress {
        padding: 12px 14px;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .wizard-progress .step-dot {
        width: 8px;
        height: 8px;
    }
    
    .wizard-progress .step-text {
        font-size: 12px;
        flex-basis: 100%;
        margin-left: 0;
        text-align: center;
        margin-top: 4px;
    }
    
    .wizard-step-content {
        padding: 16px;
    }
    
    .wizard-step-content h3 {
        font-size: 15px;
    }
    
    .wizard-step-content .question-text {
        font-size: 14px;
    }
    
    .wizard-step-content .question-select {
        padding: 12px 14px;
        font-size: 15px;
    }
    
    .wizard-navigation {
        flex-direction: column;
        gap: 8px;
    }
    
    .wizard-nav-btn {
        width: 100%;
        justify-content: center;
        padding: 14px 20px;
    }
    
    .wizard-nav-btn.next {
        margin-left: 0;
        order: -1;
    }
    
    /* Requirements list mobile */
    .requirements li {
        padding: 12px;
        gap: 10px;
    }
    
    .requirements li label {
        font-size: 14px;
    }
    
    .requirements input[type="checkbox"] {
        width: 20px;
        height: 20px;
        min-width: 20px;
    }
    
    /* Admin mobile improvements */
    .question-flow-option {
        margin: 12px 0;
    }
    
    .question-flow-toggle {
        padding: 14px 16px;
        gap: 12px;
    }
    
    .question-flow-toggle .toggle-icon {
        font-size: 22px;
    }
    
    .question-flow-toggle .toggle-text strong {
        font-size: 14px;
    }
    
    .question-flow-toggle .toggle-text small {
        font-size: 11px;
    }
    
    .question-flow-toggle .toggle-slider {
        width: 48px;
        height: 26px;
    }
    
    .question-flow-toggle .toggle-slider::after {
        width: 18px;
        height: 18px;
    }
    
    .question-flow-toggle input:checked + .toggle-slider::after {
        transform: translateX(22px);
    }
}

/* Touch-friendly tap targets */
@media (hover: none) and (pointer: coarse) {
    .service-card {
        transition: transform 0.15s ease;
    }
    
    .service-card:active {
        transform: scale(0.98);
    }
    
    .primary, .secondary, .ghost {
        min-height: 48px;
    }
    
    .requirements input[type="checkbox"] {
        min-width: 24px;
        min-height: 24px;
    }
    
    .question-select {
        min-height: 52px;
    }
    
    .wizard-nav-btn {
        min-height: 52px;
    }
    
    /* Remove hover effects on touch */
    .service-card:hover {
        transform: none;
    }
    
    .lang-toggle:hover {
        transform: none;
    }
}

/* Landscape orientation on mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .service-modal-content {
        max-height: 100vh;
    }
    
    .service-modal-body {
        max-height: calc(100vh - 120px);
        overflow-y: auto;
    }
    
    .wizard-navigation {
        flex-direction: row;
    }
    
    .wizard-nav-btn {
        flex: 1;
    }
    
    .wizard-nav-btn.next {
        margin-left: auto;
    }
}

/* High DPI / Retina displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .service-card::before {
        border-width: 0.5px;
    }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .service-card,
    .service-modal-content,
    .wizard-step,
    .question-flow-option {
        animation: none !important;
        transition: opacity 0.2s ease !important;
    }
    
    .service-modal-content.page-turn-next,
    .service-modal-content.page-turn-prev {
        animation: none !important;
    }
}

/* ── Search Overlay ── */
.search-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 900;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    align-items: flex-start;
    justify-content: center;
    padding-top: 10vh;
}

.search-modal-overlay.is-open {
    display: flex;
}

.search-modal-inner {
    width: min(560px, 96vw);
    max-height: 70vh;
    border-radius: 22px;
    background: linear-gradient(160deg, var(--card-light) 0%, var(--card) 100%);
    border: 1px solid rgba(255, 255, 255, 0.09);
    box-shadow: 0 32px 100px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255,255,255,0.04) inset;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: fadeSlideDown 0.18s ease;
}

body[data-theme="light"] .search-modal-inner {
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 24px 80px rgba(15, 23, 42, 0.18);
}

@keyframes fadeSlideDown {
    from { opacity: 0; transform: translateY(-16px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.search-modal-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(255, 255, 255, 0.03);
    flex-shrink: 0;
}

body[data-theme="light"] .search-modal-head {
    border-bottom-color: rgba(15, 23, 42, 0.08);
    background: transparent;
}

.search-icon {
    font-size: 18px;
    flex-shrink: 0;
    opacity: 0.6;
}

#searchModalInput {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-size: 17px;
    color: var(--text);
    padding: 4px 0;
}

#searchModalInput::placeholder { color: var(--muted); }

.search-modal-close {
    background: rgba(255, 255, 255, 0.08);
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    font-size: 20px;
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s;
    line-height: 1;
}

.search-modal-close:hover { background: rgba(255, 255, 255, 0.16); }
body[data-theme="light"] .search-modal-close { background: rgba(15, 23, 42, 0.07); }
body[data-theme="light"] .search-modal-close:hover { background: rgba(15, 23, 42, 0.14); }

.search-results {
    overflow-y: auto;
    flex: 1;
    padding: 8px 8px 12px;
}

.search-result-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    padding: 12px 14px;
    border-radius: 12px;
    cursor: pointer;
    color: var(--text);
    transition: background 0.15s;
    gap: 12px;
}

.search-result-item:hover {
    background: rgba(35, 201, 255, 0.1);
    transform: translateX(2px);
    transition: background 0.15s, transform 0.15s;
}

body[data-theme="light"] .search-result-item:hover {
    background: rgba(37, 99, 235, 0.07);
}

.search-result-name {
    font-size: 15px;
    font-weight: 500;
    flex: 1;
    text-align: left;
}

.search-result-price {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
    flex-shrink: 0;
}

.search-no-results {
    text-align: center;
    color: var(--muted);
    padding: 32px 16px;
    font-size: 15px;
}

/* ── Admin drag-to-reorder ── */
.drag-handle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 4px 0 8px;
    cursor: grab;
    color: var(--muted);
    opacity: 0.4;
    transition: opacity 0.15s;
    user-select: none;
    -webkit-user-select: none;
}

.drag-handle:hover {
    opacity: 1;
    color: var(--accent);
}

.drag-handle:active { cursor: grabbing; }

.service-tile { cursor: default; }
.service-tile.dragging {
    opacity: 0.4;
    cursor: grabbing;
}
.service-tile.drag-over {
    outline: 2px dashed var(--accent);
    outline-offset: 3px;
    background: rgba(35,201,255,0.07);
}

/* Search trigger button in topbar */
.search-trigger-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Print styles */
@media print {
    .topbar,
    .toolbar,
    .service-modal-footer,
    .wizard-navigation {
        display: none !important;
    }
    
    .service-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* ============================================================
   Icon / App-grid view - iPhone-style app grid
   ============================================================ */
.services[data-view="icon"] {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px 16px;
    padding: 40px 28px;
    align-items: start;
    border-radius: 28px;
    position: relative;
    overflow: hidden;
    /* Subtle iOS-inspired mesh background */
    background:
        radial-gradient(ellipse 65% 55% at 12% 18%, rgba(35,201,255,0.12) 0%, transparent 60%),
        radial-gradient(ellipse 60% 65% at 88% 78%, rgba(139,92,246,0.13) 0%, transparent 60%),
        radial-gradient(ellipse 50% 55% at 52% 92%, rgba(255,183,3,0.09) 0%, transparent 60%),
        radial-gradient(ellipse 45% 45% at 80% 12%, rgba(61,220,151,0.10) 0%, transparent 60%),
        radial-gradient(ellipse 35% 35% at 35% 45%, rgba(236,72,153,0.07) 0%, transparent 60%),
        #08090d;
    /* Slow shimmer via filter animation */
    animation: iconGridPulse 9s ease-in-out infinite;
}

@keyframes iconGridPulse {
    0%, 100% { filter: brightness(1) saturate(1); }
    45%      { filter: brightness(1.04) saturate(1.1); }
}

body[data-theme="light"] .services[data-view="icon"] {
    background:
        radial-gradient(ellipse 65% 55% at 12% 18%, rgba(37,99,235,0.08) 0%, transparent 60%),
        radial-gradient(ellipse 60% 65% at 88% 78%, rgba(139,92,246,0.07) 0%, transparent 60%),
        radial-gradient(ellipse 50% 55% at 52% 92%, rgba(245,158,11,0.07) 0%, transparent 60%),
        radial-gradient(ellipse 45% 45% at 80% 12%, rgba(5,150,105,0.07) 0%, transparent 60%),
        #eef1f8;
}

/* Floating animated blob - top right */
.services[data-view="icon"]::before {
    content: '';
    position: absolute;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(35,201,255,0.10) 0%, rgba(99,102,241,0.06) 45%, transparent 70%);
    top: -120px;
    right: -80px;
    pointer-events: none;
    z-index: 0;
    animation: floatBlob1 10s ease-in-out infinite;
}

/* Floating animated blob - bottom left */
.services[data-view="icon"]::after {
    content: '';
    position: absolute;
    width: 340px;
    height: 340px;
    border-radius: 60% 40% 70% 30% / 40% 55% 45% 60%;
    background: radial-gradient(circle, rgba(139,92,246,0.11) 0%, rgba(236,72,153,0.06) 50%, transparent 70%);
    bottom: -60px;
    left: -30px;
    pointer-events: none;
    z-index: 0;
    animation: floatBlob2 13s ease-in-out infinite;
}

@keyframes floatBlob1 {
    0%, 100% { transform: translate(0, 0) scale(1);       opacity: 0.9; }
    35%      { transform: translate(-28px, 36px) scale(1.1); opacity: 1; }
    70%      { transform: translate(20px, -22px) scale(0.93); opacity: 0.8; }
}

@keyframes floatBlob2 {
    0%, 100% { transform: translate(0, 0) scale(1) rotate(0deg);    opacity: 0.9; }
    40%      { transform: translate(30px, -26px) scale(1.12) rotate(18deg); opacity: 1; }
    80%      { transform: translate(-16px, 20px) scale(0.9) rotate(-10deg); opacity: 0.8; }
}

.services[data-view="icon"] > .service-icon-item {
    position: relative;
    z-index: 1;
}

.service-icon-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 9px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 12px 8px;
    border-radius: 22px;
    color: inherit;
    font-family: inherit;
    transition: transform 0.18s cubic-bezier(0.2, 0.8, 0.2, 1),
                background 0.18s ease;
    animation: cardEntrance 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
    -webkit-tap-highlight-color: transparent;
    scroll-margin-top: 90px;
}

.service-icon-item:hover,
.service-icon-item:focus-visible {
    background: rgba(128, 128, 128, 0.12);
    transform: scale(1.08);
    outline: none;
}

.service-icon-item:active {
    transform: scale(0.96);
}

.service-icon-img-wrap {
    width: 110px;
    height: 110px;
    border-radius: 26px;
    overflow: hidden;
    background: rgba(128, 128, 128, 0.1);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.30);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.service-icon-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
    padding: 6px;
    box-sizing: border-box;
}

.service-icon-name {
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    color: var(--text);
    max-width: 120px;
    line-height: 1.3;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* View toggle icon visibility */
#viewToggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.view-toggle .icon-card-view,
.view-toggle .icon-icon-view {
    display: flex;
    align-items: center;
    gap: 5px;
}

.view-toggle.is-icon-view .icon-card-view { display: none; }
.view-toggle:not(.is-icon-view) .icon-icon-view { display: none; }

/* Tablet: medium icon grid */
@media (max-width: 900px) {
    .services[data-view="icon"] {
        gap: 20px 12px;
        padding: 28px 20px;
    }
    .service-icon-img-wrap {
        width: 90px;
        height: 90px;
        border-radius: 22px;
    }
    .service-icon-name {
        font-size: 12px;
        max-width: 100px;
    }
}

/* Mobile: tighter icon grid */
@media (max-width: 480px) {
    .services[data-view="icon"] {
        gap: 16px 8px;
        padding: 20px 12px;
        border-radius: 20px;
    }
    .service-icon-img-wrap {
        width: 70px;
        height: 70px;
        border-radius: 17px;
    }
    .service-icon-name {
        font-size: 11px;
        max-width: 80px;
    }
}

/* ══════════════════════════════════════════
   SURVEY FEATURE STYLES
   ══════════════════════════════════════════ */

/* ── Service type badges on admin tiles ── */
.type-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
    letter-spacing: 0.03em;
}
.redirect-type-badge {
    background: rgba(99, 102, 241, 0.18);
    color: #818cf8;
    border: 1px solid rgba(99, 102, 241, 0.25);
}
.survey-type-badge {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.25);
}
.resp-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--accent);
    color: #000;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    margin-left: 4px;
    vertical-align: middle;
}

/* ── Service type radio selector ── */
.service-type-selector {
    padding: 12px 14px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}
body[data-theme="light"] .service-type-selector {
    background: rgba(15, 23, 42, 0.04);
    border-color: rgba(15, 23, 42, 0.1);
}
.type-radio-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.type-radio-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    font-size: 14px;
    line-height: 1.4;
}
.type-radio-option:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
}
.type-radio-option input[type="radio"] {
    accent-color: var(--accent);
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}
.type-radio-option:has(input:checked) {
    background: rgba(35, 201, 255, 0.08);
    border-color: rgba(35, 201, 255, 0.3);
}
body[data-theme="light"] .type-radio-option:has(input:checked) {
    background: rgba(0, 150, 190, 0.07);
    border-color: rgba(0, 150, 190, 0.25);
}

/* ── Survey builder (admin) ── */
.survey-builder-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.survey-question-row {
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.03);
    display: flex;
    flex-direction: column;
    gap: 10px;
}
body[data-theme="light"] .survey-question-row {
    border-color: rgba(15, 23, 42, 0.1);
    background: rgba(15, 23, 42, 0.03);
}
.sq-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.sq-num {
    font-size: 12px;
    font-weight: 600;
    opacity: 0.5;
    background: rgba(255, 255, 255, 0.07);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.sq-remove {
    font-size: 13px;
    padding: 4px 8px;
    opacity: 0.6;
    border-radius: 6px;
}
.sq-remove:hover {
    opacity: 1;
    background: rgba(220, 38, 38, 0.2);
    color: #f87171;
}
.sq-empty {
    padding: 12px 0;
    text-align: center;
}
.sq-options-wrap {
    padding-top: 2px;
}

/* ── Survey results in admin ── */
.srv-toolbar {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 4px;
    flex-wrap: wrap;
}
.srv-search {
    flex: 1;
    min-width: 140px;
    padding: 7px 11px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    font-size: 13px;
    font-family: inherit;
}
.srv-search:focus {
    outline: none;
    border-color: var(--accent);
}
body[data-theme="light"] .srv-search {
    border-color: rgba(15, 23, 42, 0.18);
    background: rgba(15, 23, 42, 0.04);
}
.srv-sort {
    padding: 7px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
}
body[data-theme="light"] .srv-sort {
    border-color: rgba(15, 23, 42, 0.18);
    background: rgba(15, 23, 42, 0.04);
}
.srv-export {
    font-size: 13px;
    padding: 7px 14px;
    white-space: nowrap;
    flex-shrink: 0;
}
.srv-count {
    font-size: 12px;
    margin-bottom: 8px;
}
.survey-results-content {
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 4px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 12px 0;
}
.survey-response-card {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    overflow: hidden;
    font-size: 14px;
}
body[data-theme="light"] .survey-response-card {
    border-color: rgba(15, 23, 42, 0.1);
}
.src-header {
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    font-size: 13px;
    font-weight: 500;
    color: var(--muted);
}
body[data-theme="light"] .src-header {
    background: rgba(15, 23, 42, 0.05);
}
.src-answers {
    margin: 0;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.src-answers dt {
    font-weight: 500;
    font-size: 13px;
    margin: 0;
    color: var(--text);
}
.src-answers dd {
    margin: 0 0 4px 0;
    font-size: 14px;
    color: var(--muted);
    padding-left: 8px;
    border-left: 2px solid rgba(35, 201, 255, 0.3);
}

/* ── Survey in icon view ── */
.service-icon-item.is-survey {
    position: relative;
}
.survey-icon-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    background: rgba(34, 197, 94, 0.9);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 6px;
    letter-spacing: 0.03em;
    pointer-events: none;
}

/* ── Survey modal badge ── */
.survey-modal-badge {
    display: inline-flex;
    align-items: center;
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.35);
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 100px;
    letter-spacing: 0.04em;
    margin-right: auto;
    flex-shrink: 0;
}

/* ── Survey form in modal ── */
.survey-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 4px 0 8px;
}
.survey-fields {
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.survey-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: box-shadow 0.2s;
}
.survey-field.has-error .survey-input,
.survey-field.has-error .survey-options {
    border-color: var(--danger, #ef4444) !important;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.15);
}
.survey-field-label {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    color: var(--text);
    display: flex;
    gap: 4px;
    align-items: baseline;
}
.req-star {
    color: var(--danger, #ef4444);
    font-size: 15px;
    line-height: 1;
}
.survey-input {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 13px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    resize: vertical;
}
.survey-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(35, 201, 255, 0.15);
}
body[data-theme="light"] .survey-input {
    border-color: rgba(15, 23, 42, 0.18);
    background: rgba(15, 23, 42, 0.03);
}
.survey-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px;
    border-radius: 10px;
    border: 1px solid transparent;
}
.survey-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.15s;
}
.survey-option:hover {
    background: rgba(255, 255, 255, 0.06);
}
body[data-theme="light"] .survey-option:hover {
    background: rgba(15, 23, 42, 0.05);
}
.survey-option input[type="radio"],
.survey-option input[type="checkbox"] {
    accent-color: var(--accent);
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* ── Star rating ── */
.survey-rating {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 0;
}
.rating-star {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.2);
    transition: color 0.15s, transform 0.1s;
    padding: 0;
    line-height: 1;
    touch-action: manipulation;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
body[data-theme="light"] .rating-star {
    color: rgba(15, 23, 42, 0.15);
}
.rating-star.active,
.rating-star.hover {
    color: #fbbf24 !important;
    transform: scale(1.1);
}

/* ── Survey submit button ── */
.survey-submit-btn {
    width: 100%;
    padding: 14px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 12px;
    margin-top: 8px;
    letter-spacing: 0.02em;
}
.survey-submit-btn:disabled {
    opacity: 0.6;
    cursor: wait;
}

/* ── Survey success state ── */
.survey-success {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 24px;
    gap: 16px;
}
.survey-success-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(34, 197, 94, 0.2);
    border: 2px solid rgba(34, 197, 94, 0.5);
    color: #4ade80;
    font-size: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}
.survey-success h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    margin: 0;
}
.survey-close-btn {
    margin-top: 8px;
}

/* ── Analytics dashboard ─────────────────────────────────────── */
.analytics-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.stat-card {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    padding: 18px 20px;
    text-align: center;
}

body[data-theme="light"] .stat-card {
    background: rgba(15,23,42,0.03);
    border-color: rgba(15,23,42,0.08);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
    line-height: 1;
    margin-bottom: 6px;
}

.stat-label {
    font-size: 12px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.analytics-charts-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.analytics-charts-row.analytics-full {
    grid-template-columns: 1fr;
}

.analytics-chart-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 14px;
    padding: 18px;
}

/* Chart.js containers — must have explicit height for maintainAspectRatio:false */
.chart-box {
    position: relative;
    height: 240px;
    width: 100%;
}

.chart-box-sm {
    height: 180px;
}

body[data-theme="light"] .analytics-chart-card {
    background: rgba(15,23,42,0.02);
    border-color: rgba(15,23,42,0.07);
}

.analytics-chart-card h3 {
    margin: 0 0 14px;
    font-size: 14px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.analytics-chart-narrow {
    max-width: 100%;
}

.analytics-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-height: 420px;
    overflow-y: auto;
}

.analytics-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.analytics-table th {
    text-align: left;
    padding: 8px 12px;
    font-weight: 600;
    font-size: 12px;
    color: var(--muted);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    white-space: nowrap;
    position: sticky;
    top: 0;
    background: var(--card);
    z-index: 1;
}

body[data-theme="light"] .analytics-table th {
    border-bottom-color: rgba(15,23,42,0.08);
    background: #fff;
}

.analytics-table td {
    padding: 7px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    color: var(--text);
    vertical-align: middle;
}

body[data-theme="light"] .analytics-table td {
    border-bottom-color: rgba(15,23,42,0.05);
}

.analytics-table tr:last-child td {
    border-bottom: none;
}

.analytics-table tr:hover td {
    background: rgba(255,255,255,0.03);
}

body[data-theme="light"] .analytics-table tr:hover td {
    background: rgba(15,23,42,0.03);
}

/* event type badges */
.event-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.03em;
    background: rgba(255,255,255,0.08);
    color: var(--text);
}

.event-page_view   { background: rgba(99,102,241,0.2);  color: #a5b4fc; }
.event-service_open{ background: rgba(34,211,238,0.2);  color: #67e8f9; }
.event-print       { background: rgba(245,158,11,0.2);  color: #fcd34d; }
.event-share       { background: rgba(16,185,129,0.2);  color: #6ee7b7; }
.event-lang_change { background: rgba(139,92,246,0.2);  color: #c4b5fd; }
.event-search      { background: rgba(236,72,153,0.2);  color: #f9a8d4; }

@media (max-width: 900px) {
    .analytics-charts-row {
        grid-template-columns: 1fr;
    }

    .chart-box {
        height: 200px;
    }

    .chart-box-sm {
        height: 160px;
    }
}

/* -- Site Footer ---------------------------------------------- */
.site-footer {
    background: var(--card);
    border-top: 1px solid rgba(255,255,255,0.07);
    margin-top: 64px;
    padding: 48px max(24px, calc((100vw - 1200px) / 2 + 48px)) 24px;
    color: var(--muted);
    font-size: 14px;
}

body[data-theme="light"] .site-footer {
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

.footer-inner {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 36px;
}

.footer-col h4 {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text);
    margin: 0 0 12px;
}

.footer-col p {
    margin: 0 0 6px;
    line-height: 1.5;
}

.footer-col a {
    color: var(--accent);
    text-decoration: none;
}

.footer-col a:hover {
    text-decoration: underline;
}

.footer-note {
    font-size: 12px;
    opacity: 0.7;
}

.footer-disclaimer {
    font-size: 12px;
    line-height: 1.6;
    opacity: 0.75;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.06);
    padding-top: 18px;
    font-size: 12px;
    opacity: 0.55;
    text-align: center;
}

body[data-theme="light"] .footer-bottom {
    border-top-color: #e2e8f0;
}

/* -- Floating Search FAB -------------------------------------- */
.fab-search {
    display: none;
    position: fixed;
    bottom: 28px;
    right: 20px;
    z-index: 400;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #6366f1);
    color: #fff;
    border: none;
    box-shadow: 0 8px 24px rgba(56,189,248,0.4);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.fab-search:hover {
    transform: scale(1.08);
    box-shadow: 0 12px 32px rgba(56,189,248,0.55);
}

@media (max-width: 640px) {
    .fab-search {
        display: flex;
    }
}

/* -- Site Footer ---------------------------------------------- */
.site-footer {
    background: var(--card);
    border-top: 1px solid rgba(255,255,255,0.07);
    margin-top: 64px;
    padding: 48px max(24px, calc((100vw - 1200px) / 2 + 48px)) 24px;
    color: var(--muted);
    font-size: 14px;
}

body[data-theme="light"] .site-footer {
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

.footer-inner {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 36px;
}

.footer-col h4 {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text);
    margin: 0 0 12px;
}

.footer-col p {
    margin: 0 0 6px;
    line-height: 1.5;
}

.footer-col a {
    color: var(--accent);
    text-decoration: none;
}

.footer-col a:hover {
    text-decoration: underline;
}

.footer-note {
    font-size: 12px;
    opacity: 0.7;
}

.footer-disclaimer {
    font-size: 12px;
    line-height: 1.6;
    opacity: 0.75;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.06);
    padding-top: 18px;
    font-size: 12px;
    opacity: 0.55;
    text-align: center;
}

body[data-theme="light"] .footer-bottom {
    border-top-color: #e2e8f0;
}

/* -- Floating Search FAB -------------------------------------- */
.fab-search {
    display: none;
    position: fixed;
    bottom: 28px;
    right: 20px;
    z-index: 400;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #6366f1);
    color: #fff;
    border: none;
    box-shadow: 0 8px 24px rgba(56,189,248,0.4);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.fab-search:hover {
    transform: scale(1.08);
    box-shadow: 0 12px 32px rgba(56,189,248,0.55);
}

@media (max-width: 640px) {
    .fab-search {
        display: flex;
    }
}

/* ── User card email ── */
.user-card-email {
    font-size: 12px;
    color: var(--muted);
    margin: 1px 0 2px;
}

/* ── Google OAuth setup section ── */
.oauth-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}
.oauth-authorized {
    background: rgba(34, 197, 94, 0.12);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.25);
}
.oauth-unauth {
    background: rgba(148, 163, 184, 0.1);
    color: var(--muted);
    border: 1px solid rgba(148, 163, 184, 0.15);
}
body[data-theme="light"] .oauth-authorized {
    background: rgba(34, 197, 94, 0.1);
    color: #16a34a;
    border-color: rgba(34, 197, 94, 0.25);
}
body[data-theme="light"] .oauth-unauth {
    background: rgba(71, 85, 105, 0.08);
    color: #64748b;
    border-color: rgba(71, 85, 105, 0.18);
}
.oauth-redirect-uri {
    display: block;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 12px;
    font-family: monospace;
    word-break: break-all;
    color: var(--accent);
    margin-bottom: 4px;
}
body[data-theme="light"] .oauth-redirect-uri {
    background: #f1f5f9;
    border-color: #e2e8f0;
    color: #0369a1;
}
.oauth-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 14px;
}
@media (max-width: 700px) {
    .oauth-fields { grid-template-columns: 1fr; }
}
.oauth-btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}
.ghost.danger {
    color: #f87171;
    border-color: rgba(248, 113, 113, 0.3);
}
.ghost.danger:hover {
    background: rgba(248, 113, 113, 0.08);
    border-color: rgba(248, 113, 113, 0.5);
}
body[data-theme="light"] .ghost.danger {
    color: #dc2626;
    border-color: rgba(220, 38, 38, 0.25);
}

/* ── Login page: muted link ── */
.muted-link {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--muted);
    font-size: 13px;
    padding: 4px 0;
    text-decoration: underline;
    text-underline-offset: 3px;
    display: block;
    text-align: center;
}
.muted-link:hover { color: var(--text); }

/* ── Alert: success ── */
.alert.success {
    background: rgba(34, 197, 94, 0.12);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.25);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 13px;
    margin-bottom: 12px;
}
body[data-theme="light"] .alert.success {
    background: rgba(34, 197, 94, 0.08);
    color: #16a34a;
    border-color: rgba(34, 197, 94, 0.2);
}

/* -- Login page: forgot password overlay -- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(3, 6, 12, 0.65);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}
body[data-theme='light'] .modal-overlay {
    background: rgba(15, 23, 42, 0.45);
}

/* -- Generic modal close button -- */
.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.1);
    color: var(--text);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
.modal-close:hover { background: rgba(255,255,255,0.18); }
body[data-theme='light'] .modal-close { background: rgba(15,23,42,0.07); }
body[data-theme='light'] .modal-close:hover { background: rgba(15,23,42,0.13); }
.modal-overlay .modal-content { position: relative; }

/* -- Generic modal close button -- */
.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.1);
    color: var(--text);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
.modal-close:hover { background: rgba(255,255,255,0.18); }
body[data-theme='light'] .modal-close { background: rgba(15,23,42,0.07); }
body[data-theme='light'] .modal-close:hover { background: rgba(15,23,42,0.13); }
.modal-overlay .modal-content { position: relative; }

/* -- Email setup: step-by-step instructions -- */
.oauth-setup-steps {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 22px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    overflow: hidden;
}
body[data-theme='light'] .oauth-setup-steps {
    border-color: rgba(15,23,42,0.1);
}
.oauth-step {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.oauth-step:last-child { border-bottom: none; }
body[data-theme='light'] .oauth-step { border-bottom-color: rgba(15,23,42,0.07); }
.oauth-step-num {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1px;
}
.oauth-step strong { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.oauth-step p { font-size: 12.5px; color: var(--muted); margin: 0; line-height: 1.5; }
.oauth-step a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.oauth-step .oauth-redirect-uri { margin-top: 8px; font-size: 11.5px; }
.oauth-creds-form { margin-top: 0; }

/* ── Alert Banner ─────────────────────────────────────────── */
.alert-banner-container { position: relative; z-index: 90; }
.alert-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    transition: opacity 0.3s;
}
.alert-banner--info { background: #1d4ed8; color: #fff; }
.alert-banner--warning { background: #92400e; color: #fff; }
.alert-banner--critical { background: #991b1b; color: #fff; }
body[data-theme="light"] .alert-banner--info { background: #dbeafe; color: #1d3a8e; }
body[data-theme="light"] .alert-banner--warning { background: #fef3c7; color: #78350f; }
body[data-theme="light"] .alert-banner--critical { background: #fee2e2; color: #7f1d1d; }
.alert-banner-close {
    background: none; border: none; cursor: pointer;
    font-size: 18px; line-height: 1; opacity: 0.7; color: inherit;
    flex-shrink: 0; padding: 0 4px;
    transition: opacity 0.15s;
}
.alert-banner-close:hover { opacity: 1; }

/* ── Admin Alert/Contact cards ───────────────────────────── */
.alerts-admin-list, .contacts-admin-list { display: flex; flex-direction: column; gap: 10px; }
.alert-admin-card {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
    padding: 14px 16px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.07);
    background: var(--surface2, rgba(255,255,255,0.04));
}
.contact-admin-card {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
    padding: 14px 16px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.07);
    background: var(--surface2, rgba(255,255,255,0.04));
}
.alert-admin-card--critical { border-left: 4px solid #ef4444; }
.alert-admin-card--warning { border-left: 4px solid #f59e0b; }
.alert-admin-card--info { border-left: 4px solid var(--accent); }
.alert-admin-info, .contact-admin-info { flex: 1; min-width: 0; }
.alert-admin-actions { display: flex; gap: 8px; flex-shrink: 0; flex-wrap: wrap; align-items: flex-start; }
.alert-severity-badge {
    display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: 0.04em;
    padding: 2px 8px; border-radius: 999px; text-transform: uppercase;
    background: rgba(255,255,255,0.12); color: var(--text);
}
.alert-severity-badge--critical { background: rgba(239,68,68,0.2); color: #ef4444; }
.alert-severity-badge--warning { background: rgba(245,158,11,0.2); color: #f59e0b; }
.alert-severity-badge--info { background: rgba(56,189,248,0.2); color: var(--accent); }

/* ── Service announcement (modal) ────────────────────────── */
.service-announcement {
    display: flex; align-items: flex-start; gap: 8px;
    background: rgba(245,158,11,0.12); border: 1px solid rgba(245,158,11,0.3);
    border-radius: 10px; padding: 12px 14px; margin-bottom: 14px;
    font-size: 14px; color: var(--text); line-height: 1.5;
}
body[data-theme="light"] .service-announcement {
    background: #fef3c7; border-color: #f59e0b; color: #78350f;
}
.announcement-label {
    font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
    color: #f59e0b; flex-shrink: 0; padding-top: 2px;
}

/* ── Appointment CTA ────────────────────────────────────── */
.appointment-cta { padding: 12px 20px 4px; text-align: center; }
.appointment-btn {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--accent); color: #fff; font-weight: 600; font-size: 14px;
    border-radius: 10px; padding: 12px 24px; text-decoration: none;
    transition: opacity 0.15s, transform 0.15s;
}
.appointment-btn:hover { opacity: 0.88; transform: translateY(-1px); }

/* ── Map embed ───────────────────────────────────────────── */
.map-embed-wrap { padding: 12px 20px; }
.map-embed-label { font-size: 12px; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.05em; color: var(--muted); margin-bottom: 8px; }
.map-embed-wrap iframe { display: block; width: 100%; height: 220px; border: 0;
    border-radius: 12px; }

/* ── WhatsApp share button (in modal header) ─────────────── */
.action-whatsapp {
    background: none; border: none; cursor: pointer;
    color: #22c55e; padding: 8px; border-radius: 8px; display: flex;
    align-items: center; transition: background 0.15s;
}
.action-whatsapp:hover { background: rgba(34,197,94,0.15); }

/* ── Accessibility toolbar ───────────────────────────────── */
.a11y-toolbar {
    position: fixed; bottom: 80px; right: 14px; z-index: 100;
    display: flex; flex-direction: column; gap: 6px;
}
.a11y-toolbar button {
    width: 36px; height: 36px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.15);
    background: var(--surface, #1e293b); color: var(--text); font-size: 13px;
    font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3); transition: background 0.15s, transform 0.1s;
}
.a11y-toolbar button:hover { background: var(--accent); color: #fff; transform: scale(1.1); }
body[data-theme="light"] .a11y-toolbar button {
    background: #fff; color: #1e293b; border-color: rgba(0,0,0,0.1);
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

/* ── Font size utility classes ───────────────────────────── */
html.fs-sm { font-size: 14px; }
html.fs-md { font-size: 16px; }
html.fs-lg { font-size: 18px; }
html.fs-xl { font-size: 20px; }

/* ── High contrast mode ──────────────────────────────────── */
body.high-contrast { filter: contrast(1.45) brightness(1.05); }
body.high-contrast .service-modal, body.high-contrast .service-card { border: 2px solid #fff; }
body[data-theme="light"].high-contrast { filter: contrast(1.55); }

/* ============================================================
   ADMIN MOBILE RESPONSIVENESS — comprehensive fixes
   ============================================================ */

/* ── Admin sidebar: scrollable nav strip on mobile (≤768px) ── */
@media (max-width: 768px) {
    /* Tighten brand area so nav gets more space */
    .admin-sidebar .brand-text h2 { display: none; }
    .admin-sidebar .brand-text p  { font-size: 12px; font-weight: 600; }

    /* Nav scrolls horizontally instead of wrapping to multiple rows */
    .admin-sidebar nav {
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        max-width: calc(100vw - 120px); /* leave room for brand + logout */
        padding-bottom: 2px;
    }
    .admin-sidebar nav::-webkit-scrollbar { display: none; }

    /* Bigger tap targets for nav links */
    .admin-sidebar nav a,
    .admin-sidebar .sidebar-logout {
        padding: 9px 13px;
        font-size: 13px;
        white-space: nowrap;
        border-radius: 8px;
        min-height: 38px;
        display: flex;
        align-items: center;
    }

    /* Sidebar footer (logout) pinned to right */
    .sidebar-footer {
        margin-left: auto;
        flex-shrink: 0;
    }

    /* Admin main content: no horizontal overflow */
    .admin-content {
        overflow-x: hidden;
        padding: 16px 12px 40px;
    }

    /* Section headers stack on mobile */
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .section-header h2 { font-size: 18px; }
    .header-actions {
        width: 100%;
        flex-wrap: wrap;
        gap: 8px;
    }
    .header-actions > * { flex: 1 1 auto; text-align: center; min-width: 80px; }

    /* Service grid: 1 column */
    .service-grid { grid-template-columns: 1fr; }

    /* Tile action buttons: wrap and fill */
    .tile-actions { flex-wrap: wrap; gap: 6px; }
    .tile-actions .secondary,
    .tile-actions .ghost,
    .tile-actions .primary {
        flex: 1 1 auto;
        text-align: center;
        min-width: 70px;
        padding: 7px 10px;
    }

    /* Admin modals: full-width on small screens */
    .modal-content {
        width: min(98vw, 900px);
        padding: 20px 14px;
        border-radius: 16px;
    }
    dialog.modal .modal-content {
        max-width: min(98vw, 900px) !important;
        width: min(98vw, 900px) !important;
    }

    /* All field grids: single column */
    .field-grid { grid-template-columns: 1fr; gap: 12px; }

    /* Modal actions: wrap buttons */
    .modal-actions {
        flex-wrap: wrap;
        gap: 8px;
    }
    .modal-actions > button { flex: 1 1 auto; min-width: 80px; text-align: center; }

    /* Analytics: single column charts */
    .analytics-charts-row { grid-template-columns: 1fr !important; }

    /* Tables: scrollable */
    .analytics-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .users-table-wrap,
    #ipLogTable,
    table { max-width: 100%; overflow-x: auto; display: block; }

    /* Panel sections: tighter padding */
    .panel-section { padding: 14px 12px; }

    /* User cards: stack on mobile */
    .user-card {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    /* Alert/contact admin cards: fill width */
    .alert-admin-card,
    .contact-admin-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .alert-admin-card .tile-actions,
    .contact-admin-card .tile-actions { width: 100%; }
}

/* ── Very small phones (≤480px) ── */
@media (max-width: 480px) {
    /* Admin header */
    .admin-header h1 { font-size: 17px; }
    .admin-header p { font-size: 13px; }
    .admin-toggle { width: auto; }

    /* Sidebar: even tighter */
    .admin-sidebar { padding: 10px 10px; gap: 6px; }
    .admin-sidebar .brand .logo { height: 28px; }
    .admin-sidebar nav { max-width: calc(100vw - 100px); }
    .admin-sidebar nav a,
    .admin-sidebar .sidebar-logout { padding: 7px 10px; font-size: 12px; }

    /* Modals: truly full screen on tiny phones */
    dialog.modal {
        margin: 0;
        max-width: 100vw;
        max-height: 100dvh;
        border-radius: 0;
    }
    .modal-content {
        width: 100vw !important;
        max-width: 100vw !important;
        border-radius: 0;
        max-height: 100dvh;
        padding: 16px 12px 24px;
    }
    dialog.modal .modal-content {
        width: 100vw !important;
        max-width: 100vw !important;
        border-radius: 0 !important;
    }

    /* Section headings */
    .section-header h2 { font-size: 16px; }
    .panel-section { padding: 12px 10px; }

    /* Tile action buttons stack */
    .tile-actions { flex-direction: column; gap: 6px; }
    .tile-actions .secondary,
    .tile-actions .ghost,
    .tile-actions .primary { width: 100%; text-align: center; }

    /* Settings form buttons */
    form.settings-form > .modal-actions,
    .modal-form > .modal-actions { flex-direction: column; }
}

/* ============================================================
   VISUAL REDESIGN v2 — Enhanced Index & Modal Styles (2026-04-23)
   ============================================================ */

/* 1. Light mode body: soft gradient mesh instead of flat #f0f4fc */
body[data-theme="light"] {
    background:
        radial-gradient(ellipse 70% 50% at 10% 5%, rgba(99,102,241,0.07) 0%, transparent 55%),
        radial-gradient(ellipse 55% 60% at 92% 90%, rgba(139,92,246,0.06) 0%, transparent 55%),
        radial-gradient(ellipse 50% 45% at 55% 5%, rgba(14,165,233,0.06) 0%, transparent 55%),
        #f0f4fc;
    background-attachment: fixed;
}

/* 2. Icon grid: 4 columns on desktop (> 900px) */
@media (min-width: 901px) {
    .services[data-view="icon"] {
        grid-template-columns: repeat(4, 1fr);
        gap: 24px 20px;
    }
    /* 3. Larger icons on desktop only — mobile responsive rules below take precedence */
    .service-icon-img-wrap {
        width: 116px;
        height: 116px;
        border-radius: 26px;
        box-shadow: 0 8px 28px rgba(0,0,0,0.32), 0 2px 8px rgba(0,0,0,0.15);
    }
    .service-icon-name {
        font-size: 14px;
        max-width: 130px;
    }
}

/* 5. Icon item hover: elevated lift */
.service-icon-item:hover,
.service-icon-item:focus-visible {
    background: rgba(128,128,128,0.14);
    transform: translateY(-6px) scale(1.05);
    box-shadow: 0 12px 32px rgba(0,0,0,0.18);
}

body[data-theme="light"] .service-icon-item:hover,
body[data-theme="light"] .service-icon-item:focus-visible {
    background: rgba(255,255,255,0.88);
    box-shadow: 0 10px 28px rgba(15,23,42,0.10);
}

.service-icon-item:hover .service-icon-img-wrap {
    box-shadow: 0 14px 40px rgba(0,0,0,0.36), 0 4px 14px rgba(56,189,248,0.22);
}

body[data-theme="light"] .service-icon-item:hover .service-icon-img-wrap {
    box-shadow: 0 14px 32px rgba(15,23,42,0.14), 0 4px 12px rgba(37,99,235,0.14);
}

/* 6. Modal hero — thin sticky title bar with per-theme accent color.
   The service photo has moved into the scrollable body (see .service-hero-photo). */
.modal-hero {
    position: relative;
    flex-shrink: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: linear-gradient(135deg, #1e3a8a 0%, #312e81 100%);
}

/* Per-theme header gradients */
.service-modal[data-color-theme="1"] .modal-hero { background: linear-gradient(135deg, #312e81 0%, #4c1d95 100%); }
.service-modal[data-color-theme="2"] .modal-hero { background: linear-gradient(135deg, #9f1239 0%, #be185d 100%); }
.service-modal[data-color-theme="3"] .modal-hero { background: linear-gradient(135deg, #0c4a6e 0%, #0e7490 100%); }
.service-modal[data-color-theme="4"] .modal-hero { background: linear-gradient(135deg, #064e3b 0%, #047857 100%); }
.service-modal[data-color-theme="5"] .modal-hero { background: linear-gradient(135deg, #92400e 0%, #b45309 100%); }
.service-modal[data-color-theme="6"] .modal-hero { background: linear-gradient(135deg, #7f1d1d 0%, #b91c1c 100%); }

/* Overlay not needed — solid bg is always readable */
.modal-hero-overlay {
    display: none;
}

/* Service photo: lives inside the scrollable modal body, scrolls with content.
   object-fit: contain ensures correct aspect ratio, never distorts or crops. */
.service-hero-photo {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 24px;
    background: rgba(255,255,255,0.04);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

body[data-theme="light"] .service-hero-photo {
    background: rgba(15,23,42,0.04);
}

.modal-hero-img {
    width: 100%;
    height: auto;
    max-height: 280px;
    object-fit: contain;
    object-position: center;
    display: block;
}

.modal-hero-bar {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px max(20px, calc((100% - 840px) / 2));
    background: rgba(0,0,0,0.18);
}

.modal-hero-title {
    flex: 1;
    margin: 0;
    font-size: 21px;
    font-weight: 800;
    color: #ffffff !important;
    text-shadow: 0 1px 6px rgba(0,0,0,0.4);
    letter-spacing: -0.02em;
    line-height: 1.25;
}

.modal-hero-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    padding-bottom: 2px;
}

/* Hero action buttons: always white-tinted glass */
.modal-hero-actions .action-share,
.modal-hero-actions .action-print,
.modal-hero-actions .action-whatsapp,
.modal-hero-actions .service-modal-close {
    background: rgba(255,255,255,0.18) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    border: 1px solid rgba(255,255,255,0.25) !important;
    color: #ffffff !important;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 22px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.modal-hero-actions .action-share:hover,
.modal-hero-actions .action-print:hover,
.modal-hero-actions .action-whatsapp:hover,
.modal-hero-actions .service-modal-close:hover {
    background: rgba(255,255,255,0.30) !important;
    transform: scale(1.08);
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
}

.modal-hero-actions .service-modal-close:hover {
    transform: scale(1.08) rotate(90deg);
}

/* Color accent stripe on top of the hero */
.modal-hero::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    z-index: 4;
    pointer-events: none;
    opacity: 0.7;
}

.service-modal[data-color-theme="1"] .modal-hero::after { background: linear-gradient(90deg, #6366f1, #a855f7, #818cf8); }
.service-modal[data-color-theme="2"] .modal-hero::after { background: linear-gradient(90deg, #ec4899, #fb7185, #f97316); }
.service-modal[data-color-theme="3"] .modal-hero::after { background: linear-gradient(90deg, #06b6d4, #22d3ee, #38bdf8); }
.service-modal[data-color-theme="4"] .modal-hero::after { background: linear-gradient(90deg, #10b981, #34d399, #4ade80); }
.service-modal[data-color-theme="5"] .modal-hero::after { background: linear-gradient(90deg, #f59e0b, #fbbf24, #fcd34d); }
.service-modal[data-color-theme="6"] .modal-hero::after { background: linear-gradient(90deg, #ef4444, #f87171, #fb923c); }

/* 7. Requirements: styled list items */
.requirements-content h2,
.requirements-content h3,
.requirements-content h4 {
    margin: 16px 0 8px;
    font-size: 15px;
    font-weight: 700;
    color: var(--accent);
}

.requirements-content > ul,
.requirements-content > ol {
    padding-left: 0;
    list-style: none;
    margin: 8px 0;
}

.requirements-content > ul > li,
.requirements-content > ol > li {
    position: relative;
    padding: 10px 12px 10px 34px;
    margin: 5px 0;
    border-radius: 10px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.07);
    line-height: 1.65;
    font-size: 14px;
    transition: background 0.15s;
}

.requirements-content > ul > li:hover,
.requirements-content > ol > li:hover {
    background: rgba(255,255,255,0.07);
}

body[data-theme="light"] .requirements-content > ul > li,
body[data-theme="light"] .requirements-content > ol > li {
    background: rgba(15,23,42,0.03);
    border-color: rgba(15,23,42,0.07);
}

body[data-theme="light"] .requirements-content > ul > li:hover,
body[data-theme="light"] .requirements-content > ol > li:hover {
    background: rgba(15,23,42,0.06);
}

.requirements-content > ul > li::before {
    content: "◈";
    position: absolute;
    left: 11px;
    top: 12px;
    color: var(--accent);
    font-size: 11px;
    line-height: 1;
}

.requirements-content > ol {
    counter-reset: req-counter;
}

.requirements-content > ol > li {
    counter-increment: req-counter;
}

.requirements-content > ol > li::before {
    content: counter(req-counter);
    position: absolute;
    left: 9px;
    top: 10px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    text-align: center;
    line-height: 18px;
}

/* 8. Price section: bigger price number */
.price-main-row .price-value {
    font-size: 32px;
    letter-spacing: -0.02em;
}

/* 9. Toolbar: show service count badge */
.toolbar .service-count {
    display: inline-flex !important;
}

/* 10. Responsive adjustments */
@media (max-width: 900px) {
    .modal-hero-title {
        font-size: 18px;
    }
    .modal-hero-img {
        max-height: 220px;
    }
}

@media (max-width: 600px) {
    .modal-hero-title {
        font-size: 16px;
    }
    .modal-hero-bar {
        padding: 8px 14px;
        gap: 6px;
    }
    .modal-hero-actions {
        gap: 5px;
    }
    .modal-hero-actions .action-share,
    .modal-hero-actions .action-print,
    .modal-hero-actions .action-whatsapp,
    .modal-hero-actions .service-modal-close {
        width: 34px !important;
        height: 34px !important;
        font-size: 16px !important;
    }
    .service-hero-photo {
        border-radius: 8px;
    }
    .modal-hero-img {
        max-height: 180px;
    }
}

/* ── Offline banner ──────────────────────────────────────── */
.offline-banner {
    display: none;
    align-items: center;
    gap: 8px;
    position: fixed;
    bottom: 76px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15,23,42,0.92);
    color: #f1f5f9;
    padding: 8px 18px;
    border-radius: 999px;
    font-size: 13px;
    z-index: 9000;
    backdrop-filter: blur(10px);
    white-space: nowrap;
    pointer-events: none;
}
body[data-theme="light"] .offline-banner {
    background: rgba(30,41,59,0.90);
}

/* ── Service tile: position relative (needed for checkbox) ── */
.service-tile { position: relative; }

/* ── Bulk select checkbox on service tiles ───────────────── */
.tile-select-wrap {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s;
    line-height: 1;
}
.service-tile:hover .tile-select-wrap {
    opacity: 1;
}
.tile-select-wrap:has(.tile-select-cb:checked) {
    opacity: 1;
}
.service-tile:has(.tile-select-cb:checked) {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
.tile-select-cb { cursor: pointer; width: 16px; height: 16px; }

/* ── Recently-viewed toolbar button active state ─────────── */
#recentToggle.is-active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}
body[data-theme="light"] #recentToggle.is-active {
    background: var(--accent);
    color: #fff;
}

/* ── Always show bulk-select checkboxes on touch devices ──── */
@media (hover: none) {
    .tile-select-wrap { opacity: 1; }
}
