:root {
    --bg: #f5f7fb;
    --bg-soft: #eef3f7;
    --surface: #ffffff;
    --surface-strong: #f9fbfd;
    --text: #172033;
    --muted: #667085;
    --line: #dce4ec;
    --line-soft: #edf1f5;
    --green: #168567;
    --amber: #b76e00;
    --red: #c2414b;
    --blue: #2358d5;
    --cyan: #0f8ea6;
    --ink: #151d2d;
    --ink-2: #202b3f;
    --shadow: 0 16px 42px rgba(18, 28, 45, .08);
    --shadow-soft: 0 8px 22px rgba(18, 28, 45, .06);
    --radius: 8px;
    --ease: cubic-bezier(.2, .7, .2, 1);
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0d1422;
    --bg-soft: #121d2e;
    --surface: #121b2b;
    --surface-strong: #172235;
    --text: #eef4ff;
    --muted: #9eacc2;
    --line: #2a3950;
    --line-soft: #202d42;
    --green: #55d2a6;
    --amber: #f2b650;
    --red: #ff7780;
    --blue: #7ea2ff;
    --cyan: #52d4ea;
    --ink: #0b1220;
    --ink-2: #101a2b;
    --shadow: 0 18px 46px rgba(0, 0, 0, .32);
    --shadow-soft: 0 10px 28px rgba(0, 0, 0, .24);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    position: relative;
    margin: 0;
    color: var(--text);
    background:
        linear-gradient(180deg, #ffffff 0, #f8fbff 180px, var(--bg) 420px),
        var(--bg);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    letter-spacing: 0;
}

:root[data-theme="dark"] body {
    background:
        linear-gradient(180deg, #0a101b 0, #111b2d 210px, var(--bg) 460px),
        var(--bg);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(circle at 82% 8%, rgba(35, 88, 213, .13), transparent 28%),
        radial-gradient(circle at 18% 26%, rgba(22, 133, 103, .10), transparent 27%),
        linear-gradient(115deg, rgba(255,255,255,.30), transparent 35%);
}

:root[data-theme="dark"] body::before {
    background:
        radial-gradient(circle at 82% 8%, rgba(126, 162, 255, .16), transparent 28%),
        radial-gradient(circle at 18% 24%, rgba(82, 212, 234, .10), transparent 26%),
        linear-gradient(115deg, rgba(255,255,255,.04), transparent 38%);
}

.material-symbols-rounded {
    direction: ltr;
    display: inline-block;
    font-family: "Material Symbols Rounded";
    font-size: 20px;
    font-style: normal;
    font-weight: normal;
    letter-spacing: normal;
    line-height: 1;
    text-transform: none;
    white-space: nowrap;
    word-wrap: normal;
    -webkit-font-feature-settings: "liga";
    -webkit-font-smoothing: antialiased;
    font-variation-settings: "FILL" 0, "wght" 600, "GRAD" 0, "opsz" 24;
}

a {
    color: var(--blue);
    text-decoration: none;
}

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

button,
a,
input,
select,
textarea {
    transition: border-color .18s var(--ease), box-shadow .18s var(--ease), background .18s var(--ease), color .18s var(--ease), transform .18s var(--ease);
}

.app-shell {
    display: grid;
    grid-template-columns: 276px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 18px 14px;
    overflow: hidden;
    background: linear-gradient(180deg, var(--ink), var(--ink-2));
    color: #fff;
}

.sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, .10);
}

.logo {
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 58px;
    padding: 8px;
    color: #fff;
}

.logo strong,
.logo small {
    display: block;
}

.logo strong {
    max-width: 184px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 15px;
}

.logo small {
    margin-top: 2px;
    color: rgba(255, 255, 255, .58);
    font-size: 12px;
}

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, #f5c84c, #58c6b8);
    color: #111827;
    font-weight: 900;
    box-shadow: 0 12px 24px rgba(0, 0, 0, .18);
}

.brand-mark .material-symbols-rounded {
    color: #0f172a;
    font-size: 24px;
    font-variation-settings: "FILL" 1, "wght" 700, "GRAD" 0, "opsz" 24;
}

.sidebar nav {
    display: grid;
    gap: 6px;
    min-height: 0;
    padding-right: 4px;
    overflow-y: auto;
}

.mobile-menu-toggle,
.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 38px;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .08);
    color: #fff;
    cursor: pointer;
    font-size: 13px;
    font-weight: 850;
}

.mobile-menu-toggle {
    display: none;
    padding: 8px 10px;
}

.mobile-menu-toggle:hover,
.theme-toggle:hover {
    background: rgba(255, 255, 255, .14);
    transform: translateY(-1px);
}

.mobile-menu-toggle .material-symbols-rounded,
.theme-toggle .material-symbols-rounded {
    font-size: 19px;
    font-variation-settings: "FILL" 1, "wght" 700, "GRAD" 0, "opsz" 24;
}

.sidebar nav::-webkit-scrollbar,
.table-wrap::-webkit-scrollbar,
.kanban::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.sidebar nav::-webkit-scrollbar-thumb,
.table-wrap::-webkit-scrollbar-thumb,
.kanban::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(126, 143, 166, .38);
}

.sidebar nav a,
.logout {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    color: rgba(255, 255, 255, .76);
    padding: 9px 10px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 650;
}

.nav-icon {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 8px;
    background: rgba(255, 255, 255, .06);
    color: rgba(255, 255, 255, .86);
    font-size: 17px;
    font-weight: 800;
}

.sidebar nav a.active,
.sidebar nav a:hover,
.logout:hover {
    color: #fff;
    background: rgba(255, 255, 255, .10);
    transform: translateX(2px);
}

.sidebar nav a.active::before {
    content: "";
    position: absolute;
    left: -8px;
    width: 3px;
    height: 24px;
    border-radius: 999px;
    background: #58c6b8;
}

.sidebar nav a.active .nav-icon {
    background: #ffffff;
    color: var(--ink);
    font-variation-settings: "FILL" 1, "wght" 700, "GRAD" 0, "opsz" 24;
}

.logout {
    margin-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, .10);
    border-radius: var(--radius);
    padding-top: 14px;
}

.main {
    min-width: 0;
    padding: 28px clamp(18px, 3vw, 34px) 42px;
}

.topbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 20px;
    padding: 2px 0 4px;
}

.topbar h1 {
    margin: 0;
    font-size: clamp(25px, 2.6vw, 36px);
    line-height: 1.08;
    color: var(--text);
}

.page-subtitle {
    max-width: 680px;
    margin: 9px 0 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.45;
}

.eyebrow {
    margin: 0 0 7px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.top-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 9px;
    padding-top: 4px;
}

.top-actions a,
.top-actions .theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 38px;
    padding: 9px 12px;
    border: 1px solid rgba(35, 88, 213, .16);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .82);
    color: var(--text);
    font-size: 13px;
    font-weight: 850;
    box-shadow: 0 8px 20px rgba(18, 28, 45, .05);
}

.top-actions a:hover,
.top-actions .theme-toggle:hover {
    border-color: rgba(35, 88, 213, .34);
    background: var(--surface);
    color: var(--blue);
    transform: translateY(-1px);
    box-shadow: var(--shadow-soft);
}

:root[data-theme="dark"] .top-actions a,
:root[data-theme="dark"] .top-actions .theme-toggle,
:root[data-theme="dark"] .login-theme-toggle,
:root[data-theme="dark"] .ghost-button {
    background: #182438 !important;
    border-color: #354760 !important;
    color: var(--text) !important;
}

.top-actions .material-symbols-rounded {
    color: var(--blue);
    font-size: 19px;
    font-variation-settings: "FILL" 1, "wght" 700, "GRAD" 0, "opsz" 24;
}

.dashboard-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    align-items: end;
    margin-bottom: 16px;
    padding: 22px;
    border: 1px solid rgba(35, 88, 213, .14);
    border-radius: var(--radius);
    background:
        linear-gradient(135deg, rgba(35, 88, 213, .10), transparent 55%),
        linear-gradient(100deg, rgba(15, 142, 166, .12), transparent 62%),
        #ffffff;
    box-shadow: var(--shadow);
    overflow: hidden;
    animation: rise-in .38s var(--ease) both;
}

:root[data-theme="dark"] .dashboard-hero,
:root[data-theme="dark"] .customer-hero {
    background:
        linear-gradient(135deg, rgba(126, 162, 255, .14), transparent 55%),
        linear-gradient(100deg, rgba(82, 212, 234, .10), transparent 62%),
        var(--surface);
}

.dashboard-hero > div {
    position: relative;
    z-index: 2;
}

.hero-visual {
    position: absolute;
    right: -22px;
    bottom: -38px;
    z-index: 1;
    width: min(58%, 760px);
    height: 118%;
    object-fit: cover;
    object-position: right center;
    opacity: .34;
    filter: saturate(1.05);
    pointer-events: none;
}

.dashboard-hero h2 {
    margin: 0;
    font-size: clamp(28px, 4.2vw, 48px);
    line-height: 1;
}

.dashboard-hero p:last-child {
    max-width: 620px;
    margin: 10px 0 0;
    color: var(--muted);
}

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

.hero-stats span {
    display: grid;
    gap: 3px;
    min-height: 68px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .76);
    color: var(--muted);
    font-size: 12px;
}

:root[data-theme="dark"] .hero-stats span,
:root[data-theme="dark"] .contact-card,
:root[data-theme="dark"] input,
:root[data-theme="dark"] select,
:root[data-theme="dark"] textarea,
:root[data-theme="dark"] table {
    background: linear-gradient(180deg, rgba(23, 34, 53, .98), rgba(18, 27, 43, .98));
}

:root[data-theme="dark"] input,
:root[data-theme="dark"] select,
:root[data-theme="dark"] textarea {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
}

:root[data-theme="dark"] input:focus,
:root[data-theme="dark"] select:focus,
:root[data-theme="dark"] textarea:focus {
    background: var(--surface-strong);
    box-shadow: 0 0 0 4px rgba(126, 162, 255, .16);
}

.hero-stats b {
    color: var(--text);
    font-size: 18px;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.metric-grid.compact {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 14px 0;
}

.metric-card,
.panel,
.install-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
}

.metric-card {
    position: relative;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px 10px;
    min-height: 112px;
    padding: 17px;
    overflow: hidden;
    color: inherit;
    animation: rise-in .36s var(--ease) both;
}

:root[data-theme="dark"] .metric-card {
    background-color: var(--surface) !important;
    background:
        linear-gradient(180deg, rgba(23, 34, 53, .98), rgba(18, 27, 43, .98)),
        var(--surface) !important;
    border-color: var(--line);
    color: var(--text) !important;
}

:root[data-theme="dark"] .metric-card strong {
    color: var(--text) !important;
}

.metric-card::before {
    content: "";
    position: absolute;
    left: 17px;
    top: 17px;
    width: 34px;
    height: 4px;
    border-radius: 999px;
    background: var(--blue);
}

.metric-card:nth-child(2)::before,
.metric-card:nth-child(12)::before {
    background: var(--green);
}

.metric-card:nth-child(3)::before,
.metric-card:nth-child(6)::before,
.metric-card:nth-child(7)::before {
    background: var(--amber);
}

.metric-card:nth-child(4)::before {
    background: var(--red);
}

.metric-card:hover {
    border-color: rgba(35, 88, 213, .28);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.metric-label {
    grid-column: 1;
    align-self: end;
    padding-top: 18px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.metric-icon {
    grid-column: 2;
    grid-row: 1 / span 2;
    place-self: start end;
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 8px;
    background: rgba(35, 88, 213, .10);
    color: var(--blue);
    font-size: 23px;
    font-variation-settings: "FILL" 1, "wght" 700, "GRAD" 0, "opsz" 24;
}

.metric-card:nth-child(2) .metric-icon,
.metric-card:nth-child(12) .metric-icon {
    background: rgba(22, 133, 103, .12);
    color: var(--green);
}

.metric-card:nth-child(3) .metric-icon,
.metric-card:nth-child(6) .metric-icon,
.metric-card:nth-child(7) .metric-icon {
    background: rgba(183, 110, 0, .13);
    color: var(--amber);
}

.metric-card:nth-child(4) .metric-icon {
    background: rgba(194, 65, 75, .12);
    color: var(--red);
}

.metric-card strong {
    grid-column: 1 / -1;
    font-size: clamp(21px, 2.2vw, 31px);
    line-height: 1.05;
    overflow-wrap: anywhere;
}

.customer-profile {
    padding: 0;
}

.customer-hero {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--line-soft);
    background:
        linear-gradient(135deg, rgba(35, 88, 213, .08), transparent 58%),
        linear-gradient(90deg, rgba(22, 133, 103, .08), transparent 44%),
        #fff;
}

:root[data-theme="dark"] .profile-notes,
:root[data-theme="dark"] .check-line,
:root[data-theme="dark"] .table-wrap {
    background: rgba(23, 34, 53, .62);
}

.customer-avatar {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--blue), var(--cyan));
    color: #fff;
    font-size: 25px;
    font-weight: 900;
    box-shadow: 0 14px 26px rgba(35, 88, 213, .20);
}

.customer-hero h2 {
    margin: 0;
    font-size: clamp(24px, 2.6vw, 34px);
}

.customer-hero p:not(.eyebrow) {
    margin: 5px 0 0;
    color: var(--muted);
}

.profile-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 9px;
    flex-wrap: wrap;
}

.whatsapp-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 10px 14px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, #19a466, #0f8f6b);
    color: #fff;
    font-weight: 900;
    box-shadow: 0 13px 28px rgba(22, 133, 103, .22);
}

.whatsapp-button:hover {
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 16px 34px rgba(22, 133, 103, .28);
}

.whatsapp-button .material-symbols-rounded {
    font-size: 20px;
    font-variation-settings: "FILL" 1, "wght" 700, "GRAD" 0, "opsz" 24;
}

.customer-profile .metric-grid {
    padding: 18px 20px 0;
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    padding: 18px 20px 0;
}

.contact-card {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
    min-height: 74px;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: linear-gradient(180deg, #fff, #fbfdff);
    color: var(--text);
    box-shadow: 0 8px 18px rgba(18, 28, 45, .04);
}

.contact-card:hover {
    border-color: rgba(35, 88, 213, .30);
    transform: translateY(-1px);
    box-shadow: var(--shadow-soft);
}

.contact-card .material-symbols-rounded {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border-radius: var(--radius);
    background: rgba(35, 88, 213, .09);
    color: var(--blue);
    font-size: 21px;
    font-variation-settings: "FILL" 1, "wght" 700, "GRAD" 0, "opsz" 24;
}

.contact-card div {
    min-width: 0;
}

.contact-card small {
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 850;
    text-transform: uppercase;
}

.contact-card strong {
    display: block;
    overflow: hidden;
    color: var(--text);
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.muted-contact {
    color: var(--muted);
}

.muted-contact strong {
    color: var(--muted);
}

.profile-notes {
    display: flex;
    gap: 12px;
    margin: 18px 20px 20px;
    padding: 15px;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    background: rgba(248, 251, 255, .78);
}

.profile-notes > .material-symbols-rounded {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border-radius: var(--radius);
    background: rgba(22, 133, 103, .10);
    color: var(--green);
    font-size: 21px;
    font-variation-settings: "FILL" 1, "wght" 700, "GRAD" 0, "opsz" 24;
}

.profile-notes strong {
    display: block;
    margin-bottom: 4px;
}

.profile-notes p {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
}

.split-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 18px;
}

.panel {
    position: relative;
    padding: 18px;
    margin-bottom: 18px;
    overflow: hidden;
    background:
        linear-gradient(180deg, rgba(255,255,255,.96), rgba(255,255,255,.90)),
        var(--surface);
    animation: fade-in .28s var(--ease) both;
}

:root[data-theme="dark"] .panel {
    background:
        linear-gradient(180deg, rgba(18, 27, 43, .96), rgba(18, 27, 43, .90)),
        var(--surface);
}

.panel::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 1px;
    background: linear-gradient(90deg, rgba(35, 88, 213, .30), rgba(22, 133, 103, .18), transparent);
}

.panel-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line-soft);
}

.panel-title h2,
.panel-title h3 {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin: 0;
    font-size: 18px;
    line-height: 1.25;
}

.panel-title h2::before {
    content: "";
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--blue), var(--cyan));
    box-shadow: 0 0 0 5px rgba(35, 88, 213, .08);
}

.panel-title a {
    font-size: 13px;
    font-weight: 750;
}

.panel-title.mini {
    margin-bottom: 8px;
}

.panel-title.mini h3 {
    font-size: 15px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 15px;
}

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

label {
    display: grid;
    align-content: start;
    align-self: start;
    gap: 8px;
    min-width: 0;
    color: var(--muted);
    font-size: 12.5px;
    font-weight: 750;
}

input,
select,
textarea {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: linear-gradient(180deg, #fff, #fbfdff);
    color: var(--text);
    padding: 10px 13px;
    outline: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .80);
}

input[readonly] {
    background: var(--surface-strong);
}

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(35, 88, 213, .7);
    box-shadow: 0 0 0 4px rgba(35, 88, 213, .12);
    background: #fff;
}

textarea {
    min-height: 108px;
    resize: vertical;
}

.span-2 {
    grid-column: span 2;
}

.form-grid.wide > .form-actions {
    grid-column: 1 / -1;
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    align-self: start;
    min-height: 44px;
    padding-top: 2px;
}

.check-line {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 42px;
    padding: 9px 11px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-strong);
}

.check-line input {
    width: auto;
    min-height: auto;
}

.primary-button,
.ghost-button,
.inline-delete button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    border: 0;
    border-radius: var(--radius);
    padding: 10px 15px;
    cursor: pointer;
    font-weight: 850;
    white-space: nowrap;
}

.primary-button {
    width: min(280px, 100%);
    background: linear-gradient(135deg, var(--blue), var(--cyan));
    color: #fff;
    box-shadow: 0 12px 24px rgba(35, 88, 213, .22);
}

.primary-button::after {
    content: "›";
    margin-left: 9px;
    font-size: 22px;
    line-height: 0;
}

.primary-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 30px rgba(35, 88, 213, .28);
}

.ghost-button {
    width: auto;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text);
}

.ghost-button:hover {
    border-color: rgba(35, 88, 213, .35);
    color: var(--blue);
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 780px;
    background: var(--surface);
}

th,
td {
    border-bottom: 1px solid var(--line-soft);
    padding: 13px 12px;
    text-align: left;
    vertical-align: middle;
}

tr:last-child td {
    border-bottom: 0;
}

tbody tr:hover {
    background: var(--surface-strong);
}

th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--surface-strong);
    color: var(--muted);
    font-size: 11px;
    font-weight: 850;
    text-transform: uppercase;
}

td small,
.list-line span,
.project-card span,
.project-card small,
.goal-line small {
    display: block;
    color: var(--muted);
    margin-top: 4px;
}

.actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
    white-space: nowrap;
}

.actions a {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 6px 9px;
    border-radius: 999px;
    background: rgba(35, 88, 213, .08);
    color: var(--blue);
    font-size: 13px;
    font-weight: 850;
}

.actions a:hover {
    background: rgba(35, 88, 213, .14);
}

.inline-delete {
    display: inline;
}

.inline-delete button {
    min-height: 30px;
    padding: 6px 9px;
    border-radius: 999px;
    background: rgba(194, 65, 75, .08);
    color: var(--red);
    box-shadow: none;
    font-size: 13px;
}

.inline-delete button:hover {
    background: rgba(194, 65, 75, .14);
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 850;
}

.badge.good {
    background: rgba(22, 133, 103, .12);
    color: var(--green);
}

.badge.warn {
    background: rgba(183, 110, 0, .13);
    color: var(--amber);
}

.badge.bad {
    background: rgba(194, 65, 75, .12);
    color: var(--red);
}

.badge.muted {
    background: var(--bg-soft);
    color: var(--muted);
}

.list-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 0;
    border-bottom: 1px solid var(--line-soft);
}

.list-line:last-child {
    border-bottom: 0;
}

.right-stack {
    display: grid;
    justify-items: end;
    gap: 6px;
    text-align: right;
}

.empty,
.muted-text {
    color: var(--muted);
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 7px;
}

.filter-row a {
    padding: 8px 11px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.filter-row a.active,
.filter-row a:hover {
    background: var(--ink);
    color: #fff;
    border-color: var(--ink);
}

.kanban {
    display: grid;
    grid-template-columns: repeat(4, minmax(210px, 1fr));
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.kanban-col {
    min-height: 240px;
    padding: 12px;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    background: var(--surface-strong);
}

.kanban-col h3 {
    margin: 0 0 12px;
    font-size: 15px;
}

.project-card {
    display: grid;
    gap: 8px;
    padding: 12px;
    margin-bottom: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: 0 6px 14px rgba(18, 28, 45, .05);
}

.project-card:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-soft);
}

.progress {
    height: 10px;
    border-radius: 999px;
    background: var(--bg-soft);
    overflow: hidden;
}

.progress span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--green), var(--cyan));
}

.goal-line {
    padding: 13px 0;
    border-bottom: 1px solid var(--line-soft);
}

.timeline {
    display: grid;
    gap: 12px;
}

.timeline-item {
    display: grid;
    grid-template-columns: 112px 1fr;
    gap: 14px;
    align-items: start;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: 0 6px 14px rgba(18, 28, 45, .04);
}

.timeline-item time {
    color: var(--blue);
    font-weight: 850;
}

.chart {
    display: block;
    width: 100%;
    min-height: 360px;
}

.alert {
    padding: 13px 14px;
    border-radius: var(--radius);
    margin-bottom: 14px;
    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: var(--shadow-soft);
    animation: fade-in .2s var(--ease) both;
}

.alert.success {
    border-color: rgba(22, 133, 103, .32);
    background: rgba(22, 133, 103, .09);
    color: #11634d;
}

.alert.danger {
    border-color: rgba(194, 65, 75, .32);
    background: rgba(194, 65, 75, .09);
    color: #96313a;
}

.install-body {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 24px;
    background:
        linear-gradient(145deg, rgba(35, 88, 213, .12), transparent 42%),
        linear-gradient(315deg, rgba(22, 133, 103, .12), transparent 44%),
        var(--bg);
}

.install-shell {
    width: min(900px, 100%);
}

.install-card {
    position: relative;
    padding: clamp(22px, 4vw, 34px);
    box-shadow: var(--shadow);
    overflow: hidden;
    animation: rise-in .32s var(--ease) both;
}

.install-card::after {
    content: "";
    position: absolute;
    right: -120px;
    bottom: -120px;
    width: 360px;
    height: 220px;
    background: url("dashboard-visual.png") right bottom / cover no-repeat;
    opacity: .12;
    pointer-events: none;
}

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

.install-card h1 {
    margin: 16px 0 8px;
    font-size: clamp(26px, 4vw, 38px);
}

.install-card p {
    color: var(--muted);
    line-height: 1.58;
}

.login-card {
    display: grid;
    grid-template-columns: minmax(0, .92fr) minmax(320px, 1fr);
    gap: 26px;
    width: min(1040px, 100%);
    margin: auto;
    padding: 0;
}

.login-card::after {
    display: none;
}

.login-copy {
    position: relative;
    padding: clamp(26px, 4vw, 38px);
}

.login-theme-toggle {
    position: absolute;
    top: 22px;
    right: 22px;
    border-color: var(--line);
    background: var(--surface-strong);
    color: var(--text);
}

.login-theme-toggle:hover {
    border-color: rgba(35, 88, 213, .35);
    background: var(--surface);
    color: var(--blue);
}

.login-form {
    margin-top: 22px;
}

.login-benefits {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 18px 0 4px;
}

.login-benefits > span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 30px;
    padding: 6px 9px;
    border: 1px solid rgba(35, 88, 213, .12);
    border-radius: 999px;
    background: rgba(35, 88, 213, .06);
    color: var(--text);
    font-size: 12px;
    font-weight: 800;
}

.login-benefits > span > .material-symbols-rounded {
    color: var(--green);
    font-size: 16px;
    font-variation-settings: "FILL" 1, "wght" 700, "GRAD" 0, "opsz" 20;
}

.login-form .form-actions {
    grid-column: 1 / -1;
}

.login-form .primary-button {
    width: 100%;
}

.login-visual-panel {
    position: relative;
    min-height: 430px;
    overflow: hidden;
    border-left: 1px solid var(--line-soft);
    border-radius: 0 var(--radius) var(--radius) 0;
    background:
        linear-gradient(145deg, rgba(21, 29, 45, .06), rgba(35, 88, 213, .14)),
        #f7fbff;
}

:root[data-theme="dark"] .login-visual-panel {
    background:
        linear-gradient(145deg, rgba(126, 162, 255, .09), rgba(82, 212, 234, .08)),
        #101a2b;
}

.login-visual-panel img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 64% center;
    opacity: .86;
}

.login-visual-panel::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(255, 255, 255, .92), rgba(255, 255, 255, .08) 34%, transparent 70%),
        linear-gradient(180deg, rgba(255, 255, 255, .10), rgba(21, 29, 45, .18));
}

:root[data-theme="dark"] .login-visual-panel::after {
    background:
        linear-gradient(90deg, rgba(18, 27, 43, .92), rgba(18, 27, 43, .12) 35%, transparent 72%),
        linear-gradient(180deg, rgba(255, 255, 255, .03), rgba(4, 9, 18, .28));
}

.login-floating-card {
    position: absolute;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 13px;
    border: 1px solid rgba(255, 255, 255, .52);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .78);
    color: var(--text);
    font-size: 13px;
    font-weight: 850;
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
}

:root[data-theme="dark"] .login-floating-card {
    border-color: rgba(255, 255, 255, .14);
    background: rgba(18, 27, 43, .76);
}

.login-floating-card .material-symbols-rounded {
    color: var(--blue);
    font-variation-settings: "FILL" 1, "wght" 700, "GRAD" 0, "opsz" 24;
}

.login-floating-card.one {
    right: 28px;
    top: 34px;
}

.login-floating-card.two {
    left: 44px;
    bottom: 36px;
}

@keyframes rise-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
}

@media (max-width: 1180px) {
    .metric-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

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

    .dashboard-hero {
        grid-template-columns: 1fr;
    }

    .hero-visual {
        width: 72%;
        opacity: .20;
    }

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

@media (max-width: 900px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        height: auto;
        overflow: visible;
        padding: 12px 14px;
    }

    .sidebar-head {
        padding-bottom: 0;
        border-bottom: 0;
    }

    .sidebar .logo {
        min-height: 48px;
    }

    .mobile-menu-toggle {
        display: inline-flex;
        flex: 0 0 auto;
    }

    .sidebar nav {
        display: none;
        grid-template-columns: 1fr;
        gap: 8px;
        margin-top: 10px;
        overflow: visible;
        padding-right: 0;
        padding-top: 10px;
        border-top: 1px solid rgba(255, 255, 255, .10);
    }

    .sidebar.nav-open nav {
        display: grid;
        animation: fade-in .18s var(--ease) both;
    }

    .sidebar nav a {
        min-height: 38px;
        padding: 8px 10px;
    }

    .logout {
        margin-top: 4px;
        border-top: 1px solid rgba(255, 255, 255, .10);
        border-radius: var(--radius);
        padding-top: 9px;
    }

    .main {
        padding: 18px;
    }

    .metric-grid,
    .metric-grid.compact,
    .split-grid {
        grid-template-columns: 1fr;
    }

    .topbar {
        align-items: stretch;
        flex-direction: column;
    }

    .top-actions {
        justify-content: flex-start;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 2px;
    }

    .top-actions a,
    .top-actions .theme-toggle {
        flex: 0 0 auto;
    }

}

@media (max-width: 640px) {
    .form-grid,
    .form-grid.wide {
        grid-template-columns: 1fr;
    }

    .span-2,
    .form-grid.wide > .form-actions {
        grid-column: auto;
    }

    .form-actions {
        width: 100%;
    }

    .primary-button {
        width: 100%;
    }

    .top-actions a span:last-child,
    .top-actions .theme-toggle span:last-child {
        display: none;
    }

    .top-actions a,
    .top-actions .theme-toggle {
        width: 42px;
        justify-content: center;
        padding: 9px;
    }

    .dashboard-hero {
        padding: 18px;
    }

    .hero-visual {
        right: -88px;
        bottom: -64px;
        width: 118%;
        height: 72%;
        opacity: .15;
    }

    .hero-stats {
        grid-template-columns: 1fr;
    }

    .panel-title {
        align-items: flex-start;
        flex-direction: column;
    }

    .filter-row {
        justify-content: flex-start;
    }

    .timeline-item {
        grid-template-columns: 1fr;
    }

    .actions {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .customer-hero {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .profile-actions {
        justify-content: flex-start;
    }

    .profile-actions .ghost-button,
    .profile-actions .whatsapp-button {
        width: 100%;
    }

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

    .customer-profile .metric-grid,
    .contact-grid {
        padding-inline: 16px;
    }

    .profile-notes {
        margin-inline: 16px;
    }
}

@media (max-width: 760px) {
    .login-card {
        grid-template-columns: 1fr;
    }

    .login-visual-panel {
        min-height: 220px;
        border-left: 0;
        border-top: 1px solid var(--line-soft);
        border-radius: 0 0 var(--radius) var(--radius);
    }
}
