* {
    box-sizing: border-box;
}

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-soft: #eff6ff;
    --green: #16a34a;
    --green-dark: #15803d;
    --red: #dc2626;
    --red-dark: #b91c1c;
    --dark: #111827;
    --text: #1f2937;
    --gray: #6b7280;
    --border: #e5e7eb;
    --white: #ffffff;
    --page: #f4f7fb;
    --shadow: 0 18px 48px rgba(17, 24, 39, 0.09);
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    color: var(--text);
    background: var(--page);
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font-family: inherit;
}

.container {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

/* ზედა მენიუ */

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(14px);
}

.header-row {
    min-height: 78px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.brand {
    display: inline-flex;
    align-items: center;
    color: var(--primary);
    font-size: 30px;
    font-weight: 900;
    letter-spacing: -1px;
}

.brand span {
    color: var(--dark);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.button {
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 18px;
    border: none;
    border-radius: 11px;
    color: var(--white);
    background: var(--primary);
    font-weight: 800;
    cursor: pointer;
    transition: 0.2s;
}

.button:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.button.secondary {
    border: 1px solid var(--border);
    color: var(--dark);
    background: var(--white);
}

.button.secondary:hover {
    color: var(--primary);
    border-color: #bfdbfe;
    background: var(--primary-soft);
}

.button.green {
    background: var(--green);
}

.button.green:hover {
    background: var(--green-dark);
}

.button.red {
    background: var(--red);
}

.button.red:hover {
    background: var(--red-dark);
}

/* შესვლა და რეგისტრაცია */

.auth-page {
    min-height: 100vh;
    background:
        radial-gradient(
            circle at 90% 10%,
            rgba(255, 255, 255, 0.22),
            transparent 26%
        ),
        radial-gradient(
            circle at 10% 85%,
            rgba(255, 255, 255, 0.12),
            transparent 30%
        ),
        linear-gradient(
            135deg,
            #1e3a8a,
            #2563eb 55%,
            #60a5fa
        );
}

.auth-main {
    min-height: calc(100vh - 78px);
    display: grid;
    place-items: center;
    padding: 44px 18px;
}

.auth-card {
    width: min(100%, 510px);
    padding: 34px;
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.22);
}

.auth-icon {
    width: 68px;
    height: 68px;
    margin: 0 auto 18px;
    display: grid;
    place-items: center;
    border-radius: 20px;
    color: var(--white);
    background: linear-gradient(
        135deg,
        var(--primary),
        #60a5fa
    );
    box-shadow: 0 12px 30px rgba(37, 99, 235, 0.28);
}

.auth-icon svg {
    width: 33px;
    height: 33px;
}

.auth-title {
    margin: 0 0 8px;
    text-align: center;
    color: var(--dark);
    font-size: 31px;
}

.auth-subtitle {
    margin: 0 0 25px;
    text-align: center;
    color: var(--gray);
    line-height: 1.55;
}

.message {
    margin-bottom: 18px;
    padding: 13px 15px;
    border-radius: 11px;
    font-weight: 700;
    line-height: 1.45;
}

.message.error {
    border: 1px solid #fecaca;
    color: #991b1b;
    background: #fee2e2;
}

.message.success {
    border: 1px solid #86efac;
    color: #166534;
    background: #dcfce7;
}

.form-group {
    margin-bottom: 17px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    color: var(--dark);
    font-size: 14px;
    font-weight: 800;
}

.input-wrap {
    position: relative;
}

.form-control {
    width: 100%;
    min-height: 53px;
    padding: 0 14px;
    border: 1px solid #d8dee8;
    border-radius: 12px;
    color: var(--dark);
    background: #f8fafc;
    font-size: 15px;
    transition: 0.2s;
}

.form-control.with-icon {
    padding-left: 47px;
}

.form-control.with-eye {
    padding-right: 52px;
}

textarea.form-control {
    min-height: 115px;
    padding-top: 13px;
    resize: vertical;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--white);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.11);
}

.input-icon {
    position: absolute;
    top: 50%;
    left: 15px;
    width: 21px;
    height: 21px;
    transform: translateY(-50%);
    color: var(--gray);
    pointer-events: none;
}

.eye-button {
    position: absolute;
    top: 50%;
    right: 7px;
    width: 41px;
    height: 41px;
    display: grid;
    place-items: center;
    transform: translateY(-50%);
    border: none;
    border-radius: 9px;
    color: var(--gray);
    background: transparent;
    cursor: pointer;
}

.eye-button:hover {
    color: var(--primary);
    background: var(--primary-soft);
}

.eye-button svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.full-button {
    width: 100%;
    min-height: 54px;
    margin-top: 4px;
    border: none;
    border-radius: 12px;
    color: var(--white);
    background: linear-gradient(
        135deg,
        var(--primary),
        #3b82f6
    );
    font-size: 16px;
    font-weight: 900;
    cursor: pointer;
    transition: 0.2s;
}

.full-button:hover {
    background: linear-gradient(
        135deg,
        var(--primary-dark),
        var(--primary)
    );
    transform: translateY(-1px);
}

.full-button.green {
    background: linear-gradient(
        135deg,
        var(--green),
        #22c55e
    );
}

.full-button.green:hover {
    background: linear-gradient(
        135deg,
        var(--green-dark),
        var(--green)
    );
}

.auth-bottom {
    margin-top: 21px;
    text-align: center;
    color: var(--gray);
}

.auth-bottom a {
    color: var(--primary);
    font-weight: 800;
}

/* პროფილი და ადმინისტრატორი */

.dashboard-hero {
    padding: 46px 0 76px;
    color: var(--white);
    background:
        radial-gradient(
            circle at 88% 20%,
            rgba(255, 255, 255, 0.20),
            transparent 28%
        ),
        linear-gradient(
            135deg,
            #1e40af,
            #2563eb
        );
}

.dashboard-hero-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 25px;
}

.dashboard-hero h1 {
    margin: 0 0 10px;
    font-size: clamp(35px, 5vw, 50px);
}

.dashboard-hero p {
    max-width: 680px;
    margin: 0;
    color: #dbeafe;
    font-size: 18px;
    line-height: 1.6;
}

.user-chip {
    min-width: 220px;
    padding: 17px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.12);
}

.user-chip small {
    display: block;
    margin-bottom: 5px;
    color: #bfdbfe;
}

.user-chip strong {
    font-size: 19px;
}

.stats {
    position: relative;
    z-index: 5;
    margin-top: -41px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 17px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 15px;
    min-height: 112px;
    padding: 21px;
    border: 1px solid var(--border);
    border-radius: 17px;
    background: var(--white);
    box-shadow: var(--shadow);
}

.stat-icon {
    width: 57px;
    height: 57px;
    flex: 0 0 57px;
    display: grid;
    place-items: center;
    border-radius: 15px;
    background: var(--primary-soft);
    font-size: 26px;
}

.stat-card small {
    display: block;
    margin-bottom: 5px;
    color: var(--gray);
    font-weight: 700;
}

.stat-card strong {
    color: var(--dark);
    font-size: 24px;
}

.page-main {
    padding: 34px 0 70px;
}

.panel {
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--white);
    box-shadow: 0 8px 28px rgba(17, 24, 39, 0.05);
}

.panel-head {
    padding: 22px 23px;
    border-bottom: 1px solid var(--border);
}

.panel-head h2 {
    margin: 0 0 6px;
    color: var(--dark);
    font-size: 23px;
}

.panel-head p {
    margin: 0;
    color: var(--gray);
    line-height: 1.5;
}

.panel-body {
    padding: 23px;
}

.admin-grid {
    display: grid;
    grid-template-columns: 410px minmax(0, 1fr);
    gap: 23px;
    align-items: start;
}

.product-list {
    display: grid;
    gap: 14px;
}

.product-row {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    transition: 0.2s;
}

.product-row:hover {
    border-color: #bfdbfe;
    box-shadow: 0 8px 22px rgba(37, 99, 235, 0.07);
}

.product-image {
    width: 120px;
    height: 95px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 12px;
    background: linear-gradient(
        135deg,
        #dbeafe,
        #eff6ff
    );
    font-size: 40px;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-category {
    display: inline-block;
    margin-bottom: 7px;
    padding: 5px 9px;
    border-radius: 999px;
    color: var(--primary-dark);
    background: var(--primary-soft);
    font-size: 12px;
    font-weight: 800;
}

.product-row h3 {
    margin: 0 0 7px;
    overflow: hidden;
    color: var(--dark);
    font-size: 18px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 13px;
    margin-bottom: 7px;
    color: var(--gray);
    font-size: 13px;
}

.product-price {
    color: var(--primary);
    font-size: 21px;
    font-weight: 900;
}

.delete-button {
    min-width: 88px;
    min-height: 42px;
    border: none;
    border-radius: 9px;
    color: var(--white);
    background: var(--red);
    font-weight: 800;
    cursor: pointer;
}

.delete-button:hover {
    background: var(--red-dark);
}

.empty-box {
    padding: 56px 20px;
    border: 1px dashed #cbd5e1;
    border-radius: 14px;
    text-align: center;
    color: var(--gray);
    background: #f8fafc;
}

.empty-box strong {
    display: block;
    margin-bottom: 7px;
    color: var(--dark);
    font-size: 20px;
}

.profile-grid {
    display: grid;
    grid-template-columns: 310px minmax(0, 1fr);
    gap: 23px;
    align-items: start;
}

.profile-card {
    padding: 27px;
    text-align: center;
}

.avatar {
    width: 94px;
    height: 94px;
    margin: 0 auto 16px;
    display: grid;
    place-items: center;
    border-radius: 28px;
    color: var(--white);
    background: linear-gradient(
        135deg,
        var(--primary),
        #60a5fa
    );
    font-size: 40px;
    font-weight: 900;
}

.role-badge {
    display: inline-flex;
    margin-top: 7px;
    padding: 7px 11px;
    border-radius: 999px;
    color: #166534;
    background: #dcfce7;
    font-size: 13px;
    font-weight: 800;
}

.info-list {
    display: grid;
    gap: 13px;
}

.info-row {
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #f8fafc;
}

.info-row small {
    display: block;
    margin-bottom: 5px;
    color: var(--gray);
    font-weight: 700;
}

.info-row strong {
    color: var(--dark);
}

.notice {
    margin-top: 17px;
    padding: 17px;
    border: 1px solid #bfdbfe;
    border-radius: 13px;
    color: #1e3a8a;
    background: var(--primary-soft);
    line-height: 1.6;
}

/* ქვედა ნაწილი */

.site-footer {
    padding: 29px 0;
    color: #cbd5e1;
    background: #111827;
}

.footer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.footer-brand {
    color: var(--white);
    font-size: 22px;
    font-weight: 900;
}

/* მობილური */

@media (max-width: 980px) {
    .admin-grid,
    .profile-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stats-grid .stat-card:last-child {
        grid-column: 1 / -1;
    }
}

@media (max-width: 700px) {
    .header-row {
        min-height: auto;
        align-items: flex-start;
        flex-direction: column;
        padding: 15px 0;
    }

    .brand {
        font-size: 26px;
    }

    .header-actions {
        width: 100%;
    }

    .header-actions .button {
        flex: 1;
        padding: 0 11px;
        font-size: 14px;
    }

    .dashboard-hero-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .user-chip {
        width: 100%;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid .stat-card:last-child {
        grid-column: auto;
    }

    .product-row {
        grid-template-columns: 88px minmax(0, 1fr);
    }

    .product-image {
        width: 88px;
        height: 76px;
    }

    .product-row form {
        grid-column: 1 / -1;
    }

    .delete-button {
        width: 100%;
    }

    .auth-card {
        padding: 27px 20px;
    }

    .footer-row {
        flex-direction: column;
        text-align: center;
    }
}