﻿:root {
    --bg: #0c0d10;
    --panel: #161922;
    --panel2: #1f2330;
    --text: #f5f5f7;
    --muted: #aeb4c0;
    --gold: #d0a63c;
    --gold-dark: #9f7d2f;
    --line: #2d3340;
    --danger: #c0392b;
    --green: #2ecc71;
    --white: #ffffff;
    --black: #0f1115;
    --radius: 14px;
    --shadow: 0 10px 30px rgba(0,0,0,.22);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', Arial, Helvetica, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

/* =========================
   LAYOUT
========================= */

.admin-layout {
    display: block;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    min-height: 100vh;
    background:
        radial-gradient(circle at top, rgba(208,166,60,.14), transparent 34%),
        linear-gradient(180deg, #12151d 0%, #090a0d 100%);
    color: var(--white);
    position: fixed;
    top: 0;
    left: 0;
    padding: 22px 16px;
    border-right: 1px solid rgba(208,166,60,.18);
    box-shadow: 10px 0 34px rgba(0,0,0,.32);
    z-index: 1000;
}

.main {
    margin-left: 260px;
    width: calc(100% - 260px);
    min-height: 100vh;
    padding: 32px;
    display: flex;
    flex-direction: column;
}

/* =========================
   BRAND
========================= */

.brand-wrap {
    text-align: center;
    padding: 12px 10px 22px;
    margin-bottom: 16px;
    min-height: 200px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.sidebar-logo {
    width: 140px;
    height: 140px;
    margin: 0 auto 12px;
    background-image: url('/assets/images/matretis.png');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    filter: drop-shadow(0 8px 16px rgba(0,0,0,.42));
}

.brand-text {
    font-size: 18px;
    font-weight: 900;
    letter-spacing: 2.4px;
    color: var(--gold);
    text-transform: uppercase;
}

.brand-subtitle {
    margin-top: 4px;
    font-size: 11px;
    color: rgba(255,255,255,.52);
    letter-spacing: 1.4px;
    text-transform: uppercase;
}

/* =========================
   NAVIGATION
========================= */

.sidebar nav {
    margin-top: 18px;
}

.nav-section {
    margin: 18px 10px 7px;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .16em;
    color: rgba(255,255,255,.42);
}

.sidebar nav a {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    margin-bottom: 6px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    color: rgba(255,255,255,.72);
    transition: all .18s ease;
}

.sidebar nav a::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,.3);
    flex: 0 0 auto;
}

.sidebar nav a:hover {
    color: #fff;
    background: rgba(255,255,255,.06);
    transform: translateX(4px);
}

.sidebar nav a:hover::before {
    background: var(--gold);
}

.sidebar nav a.active {
    color: #111;
    background: linear-gradient(135deg, var(--gold), #f0cf72);
    box-shadow: 0 10px 24px rgba(0,0,0,.28);
}

.sidebar nav a.active::before {
    background: #111;
}

.sidebar nav a.active::after {
    content: "";
    position: absolute;
    right: 10px;
    width: 6px;
    height: 18px;
    border-radius: 999px;
    background: rgba(0,0,0,.35);
}

/* =========================
   TOPBAR
========================= */

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 26px;
}

.topbar h1 {
    margin: 0;
    font-size: 1.8rem;
}

/* =========================
   PANELS / CARDS
========================= */

.panel,
.card,
.admin-card,
.stat-card {
    padding: 24px;
    border-radius: 16px;
    background: linear-gradient(135deg, #161922, #1f2330);
    border: 1px solid var(--line);
    transition: transform .2s ease, box-shadow .2s ease;
}

.panel {
    margin-bottom: 24px;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0,0,0,.35);
}

/* =========================
   GRID
========================= */

.grid {
    display: grid;
    gap: 18px;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 28px;
}

/* =========================
   STATS
========================= */

.stat-label {
    color: var(--muted);
    font-size: .95rem;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--gold);
}

/* =========================
   BUTTONS
========================= */

.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 18px;
}

.btn,
button,
input[type=submit] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 16px;
    border-radius: 10px;
    font-weight: 700;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--text);
    cursor: pointer;
    transition: all .2s ease;
}

.btn:hover,
button:hover,
input[type=submit]:hover {
    opacity: .9;
    transform: translateY(-1px);
}

.btn-gold,
.btn-primary {
    background: var(--gold);
    border-color: var(--gold);
    color: #111;
}

.btn-dark {
    background: #111318;
    color: #fff;
}

.btn-danger {
    background: #5a1a1a;
    color: #ffb4b4;
    border: 1px solid #7a2a2a;
}

/* =========================
   TABLES
========================= */

.table,
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
}

th,
td {
    border-bottom: 1px solid var(--line);
    padding: 12px;
    text-align: left;
}

th {
    color: var(--gold);
    font-size: .9rem;
    text-transform: uppercase;
    letter-spacing: .04em;
}

tr:hover td {
    background: rgba(208,166,60,.06);
}

/* =========================
   FORMS
========================= */

label {
    display: block;
    font-weight: 700;
    margin-bottom: 6px;
    font-size: 14px;
}

input,
select,
textarea {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #10131a;
    color: var(--text);
}

select,
select option {
    color: #111;
    background: #fff;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(208,166,60,.18);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}

/* =========================
   SEARCH RESULTS
========================= */

.search-results {
    margin-top: 6px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #0f1117;
    display: none;
    max-height: 260px;
    overflow-y: auto;
}

.search-result-item {
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid var(--line);
}

.search-result-item:hover {
    background: rgba(255,255,255,.06);
}

.search-result-item strong {
    display: block;
}

/* =========================
   UTILITIES
========================= */
.action-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.action-menu-wrap {
    position: relative;
}

.action-menu-btn {
    width: 42px;
    padding: 0;
    font-size: 18px;
    line-height: 1;
}
.action-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 110%;
    background: #111318;
    border: 1px solid var(--line);
    border-radius: 10px;
    min-width: 180px;
    box-shadow: 0 12px 30px rgba(0,0,0,.35);
    z-index: 100;
}

.action-menu a {
    display: block;
    padding: 10px 12px;
    font-size: .9rem;
    color: var(--text);
}

.action-menu a:hover {
    background: rgba(255,255,255,.06);
}

/* SHOW MENU */
.action-menu-wrap:hover .action-menu {
    display: block;
}
.muted {
    color: var(--muted);
}

.status-active {
    color: var(--green);
    font-weight: 700;
}

.status-inactive {
    color: var(--danger);
    font-weight: 700;
}

.association-list {
    display: grid;
    gap: 10px;
    margin-top: 10px;
}

.association-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,.03);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px 12px;
    cursor: pointer;
}

.association-row input[type=checkbox] {
    width: auto;
    min-height: auto;
}

.association-row span {
    font-weight: 700;
}

/* =========================
   FOOTER
========================= */

.footer {
    margin-top: auto;
    border-top: 1px solid rgba(255,255,255,.08);
    padding: 16px 20px 0;
    text-align: center;
    font-size: 13px;
    color: #888;
}

.footer-inner {
    opacity: 0.8;
    padding-top: 14px;
}

.footer-sep {
    margin: 0 8px;
    opacity: 0.4;
}

/* =========================
   RESPONSIVE
========================= */

@media (max-width: 1100px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 900px) {
    .sidebar {
        width: 220px;
    }

    .main {
        margin-left: 220px;
        width: calc(100% - 220px);
    }

    .sidebar-logo {
        width: 118px;
        height: 118px;
    }

    .brand-wrap {
        min-height: 178px;
    }
}

@media (max-width: 700px) {
    .sidebar {
        position: relative;
        width: 100%;
        min-height: auto;
    }

    .main {
        margin-left: 0;
        width: 100%;
        padding: 22px;
    }

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

    .topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
    }
}