:root {
    --black: #070707;
    --panel: #11110f;
    --gold: #dfb34f;
    --text: #f4f0e8;
    --muted: #a9a59b;
    --green: #58c873;
}

* { box-sizing: border-box; }

html {
    min-height: 100%;
    background: var(--black);
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--text);
    background:
        radial-gradient(circle at 50% 0%, #242018 0%, #0c0c0b 38%, #050505 75%);
    font-family: Arial, Helvetica, sans-serif;
}

button, input { font: inherit; }

.login-page {
    display: grid;
    place-items: center;
    padding: 30px 18px;
}

.login-card {
    width: min(520px, 100%);
    padding: 42px 44px;
    text-align: center;
    border: 1px solid rgba(223, 179, 79, 0.42);
    border-radius: 24px;
    background: linear-gradient(145deg, rgba(25,24,21,.98), rgba(7,7,7,.99));
    box-shadow: 0 35px 100px rgba(0,0,0,.65);
}

.login-monogram, .brand-monogram {
    display: grid;
    place-items: center;
    border: 1px solid var(--gold);
    border-radius: 50%;
    color: var(--gold);
    font-family: Georgia, serif;
}

.login-monogram {
    width: 78px;
    height: 78px;
    margin: 0 auto 20px;
    font-size: 31px;
}

.login-card h1 {
    margin: 0;
    color: var(--gold);
    font-family: Georgia, serif;
    font-size: clamp(36px, 8vw, 54px);
    font-weight: 400;
}

.mission, .brand-mission {
    color: var(--gold);
    font-family: Georgia, serif;
    letter-spacing: 3px;
}

.mission {
    margin: 14px 0 10px;
    font-size: 11px;
}

.login-signature {
    width: min(330px, 85%);
    margin: 8px auto 0;
}

.gold-line {
    height: 1px;
    margin: 24px 0 28px;
    background: linear-gradient(90deg, transparent, rgba(223,179,79,.8), transparent);
}

.login-card h2 {
    margin: 0 0 23px;
    font-family: Georgia, serif;
    font-weight: 400;
}

.login-form {
    display: grid;
    gap: 10px;
    text-align: left;
}

.login-form label {
    margin-top: 4px;
    color: #d9d4ca;
    font-size: 13px;
}

.login-form input {
    width: 100%;
    padding: 14px 15px;
    border: 1px solid #403a2b;
    border-radius: 10px;
    outline: none;
    color: var(--text);
    background: #0c0c0b;
}

.login-form input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(223,179,79,.1);
}

.login-form button {
    margin-top: 14px;
    padding: 15px;
    border: 0;
    border-radius: 11px;
    cursor: pointer;
    color: #171107;
    background: linear-gradient(135deg, #f1c865, #c58f26);
    font-family: Georgia, serif;
    font-size: 18px;
}

.login-error {
    margin-bottom: 17px;
    padding: 11px;
    border: 1px solid rgba(217,88,88,.45);
    border-radius: 9px;
    color: #ffaaaa;
    background: rgba(217,88,88,.08);
    font-size: 14px;
}

.secure-note {
    margin: 25px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.dashboard-page { background: #070707; }

.topbar {
    min-height: 124px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 30px;
    border-bottom: 1px solid #302614;
    background: linear-gradient(90deg, #090909, #11110f, #080808);
}

.brand {
    display: flex;
    align-items: center;
    gap: 15px;
}

.brand-monogram {
    width: 67px;
    height: 67px;
    flex: 0 0 auto;
    font-size: 26px;
}

.brand-name {
    color: var(--gold);
    font-family: Georgia, serif;
    font-size: 29px;
}

.brand-mission {
    margin-top: 3px;
    font-size: 8px;
}

.brand-signature {
    display: block;
    width: 154px;
    margin-top: 4px;
}

.admin-area {
    display: flex;
    align-items: center;
    gap: 17px;
    color: #ddd8ce;
}

.logout-button {
    padding: 9px 13px;
    border: 1px solid #6f531e;
    border-radius: 8px;
    cursor: pointer;
    color: var(--gold);
    background: transparent;
}

.dashboard-layout {
    min-height: calc(100vh - 124px);
    display: grid;
    grid-template-columns: 275px 1fr;
}

.sidebar {
    padding: 21px 17px;
    border-right: 1px solid #302614;
    background: linear-gradient(180deg, #0d0d0c, #090909);
}

.nav-item {
    display: block;
    margin-bottom: 8px;
    padding: 16px 17px;
    border: 1px solid transparent;
    border-radius: 9px;
    color: #ddd9d0;
    text-decoration: none;
    font-family: Georgia, serif;
}

.nav-item:hover, .nav-item.active {
    border-color: #5f481b;
    color: var(--gold);
    background: linear-gradient(90deg, rgba(223,179,79,.12), transparent);
}

.admin-link {
    margin-top: 28px;
    border-color: #41351e;
}

.content {
    min-width: 0;
    padding: 28px;
    background: radial-gradient(circle at top right, #17140e 0%, #090909 35%, #070707 70%);
}

.welcome-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.welcome-row h1 {
    margin: 0;
    font-family: Georgia, serif;
    font-size: 36px;
    font-weight: 400;
}

.welcome-row p {
    margin: 8px 0 0;
    color: var(--muted);
}

.server-status {
    padding: 11px 16px;
    border: 1px solid #4a3a1c;
    border-radius: 999px;
    color: #d8d1c5;
    font-size: 13px;
}

.server-status span {
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: 8px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 10px var(--green);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(135px, 1fr));
    gap: 14px;
    margin-top: 25px;
}

.stat-card {
    min-height: 178px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 18px;
    border: 1px solid #4b3a19;
    border-radius: 15px;
    background: linear-gradient(145deg, #171612, #0e0e0d);
}

.stat-icon {
    margin-bottom: 12px;
    color: var(--gold);
    font-size: 28px;
}

.stat-card strong {
    font-family: Georgia, serif;
    font-size: 31px;
    font-weight: 400;
}

.stat-card span {
    margin-top: 8px;
    color: #c5c1b8;
    text-align: center;
    font-size: 13px;
}

.dashboard-panels {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(300px, .8fr);
    gap: 17px;
    margin-top: 17px;
}

.panel {
    min-height: 360px;
    padding: 20px;
    border: 1px solid #493818;
    border-radius: 15px;
    background: linear-gradient(145deg, #141411, #0c0c0b);
}

.panel-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 17px;
}

.panel-heading h2 {
    margin: 0;
    font-family: Georgia, serif;
    font-size: 21px;
    font-weight: 400;
}

.panel-heading span {
    color: var(--gold);
    font-size: 12px;
}

.empty-state {
    min-height: 270px;
    display: grid;
    place-content: center;
    text-align: center;
    color: var(--muted);
}

.empty-state.small { min-height: 250px; }

.empty-state h3 {
    margin: 12px 0 7px;
    color: #e0dcd2;
    font-family: Georgia, serif;
    font-weight: 400;
}

.empty-state p {
    max-width: 370px;
    margin: 0 auto;
    line-height: 1.55;
}

.empty-icon {
    width: 64px;
    height: 64px;
    display: grid;
    place-items: center;
    margin: auto;
    border: 1px solid var(--gold);
    border-radius: 50%;
    color: var(--gold);
    font-family: Georgia, serif;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.photo-placeholder {
    aspect-ratio: 4 / 3;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 12px;
    overflow: hidden;
    border: 1px solid #5c461b;
    border-radius: 11px;
    background: radial-gradient(circle at top, #49391e, #17130d 55%, #090909);
}

.photo-placeholder span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.photo-placeholder small {
    margin-top: 4px;
    color: var(--muted);
}

.device-list { display: grid; }

.device-row {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    padding: 17px 2px;
    border-bottom: 1px solid #2f2b22;
}

.device-row strong, .device-row small { display: block; }

.device-row small {
    margin-top: 5px;
    color: var(--muted);
}

.device-active {
    color: var(--green);
    font-size: 12px;
}

.bottom-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-top: 17px;
    padding: 19px 22px;
    border: 1px solid #493818;
    border-radius: 13px;
    background: #11110f;
}

.bottom-status strong, .bottom-status span { display: block; }

.bottom-status span {
    margin-top: 4px;
    color: var(--muted);
    font-size: 13px;
}

@media (max-width: 1050px) {
    .stats-grid { grid-template-columns: repeat(3, 1fr); }
    .dashboard-panels { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
    .topbar { align-items: flex-start; padding: 16px; }
    .brand-name { font-size: 23px; }
    .brand-mission, .brand-signature { display: none; }
    .admin-area > span { display: none; }
    .dashboard-layout { display: block; }
    .sidebar {
        display: flex;
        overflow-x: auto;
        border-right: 0;
        border-bottom: 1px solid #302614;
    }
    .nav-item {
        flex: 0 0 auto;
        margin: 0 6px 0 0;
        padding: 11px 13px;
    }
    .content { padding: 18px; }
    .welcome-row { align-items: flex-start; flex-direction: column; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .stat-card { min-height: 145px; }
    .photo-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 460px) {
    .login-card { padding: 31px 23px; }
    .stats-grid { grid-template-columns: 1fr; }
    .bottom-status { align-items: flex-start; flex-direction: column; }
}
