﻿/* =========================
   THEME (global styles)
   ========================= */

:root {
    --bg: #0b1020;
    --panel: #101a33;
    --card: #0f1730;
    --text: #e9edf7;
    --muted: #93a4c7;
    --accent: #7c5cff;
    --accent2: #23d5ab;
    --warn: #ffcc00;
    --bad: #ff5470;
    --ok: #3ddc97;
    --shadow: 0 14px 40px rgba(0,0,0,.35);
    --border: 1px solid rgba(255,255,255,.10);
    --blur: blur(12px);
    --font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Inter, Arial, sans-serif;
}

/* reset */
* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    margin: 0;
    font-family: var(--font);
    color: var(--text);
    background: radial-gradient(1200px 800px at 10% 10%, rgba(124,92,255,.25), transparent 50%), radial-gradient(900px 600px at 90% 20%, rgba(35,213,171,.18), transparent 50%), radial-gradient(1000px 900px at 40% 90%, rgba(255,84,112,.12), transparent 55%), var(--bg);
}

a {
    color: inherit;
    text-decoration: none;
}

/* global card component */
.card {
    background: rgba(16,26,51,.66);
    border: var(--border);
    border-radius: 22px;
    box-shadow: var(--shadow);
    padding: 18px;
    backdrop-filter: var(--blur);
    position: relative;
    overflow: hidden;
}

    .card::before {
        content: "";
        position: absolute;
        inset: -2px;
        background: radial-gradient(520px 220px at 20% 0%, rgba(124,92,255,.22), transparent 60%), radial-gradient(520px 220px at 90% 30%, rgba(35,213,171,.14), transparent 60%);
        pointer-events: none;
    }

/* helpers */
.muted {
    color: var(--muted);
    font-size: 12px;
}

.validation {
    color: var(--bad);
    font-size: 12px;
}

.field-error {
    color: var(--bad);
    font-size: 12px;
}

/* forms */
form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 12px;
    color: var(--muted);
}

input, textarea, select {
    padding: 12px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(0,0,0,.25);
    color: var(--text);
    font-size: 14px;
    outline: none;
}

    input::placeholder, textarea::placeholder {
        color: rgba(147,164,199,.75);
    }

    input:focus, textarea:focus, select:focus {
        border-color: rgba(124,92,255,.55);
        box-shadow: 0 0 0 3px rgba(124,92,255,.12);
    }

    /* autofill fix */
    input:-webkit-autofill,
    input:-webkit-autofill:hover,
    input:-webkit-autofill:focus {
        -webkit-text-fill-color: var(--text);
        transition: background-color 9999s ease-in-out 0s;
        box-shadow: 0 0 0px 1000px rgba(0,0,0,.28) inset;
        border: 1px solid rgba(255,255,255,.12);
    }

/* buttons */
.btn {
    padding: 12px 14px;
    border-radius: 14px;
    border: var(--border);
    background: rgba(255,255,255,.04);
    color: var(--text);
    cursor: pointer;
    transition: .2s;
    font-weight: 800;
    font-size: 14px;
}

    .btn:hover {
        transform: translateY(-1px);
        background: rgba(255,255,255,.06);
    }

    .btn.accent {
        border: none;
        height: 46px;
        border-radius: 16px;
        font-size: 15px;
        background: linear-gradient(135deg, rgba(124,92,255,.92), rgba(35,213,171,.78));
        box-shadow: 0 10px 26px rgba(124,92,255,.25);
    }

    .btn.ghost {
        background: rgba(255,255,255,.03);
    }

/* pill-link */
.link {
    color: rgba(233,237,247,.9);
    font-size: 12px;
    padding: 8px 10px;
    border-radius: 999px;
    border: var(--border);
    background: rgba(255,255,255,.04);
    transition: .2s;
}

    .link:hover {
        transform: translateY(-1px);
        background: rgba(255,255,255,.07);
    }

/* row helper */
.row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 6px;
}

/* checkbox */
.checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    font-size: 12px;
    user-select: none;
}

    .checkbox input[type="checkbox"] {
        appearance: none;
        width: 18px;
        height: 18px;
        border-radius: 6px;
        border: 1px solid rgba(255,255,255,.18);
        background: rgba(0,0,0,.25);
        display: grid;
        place-items: center;
    }

        .checkbox input[type="checkbox"]:checked {
            background: rgba(124,92,255,.92);
            border-color: rgba(124,92,255,.92);
        }

            .checkbox input[type="checkbox"]:checked::after {
                content: "✓";
                font-weight: 900;
                font-size: 12px;
                color: #fff;
                line-height: 1;
            }

/* divider */
.divider {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--muted);
    font-size: 12px;
    margin: 8px 0 2px;
}

    .divider::before,
    .divider::after {
        content: "";
        height: 1px;
        flex: 1;
        background: rgba(255,255,255,.10);
    }

/* tables for Products / Organizations pages */
table {
    width: 100%;
    border-collapse: collapse;
    border-radius: 16px;
    overflow: hidden;
    background: rgba(0,0,0,.14);
    border: 1px solid rgba(255,255,255,.10);
}

th, td {
    padding: 12px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    text-align: left;
    font-size: 13px;
}

th {
    color: rgba(233,237,247,.9);
    background: rgba(255,255,255,.03);
}

tr:hover td {
    background: rgba(255,255,255,.02);
}


/* =========================
   NAVBAR (global)
   ========================= */

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(12px);
    background: rgba(10,14,30,.55);
    border-bottom: 1px solid rgba(255,255,255,.10);
}

.navbar {
    max-width: 1100px;
    margin: 0 auto;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.navbar-brand {
    font-weight: 900;
    letter-spacing: .2px;
    font-size: 16px;
}

.navbar-menu {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,.10);
    background: rgba(255,255,255,.04);
    color: rgba(233,237,247,.9);
    font-size: 13px;
    transition: .2s;
}

    .nav-link:hover {
        transform: translateY(-1px);
        background: rgba(255,255,255,.07);
    }

/* Auth block */
.nav-auth {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-auth__item {
    margin: 0;
    padding: 0;
}

.nav-auth__hello {
    font-size: 13px;
    color: rgba(233,237,247,.9);
    padding: 9px 12px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,.10);
    background: rgba(255,255,255,.02);
}

.nav-auth__link {
    font: inherit;
    cursor: pointer;
    border: 1px solid rgba(255,255,255,.10);
    background: rgba(255,255,255,.04);
    color: rgba(233,237,247,.9);
    padding: 9px 12px;
    border-radius: 999px;
    font-size: 13px;
    transition: .2s;
}

    .nav-auth__link:hover {
        transform: translateY(-1px);
        background: rgba(255,255,255,.07);
    }

/* button reset for logout */
.nav-auth form {
    margin: 0;
}

.nav-auth button {
    border: none;
}

/* =========================
   PAGE LAYOUT
   ========================= */

.page {
    padding: 22px 18px;
}

.page__container {
    max-width: 1100px;
    margin: 0 auto;
}

/* если на странице нужен full-width */
.page--wide .page__container {
    max-width: 100%;
}

/* если на странице вообще не нужен контейнер (например login) */
.page--full {
    padding: 0;
}

    .page--full .page__container {
        max-width: 100%;
        padding: 0;
    }

select {
    width: 100%;
    height: 46px;
    padding: 0 16px;
    padding-right: 44px;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,.10);
    background: rgba(255,255,255,.04);
    color: rgba(233,237,247,.92);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .1px;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, rgba(233,237,247,.85) 50%), linear-gradient(135deg, rgba(233,237,247,.85) 50%, transparent 50%);
    background-position: calc(100% - 18px) 50%, calc(100% - 12px) 50%;
    background-size: 6px 6px;
    background-repeat: no-repeat;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.25);
    backdrop-filter: blur(10px);
    color-scheme: dark;
}

    select:hover {
        background: rgba(255,255,255,.06);
        border-color: rgba(255,255,255,.14);
    }

    select:focus {
        border-color: rgba(35,213,171,.50);
        box-shadow: 0 0 0 4px rgba(35,213,171,.12);
    }

    select option {
        background: #0b1226;
        color: #e9edf7;
    }

        select option:checked {
            background: #17335f; 
            color: #ffffff;
        }


        select option:hover {
            background: #0f2a3f;
            color: #ffffff;
        }