:root {
    --ink: #2e4947;
    --teal: #3c5654;
    --deep-teal: #385050;
    --mint: #e4f2f2;
    --gold: #d7a217;
    --lavender: #c0a8d8;
    --cream: #f0e0d8;
    --purple: #b095d8;
    --bs-body-font-family: "Nunito", "Segoe UI", system-ui, sans-serif;
}

[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #4b2e84; outline-offset: 4px; }

.pastel-page {
    display: grid;
    place-items: center;
    min-height: 100dvh;
    margin: 0;
    padding: clamp(1rem, 5vw, 3rem);
    color: #483953;
    background:
        radial-gradient(ellipse at 50% 93%, #ead2ed88, transparent 45%),
        radial-gradient(ellipse at 85% 10%, #dcc8ec, transparent 45%),
        radial-gradient(circle at 2% 88%, #a88cc3, transparent 29%),
        var(--lavender);
    position: relative;
    isolation: isolate;
}
.pastel-page::before, .pastel-page::after {
    content: "";
    z-index: -1;
    position: fixed;
    width: clamp(4rem, 13vw, 12rem);
    aspect-ratio: 2.1;
    border-radius: 55% 45% 40% 45% / 75% 68% 38% 32%;
    background: radial-gradient(ellipse at 35% 20%, #fff8ef, #ead8d0 63%, #c7b1c6 100%);
    box-shadow: 0 .9rem 1.2rem #5f447452;
}
.pastel-page::before { top: 27%; left: max(2%, calc(50% - 27rem)); transform: rotate(-11deg); }
.pastel-page::after { top: 59%; right: max(3%, calc(50% - 29rem)); transform: rotate(7deg); }

.login-card, .setup-card {
    width: min(100%, 34rem);
    border-radius: clamp(1.75rem, 6vw, 4rem);
    background: radial-gradient(ellipse at 37% 10%, #fff5eb, transparent 73%), var(--cream);
    border: 1px solid #fff6ef;
    box-shadow: -1.1rem 1.5rem 3.5rem #5f44745e, inset .18rem .2rem .6rem #fff8f1;
}
.login-card {
    padding: clamp(1.6rem, 5vw, 2.8rem) clamp(.7rem, 3.8vw, 1.65rem) .95rem;
    text-align: center;
}
.login-heading h1, .setup-card h1 {
    margin: 0 0 .35rem;
    color: #604787;
    font-weight: 800;
    letter-spacing: -.045em;
    font-size: clamp(2rem, 5.2vw, 3rem);
    text-shadow: 0 2px 0 #fff7f0, 0 4px 9px #6d4a9540;
}
.login-heading p { margin: 0; font-size: 1.06rem; color: #64536b; }
.login-logo { width: min(83%, 18rem); margin: .8rem auto -.45rem; position: relative; z-index: 1; }
.pedianet-logo { display: block; width: 100%; height: auto; }
.login-logo { mix-blend-mode: multiply; }

.login-form {
    border-radius: clamp(1.3rem, 4vw, 3rem);
    padding: clamp(1.1rem, 5vw, 2rem);
    background: linear-gradient(145deg, #fff8f1, #f0dfd5);
    box-shadow: inset 0 2px 3px #fff, 0 .45rem .8rem #7d5d7830;
    text-align: left;
}
.login-field + .login-field { margin-top: .85rem; }
.login-field label { margin: 0 0 .25rem .55rem; font-size: .82rem; font-weight: 650; }
.input-capsule {
    display: flex;
    align-items: center;
    gap: .55rem;
    min-height: 3.25rem;
    border-radius: 999px;
    border: 1px solid #fffbf5;
    background: #f9efe8;
    box-shadow: 0 2px 4px #7865784d, inset 0 2px 3px #fff;
    padding: .2rem .34rem;
}
.input-capsule:focus-within { box-shadow: 0 0 0 2px #8065aa, inset 0 2px 3px #fff; }
.input-capsule input {
    flex: 1; min-width: 0; width: 100%; border: 0; background: none;
    color: #453450; padding: .5rem .2rem; outline: none;
}
.input-capsule input::placeholder { color: #78647c; }
.input-icon {
    width: 2.65rem; height: 2.65rem; border-radius: 50%; flex: none; position: relative;
    background: linear-gradient(150deg, #c3a9e4, #9779bf);
    box-shadow: 0 2px 4px #674b8d69, inset 0 2px 4px #e4d2fb;
}
.input-icon::before, .input-icon::after { content: ""; position: absolute; left: 50%; transform: translateX(-50%); }
.icon-user::before { top: .56rem; width: .62rem; height: .62rem; border-radius: 50%; background: #fff9f1; }
.icon-user::after { top: 1.24rem; width: 1.14rem; height: .65rem; border-radius: 100% 100% .25rem .25rem; background: #fff9f1; }
.icon-lock::before { top: .59rem; width: .68rem; height: .76rem; border: .14rem solid #fff9f1; border-radius: .5rem; }
.icon-lock::after { top: 1.17rem; width: .96rem; height: .7rem; border-radius: .2rem; background: #fff9f1; }
.password-toggle {
    border: 0; background: none; color: #64536b; display: grid; place-items: center;
    width: 2.75rem; height: 2.75rem; border-radius: 50%; flex: none;
}
.password-toggle span { width: 1.05rem; height: 1.05rem; border: 2px solid currentColor; border-radius: 75% 15%; transform: rotate(45deg); position: relative; }
.password-toggle span::after { content: ""; position: absolute; inset: 26%; border-radius: 50%; background: currentColor; }
.password-toggle[aria-pressed="true"] span::before { content: ""; position: absolute; left: 40%; height: 140%; top: -20%; width: 2px; background: currentColor; }
.btn-login {
    color: #2f1e47; border: 1px solid #b096d4; border-radius: 999px; min-height: 3.25rem;
    background: linear-gradient(150deg, #c8afe7, var(--purple) 62%, #a48aca);
    font-weight: 800; font-size: 1.1rem;
    box-shadow: 0 5px 9px #72568d52, inset 0 2px 4px #e7d7f9;
}
.btn-login:hover, .btn-login:active { color: #22113b; background: #c3aae5; }
.login-form .btn-login, .setup-form .btn-login { width: 100%; margin-top: 1.3rem; }
.setup-card { padding: clamp(1.4rem, 5vw, 2.4rem); }
.setup-card h1 { font-size: clamp(1.7rem, 5vw, 2.4rem); }
.setup-card .btn-login { padding-inline: 1.3rem; }
.setup-form { display: grid; gap: .4rem; margin-top: 1.2rem; }
.setup-form label { font-weight: 650; margin-top: .35rem; }
.setup-form .form-control { border-radius: .85rem; border-color: #c8afd8; background: #fff9f3; }
.requirements summary { cursor: pointer; font-weight: 700; }
.requirements .list-group-item { background: transparent; color: inherit; }

.workspace-page {
    color: var(--ink);
    min-height: 100dvh;
    padding: clamp(1rem, 5vw, 4rem) clamp(.65rem, 5vw, 4rem);
    background:
        radial-gradient(circle at 0 -9%, var(--gold) 0 16rem, transparent 16.1rem),
        radial-gradient(ellipse at 85% 110%, #c3d9d8 0 45%, transparent 45.2%),
        var(--mint);
}
.app-frame {
    max-width: 1240px; margin: 0 auto;
    display: grid; grid-template-columns: minmax(12rem, 21%) minmax(0, 1fr);
    min-height: min(80vh, 54rem);
    background: #deebea; border-radius: 1.7rem;
    box-shadow: 0 2rem 2.5rem #405b5660;
}
.mobile-header { display: none; }
.app-sidebar {
    display: flex; flex-direction: column; min-width: 0;
    background: var(--teal); color: #fff; border-radius: 1.7rem; overflow: hidden;
}
.sidebar-profile {
    display: grid; justify-items: center; gap: .25rem; padding: 2rem .9rem 1.6rem;
    background: var(--deep-teal); text-align: center; overflow-wrap: anywhere;
}
.sidebar-profile strong { font-size: 1.06rem; }
.sidebar-profile span { font-size: .88rem; color: #e6eeee; }
.profile-logo {
    width: 5.1rem; height: 5.1rem; border-radius: 50%; display: grid; place-items: center;
    margin: 0 0 .6rem; background: #f9f7ee; border: 3px solid var(--gold); padding: .22rem;
}
.profile-logo img { mix-blend-mode: multiply; }
.sidebar-nav { padding: 1.2rem .8rem; }
.sidebar-nav a, .sidebar-logout button {
    display: flex; width: 100%; align-items: center; gap: .7rem; border-radius: 999px;
    text-decoration: none; font-weight: 650; padding: .7rem .95rem; text-align: left;
}
.sidebar-nav .nav-active { color: var(--ink); background: #fff; }
.nav-icon { color: #e2b64c; font-size: 1.4rem; line-height: 1; }
.nav-active .nav-icon { color: #8a5e05; }
.sidebar-logout { padding: .8rem; margin-top: auto; }
.sidebar-logout button { color: #fff; }
.sidebar-logout button:hover { background: #304846; color: #fff; }
.skip-link { position: absolute; top: .5rem; left: .5rem; color: var(--ink); background: #fff; z-index: 2; padding: .55rem; }
.workspace-content { padding: clamp(1rem, 3vw, 2.25rem); min-width: 0; }
.workspace-heading { display: flex; align-items: center; margin-bottom: 1.15rem; }
.workspace-heading p { margin: 0 0 .25rem; font-size: .76rem; letter-spacing: .1em; font-weight: 750; color: #45625f; }
.workspace-heading h1 { margin: 0; font-size: clamp(1.65rem, 3vw, 2.25rem); font-weight: 800; letter-spacing: -.04em; }
.summary-row { margin-bottom: 1.05rem; }
.summary-tile {
    min-height: 6.25rem; padding: 1rem; border-radius: 1.3rem;
    position: relative; overflow: hidden; isolation: isolate; color: #fff; background: var(--teal);
}
.summary-tile::after {
    content: ""; position: absolute; inset: -2.7rem -2rem auto auto; width: 7.5rem; height: 7.5rem;
    border: 1px solid #ffffff61; border-radius: 50%; box-shadow: 0 0 0 .55rem #ffffff24, 0 0 0 1.2rem #ffffff1c; z-index: -1;
}
.summary-tile span, .summary-tile strong { display: block; }
.summary-tile strong { font-size: 1.8rem; line-height: 1.3; }
.summary-gold { background: var(--gold); color: #332509; }
.workspace-card { background: #fff; border-radius: 1.35rem; padding: clamp(.85rem, 2.1vw, 1.3rem); box-shadow: 0 3px 12px #31595410; }
.workspace-card h2 { font-size: 1.16rem; margin: 0 0 .65rem; font-weight: 750; }
.workspace-card .table { --bs-table-color: var(--ink); --bs-table-border-color: #e3eae9; font-size: .9rem; }
.workspace-card thead th { color: #4c6966; font-size: .79rem; }
.workspace-card tbody tr:last-child td { border-bottom: 0; }

@media (max-width: 767.98px) {
    .workspace-page { padding: .55rem; background: var(--mint); }
    .workspace-heading p { display: none; }
    .app-frame { display: block; border-radius: 1rem; }
    .mobile-header { display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding: .7rem 1rem; border-radius: 1rem 1rem 0 0; background: var(--deep-teal); color: #fff; font-weight: 750; }
    .mobile-menu { color: #fff; border: 1px solid #a0b6b3; }
    .mobile-menu:hover, .mobile-menu:focus { color: #fff; }
    .app-sidebar { border-radius: 0 0 1rem 1rem; }
    .menu-enhanced .app-sidebar:not(.menu-open) { display: none; }
    .sidebar-profile { padding: .7rem; }
    .sidebar-nav { padding: .7rem .8rem .25rem; }
    .sidebar-logout { padding: .25rem .8rem .65rem; }
    .summary-tile { min-height: auto; }
    .summary-tile span, .summary-tile strong { display: inline-block; }
    .summary-tile strong { margin-left: .65rem; vertical-align: middle; }
}


.settings-heading { justify-content: space-between; gap: .8rem; flex-wrap: wrap; }
.settings-form { max-width: 40rem; }
.settings-form .form-label { font-weight: 650; }
.settings-form .form-control, .settings-form .form-select { border-color: #a9c1be; }
.settings-actions, .table-actions { display: flex; flex-wrap: wrap; gap: .65rem; }
.settings-actions { margin-top: 1.25rem; }
.btn-pedianet, .btn-pedianet-secondary { border-radius: 999px; font-weight: 700; padding: .55rem 1rem; }
.btn-pedianet { color: #fff; background: var(--teal); border: 1px solid var(--teal); }
.btn-pedianet:hover, .btn-pedianet:focus-visible { color: #fff; background: #293f3d; }
.btn-pedianet-secondary { color: var(--ink); border: 1px solid #9cb5b2; background: #f3f9f8; }
.btn-pedianet-secondary:hover { color: var(--ink); background: #e4efee; }
.action-link { color: #325755; font-weight: 700; white-space: nowrap; }
.status-chip { display: inline-block; border-radius: 999px; padding: .2rem .65rem; color: #51452e; background: #f6ebcd; font-weight: 650; }
.status-enabled { color: #294c3e; background: #dceee4; }
.sidebar-nav .nav-link-pedianet { color: #f7fcfb; }
.sidebar-nav .nav-link-pedianet:hover { background: #304846; }
.sidebar-nav .nav-group { margin: .75rem .95rem .1rem; color: #f5d579; font-size: .8rem; font-weight: 750; }
.sidebar-nav .nav-subgroup { margin: .45rem .95rem .15rem; color: #e2eeee; font-size: .78rem; }
.sidebar-nav .nav-subitem { padding-left: 1.35rem; }
.sidebar-nav .nav-profile { margin-top: .65rem; }

@media (max-width: 575.98px) {
    .settings-actions > * { flex: 1 1 auto; }
    .table-actions { min-width: 8.6rem; }
}

.dashboard-meter { height: .75rem; accent-color: var(--gold); }
.dashboard-meter::-webkit-meter-bar { background: #e8f2f1; border: 0; }
.dashboard-meter::-webkit-meter-optimum-value { background: var(--gold); border-radius: 999px; }

.inventory-summary.dashboard-status { grid-template-columns: minmax(0, 1fr) auto; gap: .55rem .75rem; }
.inventory-summary.dashboard-status dd { text-align: end; white-space: nowrap; }
.inventory-summary.dashboard-status dd + dt { margin-top: 0; }
@media (max-width: 350px) {
    .inventory-summary.dashboard-status { grid-template-columns: 1fr; gap: .15rem; }
    .inventory-summary.dashboard-status dd { text-align: start; }
}

.restore-preview dd { min-width: 0; overflow-wrap: anywhere; }
.restore-digest { display: block; word-break: break-all; }
