:root {
    --primary: #0f766e;
    --primary-dark: #115e59;
    --primary-soft: #ccfbf1;
    --accent: #14b8a6;
    --ink: #172033;
    --muted: #64748b;
    --line: #e2e8f0;
    --surface: #ffffff;
    --background: #f5f8fa;
    --danger: #dc2626;
    --success: #15803d;
    --shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
    --radius: 22px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 95% 5%, rgba(20, 184, 166, 0.08), transparent 28%),
        var(--background);
    color: var(--ink);
    font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

a {
    color: inherit;
}

[hidden] {
    display: none !important;
}

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

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 50;
    display: flex;
    width: 270px;
    flex-direction: column;
    background: linear-gradient(180deg, #0b3f3a 0%, #0f766e 65%, #115e59 100%);
    color: #fff;
    padding: 28px 20px;
    box-shadow: 8px 0 30px rgba(15, 118, 110, 0.16);
}

.brand {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 0 8px 28px;
}

.brand-icon {
    display: grid;
    width: 47px;
    height: 47px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(10px);
}

.brand-icon svg {
    width: 25px;
}

.brand strong,
.brand span {
    display: block;
}

.brand strong {
    font-size: 16px;
    letter-spacing: -0.02em;
}

.brand span {
    margin-top: 3px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.nav-menu {
    display: grid;
    gap: 8px;
}

.nav-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 15px;
    border-radius: 13px;
    color: rgba(255, 255, 255, 0.78);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: 0.2s ease;
}

.nav-menu a svg {
    width: 21px;
    flex: 0 0 auto;
}

.nav-menu a:hover,
.nav-menu a.active {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    transform: translateX(2px);
}

.sidebar-footer {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-top: auto;
    padding: 16px 10px 4px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 12px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border: 2px solid rgba(255,255,255,.45);
    border-radius: 50%;
    background: #5eead4;
    box-shadow: 0 0 0 4px rgba(94, 234, 212, 0.12);
}

.main-content {
    min-height: 100vh;
    margin-left: 270px;
    padding: 0 42px 28px;
}

.topbar {
    display: flex;
    min-height: 112px;
    align-items: center;
    gap: 16px;
}

.topbar h1 {
    margin: 3px 0 0;
    font-size: clamp(23px, 3vw, 32px);
    letter-spacing: -0.04em;
}

.eyebrow,
.section-kicker {
    margin: 0;
    color: var(--primary);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.14em;
}

.topbar-badge {
    margin-left: auto;
    padding: 9px 12px;
    border: 1px solid #d9eee9;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.8);
    color: var(--primary-dark);
    font-size: 12px;
    font-weight: 700;
}

.menu-button {
    display: none;
    width: 42px;
    height: 42px;
    padding: 10px;
    border: 0;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 7px 20px rgba(15, 23, 42, .08);
    cursor: pointer;
}

.menu-button span {
    display: block;
    height: 2px;
    margin: 4px 0;
    border-radius: 99px;
    background: var(--ink);
}

.card,
.hero-card,
.stat-card,
.tip-card {
    border: 1px solid rgba(226, 232, 240, 0.85);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--shadow);
}

.intro-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 245px;
    gap: 22px;
    margin-bottom: 22px;
}

.hero-card {
    position: relative;
    display: flex;
    min-height: 245px;
    overflow: hidden;
    align-items: center;
    border-radius: var(--radius);
    padding: 34px;
    background:
        radial-gradient(circle at 80% 40%, rgba(45, 212, 191, .15), transparent 25%),
        linear-gradient(135deg, #ffffff 0%, #f0fdfa 100%);
}

.hero-card > div:first-child {
    position: relative;
    z-index: 2;
    max-width: 580px;
}

.pill {
    display: inline-flex;
    padding: 7px 10px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .1em;
}

.hero-card h2 {
    max-width: 610px;
    margin: 16px 0 11px;
    font-size: clamp(25px, 3.1vw, 40px);
    line-height: 1.08;
    letter-spacing: -0.045em;
}

.hero-card p {
    max-width: 570px;
    margin: 0;
    color: var(--muted);
    line-height: 1.65;
}

.hero-visual {
    position: absolute;
    right: 25px;
    bottom: -15px;
    width: 210px;
    height: 210px;
    opacity: .95;
}

.washer {
    position: absolute;
    right: 10px;
    bottom: 0;
    width: 160px;
    height: 188px;
    border: 8px solid #dff7f2;
    border-radius: 30px;
    background: linear-gradient(145deg, #fff, #dff4f1);
    box-shadow: -20px 22px 50px rgba(15, 118, 110, .18);
    transform: rotate(6deg);
}

.washer-top {
    height: 42px;
    border-bottom: 4px solid #c9ece6;
    background:
        radial-gradient(circle at 25px 20px, #14b8a6 0 5px, transparent 6px),
        radial-gradient(circle at 120px 20px, #94a3b8 0 7px, transparent 8px);
}

.washer-door {
    position: absolute;
    inset: 58px 18px 18px;
    overflow: hidden;
    border: 10px solid #a7ded5;
    border-radius: 50%;
    background: #194a58;
    box-shadow: inset 0 0 0 7px rgba(255, 255, 255, .22);
}

.washer-water {
    position: absolute;
    right: -15px;
    bottom: -10px;
    left: -15px;
    height: 60%;
    border-radius: 45% 50% 0 0;
    background: linear-gradient(#5eead4, #14b8a6);
    transform: rotate(-8deg);
}

.stat-card {
    display: flex;
    min-height: 245px;
    flex-direction: column;
    justify-content: space-between;
    border-radius: var(--radius);
    padding: 28px;
}

.stat-icon {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border-radius: 15px;
    background: var(--primary-soft);
    color: var(--primary);
}

.stat-icon svg {
    width: 24px;
}

.stat-card span,
.stat-card small {
    display: block;
    color: var(--muted);
}

.stat-card span {
    font-size: 13px;
    font-weight: 600;
}

.stat-card strong {
    display: block;
    margin: 8px 0;
    font-size: 50px;
    line-height: 1;
    letter-spacing: -.06em;
}

.stat-card small {
    font-size: 11px;
}

.converter-card,
.form-card,
.product-list-card {
    border-radius: var(--radius);
    padding: 30px;
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 26px;
}

.section-heading h2 {
    margin: 5px 0 0;
    font-size: 23px;
    letter-spacing: -.035em;
}

.button {
    display: inline-flex;
    min-height: 43px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: 12px;
    padding: 11px 16px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.button:hover {
    transform: translateY(-1px);
}

.button-primary {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    box-shadow: 0 12px 24px rgba(15, 118, 110, .2);
}

.button-primary:hover {
    box-shadow: 0 15px 27px rgba(15, 118, 110, .28);
}

.button-secondary {
    background: var(--primary-soft);
    color: var(--primary-dark);
}

.button-light {
    border: 1px solid var(--line);
    background: #fff;
    color: #475569;
}

.button-full {
    width: 100%;
    margin-top: 20px;
}

.converter-form {
    display: grid;
    grid-template-columns: 1.25fr 1.25fr 1fr auto;
    gap: 16px;
    align-items: end;
}

.field {
    min-width: 0;
}

.field label {
    display: block;
    margin: 0 0 8px;
    color: #344256;
    font-size: 12px;
    font-weight: 700;
}

.field input,
.field select,
.search-box input {
    width: 100%;
    min-height: 48px;
    border: 1px solid var(--line);
    border-radius: 12px;
    outline: none;
    background: #fff;
    color: var(--ink);
    padding: 0 14px;
    transition: border .2s ease, box-shadow .2s ease;
}

.field input:focus,
.field select:focus,
.search-box input:focus {
    border-color: rgba(15, 118, 110, .65);
    box-shadow: 0 0 0 4px rgba(20, 184, 166, .1);
}

.field select:disabled {
    cursor: not-allowed;
    background: #f8fafc;
    color: #94a3b8;
}

.field small {
    display: block;
    min-height: 16px;
    margin-top: 7px;
    color: var(--muted);
    font-size: 10px;
}

.select-wrap {
    position: relative;
}

.select-wrap::after {
    content: "⌄";
    position: absolute;
    right: 14px;
    top: 50%;
    color: #64748b;
    pointer-events: none;
    transform: translateY(-54%);
}

.select-wrap select {
    appearance: none;
    padding-right: 38px;
}

.weight-input {
    display: flex;
}

.weight-input input {
    border-radius: 12px 0 0 12px;
}

.weight-input select {
    width: 70px;
    border-left: 0;
    border-radius: 0 12px 12px 0;
    background: #f8fafc;
    font-weight: 700;
}

.button-convert {
    min-height: 48px;
    white-space: nowrap;
}

.button-convert svg {
    width: 19px;
}

.result-panel {
    margin-top: 28px;
    overflow: hidden;
    border: 1px solid #bce9e1;
    border-radius: 18px;
    background: linear-gradient(135deg, #f0fdfa 0%, #ffffff 100%);
}

.result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 21px 24px;
    border-bottom: 1px solid #d5f3ee;
}

.result-header h3 {
    margin: 5px 0 0;
    font-size: 18px;
}

.result-condition {
    padding: 7px 10px;
    border-radius: 999px;
    background: #fff;
    color: var(--primary-dark);
    font-size: 11px;
    font-weight: 700;
    box-shadow: 0 5px 16px rgba(15,118,110,.09);
}

.result-grid {
    display: grid;
    grid-template-columns: 1.5fr repeat(3, 1fr);
    gap: 1px;
    background: #d5f3ee;
}

.result-main,
.result-detail {
    background: rgba(255,255,255,.88);
    padding: 24px;
}

.result-main > span,
.result-detail span {
    display: block;
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
}

.result-main div {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin: 8px 0 4px;
}

.result-main strong {
    color: var(--primary-dark);
    font-size: 45px;
    letter-spacing: -.06em;
}

.result-main em {
    color: var(--primary);
    font-size: 13px;
    font-style: normal;
    font-weight: 700;
}

.result-main small {
    color: var(--muted);
    font-size: 10px;
}

.result-detail strong {
    display: block;
    margin-top: 12px;
    font-size: 21px;
}

.result-note {
    padding: 14px 24px;
    color: #52716d;
    font-size: 10px;
    line-height: 1.55;
}

.tips-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 22px;
}

.tip-card {
    display: flex;
    align-items: center;
    gap: 13px;
    border-radius: 17px;
    padding: 17px;
}

.tip-number {
    display: grid;
    width: 35px;
    height: 35px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 11px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 12px;
    font-weight: 800;
}

.tip-card strong,
.tip-card span {
    display: block;
}

.tip-card strong {
    font-size: 12px;
}

.tip-card span {
    margin-top: 3px;
    color: var(--muted);
    font-size: 10px;
}

.management-grid {
    display: grid;
    grid-template-columns: minmax(360px, .85fr) minmax(450px, 1.15fr);
    gap: 22px;
    align-items: start;
}

.form-card {
    position: sticky;
    top: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1.25fr .75fr;
    gap: 14px;
}

.weights-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 26px 0 13px;
}

.weights-title strong,
.weights-title span {
    display: block;
}

.weights-title strong {
    font-size: 13px;
}

.weights-title span {
    margin-top: 3px;
    color: var(--muted);
    font-size: 10px;
}

.weight-rows {
    display: grid;
    gap: 10px;
}

.weight-row {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr 34px;
    gap: 10px;
    align-items: end;
    padding: 14px;
    border: 1px solid #edf1f5;
    border-radius: 15px;
    background: #fbfdfd;
}

.input-suffix {
    display: flex;
}

.input-suffix input {
    border-radius: 12px 0 0 12px;
}

.input-suffix span {
    display: flex;
    align-items: center;
    border: 1px solid var(--line);
    border-left: 0;
    border-radius: 0 12px 12px 0;
    background: #f8fafc;
    color: var(--muted);
    padding: 0 11px;
    font-size: 10px;
    font-weight: 700;
}

.remove-weight {
    display: grid;
    width: 34px;
    height: 48px;
    place-items: center;
    border: 0;
    border-radius: 10px;
    background: #fff1f2;
    color: #e11d48;
    font-size: 22px;
    cursor: pointer;
}

.switch-field {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 18px;
    cursor: pointer;
}

.switch-field input {
    position: absolute;
    opacity: 0;
}

.switch-ui {
    position: relative;
    width: 44px;
    height: 25px;
    flex: 0 0 auto;
    border-radius: 999px;
    background: #cbd5e1;
    transition: .2s ease;
}

.switch-ui::after {
    content: "";
    position: absolute;
    top: 4px;
    left: 4px;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 6px rgba(15,23,42,.18);
    transition: .2s ease;
}

.switch-field input:checked + .switch-ui {
    background: var(--accent);
}

.switch-field input:checked + .switch-ui::after {
    transform: translateX(19px);
}

.switch-field strong,
.switch-field small {
    display: block;
}

.switch-field strong {
    font-size: 12px;
}

.switch-field small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 10px;
}

.search-box {
    position: relative;
    margin-bottom: 16px;
}

.search-box svg {
    position: absolute;
    top: 50%;
    left: 14px;
    width: 18px;
    color: #94a3b8;
    transform: translateY(-50%);
}

.search-box input {
    padding-left: 42px;
}

.product-list {
    display: grid;
    gap: 10px;
    max-height: 700px;
    overflow-y: auto;
    padding-right: 4px;
}

.product-item {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: start;
    border: 1px solid #edf1f5;
    border-radius: 15px;
    padding: 14px;
    background: #fff;
    transition: .18s ease;
}

.product-item:hover {
    border-color: #bce9e1;
    box-shadow: 0 9px 20px rgba(15,118,110,.06);
}

.product-symbol {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 13px;
    background: linear-gradient(145deg, var(--primary-soft), #e6fffb);
    color: var(--primary-dark);
    font-size: 15px;
    font-weight: 800;
}

.product-title-row {
    display: flex;
    align-items: center;
    gap: 9px;
    flex-wrap: wrap;
}

.product-title-row strong {
    font-size: 13px;
}

.product-category {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 10px;
}

.status {
    display: inline-flex;
    padding: 4px 7px;
    border-radius: 99px;
    font-size: 8px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.status.active {
    background: #dcfce7;
    color: #15803d;
}

.status.inactive {
    background: #f1f5f9;
    color: #64748b;
}

.weight-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.weight-tags span {
    padding: 5px 8px;
    border-radius: 8px;
    background: #f8fafc;
    color: #475569;
    font-size: 9px;
    font-weight: 600;
}

.product-actions {
    display: flex;
    align-items: center;
    gap: 9px;
}

.product-actions a,
.product-actions button {
    border: 0;
    background: transparent;
    font-size: 10px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.product-actions a {
    color: var(--primary);
}

.product-actions button {
    color: var(--danger);
}

.alert {
    margin-bottom: 18px;
    border: 1px solid;
    border-radius: 13px;
    padding: 13px 16px;
    font-size: 12px;
    font-weight: 600;
}

.alert-success {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: #166534;
}

.alert-error {
    border-color: #fecaca;
    background: #fef2f2;
    color: #991b1b;
}

.empty-state {
    padding: 44px 20px;
    text-align: center;
}

.empty-state.compact {
    padding: 28px 15px;
}

.empty-state h3 {
    margin: 0 0 8px;
}

.empty-state p {
    margin: 0 0 18px;
    color: var(--muted);
    font-size: 12px;
}

.no-search-results {
    padding: 25px;
    color: var(--muted);
    text-align: center;
    font-size: 12px;
}

.page-footer {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    padding: 26px 4px 2px;
    color: #94a3b8;
    font-size: 10px;
}

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

    .button-convert {
        width: 100%;
    }

    .result-grid {
        grid-template-columns: 1.4fr 1fr 1fr;
    }

    .result-detail:last-child {
        grid-column: 2 / -1;
    }

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

    .form-card {
        position: static;
    }
}

@media (max-width: 900px) {
    .sidebar {
        transform: translateX(-105%);
        transition: transform .24s ease;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        padding: 0 20px 24px;
    }

    .menu-button {
        display: block;
    }
}

@media (max-width: 700px) {
    .topbar {
        min-height: 92px;
    }

    .topbar-badge {
        display: none;
    }

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

    .hero-card {
        min-height: 260px;
        padding: 25px;
    }

    .hero-card > div:first-child {
        max-width: 75%;
    }

    .hero-card p {
        font-size: 12px;
    }

    .hero-visual {
        right: -30px;
        opacity: .7;
    }

    .stat-card {
        min-height: auto;
        flex-direction: row;
        align-items: center;
    }

    .stat-card strong {
        font-size: 36px;
    }

    .converter-card,
    .form-card,
    .product-list-card {
        padding: 21px;
    }

    .converter-form,
    .form-row {
        grid-template-columns: 1fr;
    }

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

    .result-main {
        grid-column: 1 / -1;
    }

    .result-detail:last-child {
        grid-column: auto;
    }

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

    .weight-row {
        grid-template-columns: 1fr 34px;
    }

    .weight-row .field:nth-child(2) {
        grid-column: 1 / 2;
    }

    .remove-weight {
        grid-column: 2;
        grid-row: 1 / 3;
        align-self: stretch;
        height: auto;
    }

    .product-item {
        grid-template-columns: 38px minmax(0, 1fr);
    }

    .product-actions {
        grid-column: 2;
        justify-content: flex-start;
    }

    .page-footer {
        flex-direction: column;
        align-items: center;
    }
}

@media (max-width: 460px) {
    .main-content {
        padding-inline: 13px;
    }

    .hero-card > div:first-child {
        max-width: 100%;
    }

    .hero-visual {
        display: none;
    }

    .section-heading,
    .weights-title,
    .result-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .section-heading .button,
    .weights-title .button {
        width: 100%;
    }

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

    .result-main,
    .result-detail,
    .result-detail:last-child {
        grid-column: auto;
    }
}
