/* ==================== RESET & DESIGN TOKENS ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #5C72B5;
    --primary-dark: #394D8C;
    --primary-soft: rgba(92, 114, 181, 0.12);
    --cream: #F5E6D3;
    --cream-light: #fff7ed;
    --text: #2f2d2b;
    --muted: #746f69;
    --line: rgba(92, 74, 55, 0.13);
    --card: rgba(255, 255, 255, 0.88);
    --shadow: 0 24px 70px rgba(52, 42, 28, 0.16);
    --radius-lg: 28px;
    --radius-md: 18px;
    --radius-sm: 12px;
    --gold: #f5b83f;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    overflow-x: hidden;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    color: var(--text);
    line-height: 1.6;
    background:
        radial-gradient(circle at top left, rgba(245, 230, 211, 0.95), transparent 34rem),
        radial-gradient(circle at top right, rgba(92, 114, 181, 0.45), transparent 32rem),
        linear-gradient(135deg, #fff8ef 0%, #e9d7bf 45%, #7182bd 100%);
    background-attachment: fixed;
}

body::before,
body::after {
    content: "";
    position: fixed;
    pointer-events: none;
    border-radius: 999px;
    filter: blur(4px);
    opacity: 0.6;
    z-index: -1;
}

body::before {
    width: 24rem;
    height: 24rem;
    left: -10rem;
    bottom: -7rem;
    background: rgba(92, 114, 181, 0.18);
}

body::after {
    width: 18rem;
    height: 18rem;
    right: -8rem;
    top: 12rem;
    background: rgba(255, 255, 255, 0.28);
}

button,
select,
input,
textarea {
    font: inherit;
}

/* ==================== SHARED ==================== */
.divider {
    height: 1px;
    margin: 1.35rem 0;
    background: linear-gradient(90deg, transparent, rgba(92, 114, 181, 0.26), transparent);
}

.admin-access,
.back-home {
    text-decoration: none;
}

.admin-access {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 50;
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .72rem 1rem;
    border: 1px solid rgba(255,255,255,.48);
    border-radius: 999px;
    color: #fff;
    font-size: .84rem;
    font-weight: 800;
    letter-spacing: .02em;
    background: rgba(57, 77, 140, .72);
    box-shadow: 0 12px 32px rgba(57, 77, 140, .24);
    backdrop-filter: blur(14px);
    transition: .25s ease;
}

.admin-access::before {
    content: "⚙";
}

.admin-access:hover {
    transform: translateY(-2px);
    background: rgba(57, 77, 140, .9);
}

/* ==================== INDEX PAGE ==================== */
.container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.header {
    position: relative;
    padding: clamp(2rem, 6vw, 4.2rem) 1.25rem 1.5rem;
    text-align: center;
}

.header-content {
    width: min(100%, 680px);
    margin: 0 auto;
    padding: 1.25rem;
    border: 1px solid rgba(255,255,255,.42);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, .32);
    box-shadow: 0 14px 42px rgba(44, 44, 44, .08);
    backdrop-filter: blur(16px);
    animation: slideDown .55s ease both;
}

.brand-logo {
    display: block;
    width: clamp(112px, 22vw, 165px);
    height: auto;
    margin: 0 auto 1rem;
    object-fit: contain;
    border-radius: 22px;
    background: rgba(92, 114, 181, 0.15);
    padding: .55rem;
    box-shadow: 0 18px 45px rgba(92, 74, 55, .16);
}

.logo {
    font-size: clamp(2rem, 7vw, 3.8rem);
    line-height: 1;
    color: var(--primary-dark);
    font-weight: 900;
    letter-spacing: -0.06em;
}

.subtitle {
    margin-top: .75rem;
    color: var(--muted);
    font-weight: 650;
    font-size: clamp(.95rem, 2vw, 1.08rem);
}

.main-content {
    flex: 1;
    width: min(100%, 1100px);
    margin: 0 auto;
    display: grid;
    place-items: start center;
    gap: 1rem;
    padding: 1rem clamp(1rem, 3vw, 2rem) 2rem;
}

.card {
    width: min(100%, 590px);
    border: 1px solid rgba(255,255,255,.62);
    border-radius: var(--radius-lg);
    background: var(--card);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
    animation: fadeInUp .7s ease both;
}

.evaluation-card {
    padding: clamp(1.25rem, 4vw, 2.5rem);
}

.rating-section {
    text-align: center;
}

.rating-section h2 {
    color: var(--primary-dark);
    font-size: clamp(1.45rem, 4.5vw, 2.1rem);
    line-height: 1.15;
    font-weight: 900;
    letter-spacing: -0.04em;
    margin-bottom: 1.1rem;
}

.stars-container {
    display: flex;
    justify-content: center;
    gap: clamp(.35rem, 2vw, .8rem);
    margin-bottom: .65rem;
}

.star {
    width: clamp(2.7rem, 13vw, 4.25rem);
    height: clamp(2.7rem, 13vw, 4.25rem);
    display: grid;
    place-items: center;
    border: 1px solid rgba(92, 114, 181, .12);
    border-radius: 18px;
    background: linear-gradient(180deg, #fff, rgba(255,255,255,.62));
    box-shadow: 0 10px 20px rgba(92, 74, 55, .08);
    color: #d9d2c9;
    font-size: clamp(1.65rem, 7vw, 2.7rem);
    line-height: 1;
    cursor: pointer;
    transition: transform .22s ease, color .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.star:hover,
.star.active {
    color: var(--gold) !important;
    border-color: rgba(245, 184, 63, .35);
    transform: translateY(-3px) scale(1.04);
    box-shadow: 0 14px 26px rgba(245, 184, 63, .19);
}

.rating-text {
    min-height: 1.6rem;
    color: var(--muted);
    font-weight: 750;
    font-size: .95rem;
}

.comment-section,
.name-section,
.area-section {
    margin-top: 1.2rem;
}

.label {
    display: flex;
    align-items: center;
    gap: .45rem;
    margin-bottom: .55rem;
    color: var(--primary-dark);
    font-size: .78rem;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.label::before {
    content: "";
    width: .5rem;
    height: .5rem;
    border-radius: 999px;
    background: var(--primary);
    box-shadow: 0 0 0 5px var(--primary-soft);
}

.textarea,
.input,
.sort-select {
    width: 100%;
    border: 1px solid rgba(92, 114, 181, .18);
    border-radius: 16px;
    background: rgba(255,255,255,.78);
    color: var(--text);
    padding: 1rem 1.05rem;
    font-size: 1rem;
    outline: none;
    transition: border-color .22s ease, box-shadow .22s ease, background .22s ease, transform .22s ease;
}

.textarea::placeholder,
.input::placeholder {
    color: #aaa29a;
}

.textarea:focus,
.input:focus,
.sort-select:focus {
    border-color: rgba(92, 114, 181, .65);
    background: #fff;
    box-shadow: 0 0 0 5px rgba(92, 114, 181, .12);
    transform: translateY(-1px);
}

.textarea {
    min-height: 118px;
    resize: vertical;
}

.char-count {
    margin-top: .35rem;
    text-align: right;
    color: var(--muted);
    font-size: .78rem;
    font-weight: 700;
}

.button-group {
    display: grid;
    grid-template-columns: 1.35fr .8fr;
    gap: .9rem;
    margin-top: 1.6rem;
}

.btn {
    border: 0;
    border-radius: 16px;
    padding: 1rem 1.25rem;
    cursor: pointer;
    font-weight: 900;
    letter-spacing: .02em;
    transition: transform .22s ease, box-shadow .22s ease, opacity .22s ease;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn-primary {
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    box-shadow: 0 18px 34px rgba(57, 77, 140, .28);
}

.btn-secondary {
    color: var(--primary-dark);
    background: rgba(92, 114, 181, .1);
    border: 1px solid rgba(92, 114, 181, .18);
}

.success-message {
    display: none;
    align-items: center;
    gap: .7rem;
    margin-top: 1rem;
    padding: .9rem 1rem;
    border-radius: 16px;
    color: #1f6845;
    font-weight: 800;
    background: rgba(39, 174, 96, .12);
    border: 1px solid rgba(39, 174, 96, .22);
}

.success-message.show {
    display: flex;
    animation: fadeInUp .28s ease both;
}

.success-icon {
    width: 1.8rem;
    height: 1.8rem;
    display: grid;
    place-items: center;
    border-radius: 999px;
    color: white;
    background: #27ae60;
}

.info-box {
    width: min(100%, 590px);
    padding: 1rem 1.2rem;
    border: 1px solid rgba(255,255,255,.52);
    border-radius: 20px;
    text-align: center;
    color: #625b54;
    font-weight: 700;
    background: rgba(255,255,255,.45);
    backdrop-filter: blur(14px);
}

.footer {
    padding: 1rem;
    text-align: center;
    color: rgba(47,45,43,.66);
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .06em;
}

/* ==================== ADMIN PAGE ==================== */
.admin-page {
    background:
        radial-gradient(circle at 18% 10%, rgba(245, 230, 211, .9), transparent 28rem),
        radial-gradient(circle at 90% 0%, rgba(92, 114, 181, .36), transparent 34rem),
        #f7efe5;
}

.admin-container {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 310px minmax(0, 1fr);
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    padding: 1.25rem;
    border-right: 1px solid rgba(92, 114, 181, .12);
    background: rgba(255,255,255,.62);
    backdrop-filter: blur(18px);
}

.sidebar-header {
    text-align: center;
    padding: .75rem .5rem 1.25rem;
}

.sidebar-logo {
    width: 116px;
    margin-bottom: .75rem;
}

.admin-logo {
    color: var(--primary-dark);
    font-size: 1.55rem;
    font-weight: 950;
    letter-spacing: -0.04em;
}

.admin-subtitle {
    color: var(--muted);
    font-size: .88rem;
    font-weight: 750;
}

.sidebar-nav {
    display: grid;
    gap: .55rem;
}

.nav-item,
.btn-logout,
.back-home,
.admin-pill {
    border-radius: 15px;
}

.nav-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: .65rem;
    border: 1px solid transparent;
    padding: .84rem .95rem;
    cursor: pointer;
    color: #4e4a45;
    text-align: left;
    font-weight: 800;
    background: transparent;
    transition: .22s ease;
}

.nav-item:hover,
.nav-item.active {
    color: var(--primary-dark);
    border-color: rgba(92, 114, 181, .18);
    background: rgba(92, 114, 181, .1);
    transform: translateX(3px);
}

.nav-icon {
    width: 1.35rem;
    text-align: center;
}

.area-filters {
    margin-top: 1.5rem;
    padding-top: 1.2rem;
    border-top: 1px solid var(--line);
}

.filter-title {
    margin-bottom: .7rem;
    color: var(--primary-dark);
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .1em;
}

.sidebar-footer {
    margin-top: 1.3rem;
}

.btn-logout {
    width: 100%;
    padding: .9rem 1rem;
    border: 1px solid rgba(180, 68, 68, .2);
    color: #8b2f2f;
    font-weight: 900;
    cursor: pointer;
    background: rgba(180, 68, 68, .08);
}

.admin-main {
    min-width: 0;
    padding: clamp(1rem, 3vw, 2rem);
}

.admin-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.2rem;
}

.back-home,
.admin-pill {
    display: inline-flex;
    align-items: center;
    padding: .72rem 1rem;
    font-size: .88rem;
    font-weight: 850;
}

.back-home {
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    box-shadow: 0 14px 30px rgba(57, 77, 140, .22);
}

.admin-pill {
    color: var(--primary-dark);
    background: rgba(255,255,255,.58);
    border: 1px solid rgba(255,255,255,.7);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.stat-card,
.chart-section,
.evaluations-section,
.modal-content {
    border: 1px solid rgba(255,255,255,.65);
    background: rgba(255,255,255,.72);
    box-shadow: 0 18px 50px rgba(52, 42, 28, .1);
    backdrop-filter: blur(16px);
}

.stat-card {
    padding: 1.2rem;
    border-radius: 22px;
}

.stat-card h3 {
    min-height: 2.4rem;
    color: var(--muted);
    font-size: .82rem;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.stat-number {
    color: var(--primary-dark);
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1;
    font-weight: 950;
    letter-spacing: -0.06em;
    margin-top: .45rem;
}

.chart-section,
.evaluations-section {
    margin-top: 1rem;
    padding: clamp(1rem, 2.6vw, 1.5rem);
    border-radius: 24px;
}

.chart-section h2,
.section-header h2 {
    color: var(--primary-dark);
    font-size: clamp(1.25rem, 3vw, 1.75rem);
    font-weight: 950;
    letter-spacing: -0.04em;
}

.chart-container {
    display: grid;
    gap: .9rem;
    margin-top: 1.2rem;
}

.chart-bar {
    display: grid;
    grid-template-columns: 60px minmax(0, 1fr) 42px;
    gap: .8rem;
    align-items: center;
}

.bar-label,
.bar-count {
    color: #5a544e;
    font-weight: 900;
}

.bar-track {
    height: 13px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(92, 114, 181, .11);
}

.bar-fill {
    height: 100%;
    width: 0%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--primary), var(--gold));
    transition: width .35s ease;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.sort-control {
    min-width: min(100%, 250px);
}

.sort-select {
    padding: .78rem .9rem;
}

.evaluations-list {
    display: grid;
    gap: .8rem;
}

.evaluation-item {
    padding: 1rem;
    border: 1px solid rgba(92, 114, 181, .12);
    border-radius: 18px;
    cursor: pointer;
    background: rgba(255,255,255,.62);
    transition: .22s ease;
}

.evaluation-item:hover {
    transform: translateY(-2px);
    border-color: rgba(92, 114, 181, .25);
    box-shadow: 0 14px 32px rgba(52, 42, 28, .08);
}

.eval-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: .35rem;
}

.eval-name {
    color: var(--primary-dark);
    font-weight: 950;
}

.eval-date,
.eval-area {
    color: var(--muted);
    font-size: .88rem;
    font-weight: 750;
}

.eval-stars {
    margin: .4rem 0;
    color: var(--gold);
    font-size: 1.15rem;
    letter-spacing: .05em;
}

.eval-comment {
    color: #625b54;
    font-weight: 650;
}

.empty-state {
    padding: 2.5rem 1rem;
    text-align: center;
    color: var(--muted);
    font-weight: 850;
    border: 1px dashed rgba(92, 114, 181, .22);
    border-radius: 18px;
    background: rgba(255,255,255,.38);
}

.modal {
    position: fixed;
    inset: 0;
    display: none;
    place-items: center;
    padding: 1rem;
    background: rgba(36, 31, 26, .45);
    backdrop-filter: blur(8px);
    z-index: 100;
}

.modal.show {
    display: grid;
}

.modal-content {
    position: relative;
    width: min(100%, 560px);
    max-height: 86vh;
    overflow-y: auto;
    padding: 1.5rem;
    border-radius: 24px;
}

.modal-close {
    position: absolute;
    top: .8rem;
    right: .8rem;
    width: 2.3rem;
    height: 2.3rem;
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    color: var(--primary-dark);
    background: rgba(92, 114, 181, .1);
    font-weight: 950;
}

/* ==================== ANIMATIONS & RESPONSIVE ==================== */
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-18px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 980px) {
    .admin-container {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: relative;
        height: auto;
        border-right: 0;
        border-bottom: 1px solid rgba(92, 114, 181, .12);
    }

    .sidebar-nav {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .admin-access {
        top: auto;
        right: 1rem;
        bottom: 1rem;
        padding: .8rem 1rem;
    }

    .header {
        padding-top: 1rem;
    }

    .header-content {
        padding: 1rem;
    }

    .button-group,
    .stats-grid,
    .sidebar-nav {
        grid-template-columns: 1fr;
    }

    .section-header,
    .admin-topbar,
    .eval-header {
        align-items: stretch;
        flex-direction: column;
    }

    .chart-bar {
        grid-template-columns: 52px minmax(0, 1fr) 34px;
        gap: .55rem;
    }

    .admin-main,
    .sidebar {
        padding: 1rem;
    }
}

@media (max-width: 390px) {
    .star {
        border-radius: 14px;
    }

    .evaluation-card {
        padding: 1rem;
    }
}
