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

body {
    font-family: Arial, sans-serif;
    background: #050505;
    color: #f5f5f5;
}

.app {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 310px;
    background: #050505;
    border-right: 1px solid #202024;
    padding: 30px;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.logo-box h2 {
    color: #38bdf8;
    font-size: 28px;
    margin-bottom: 6px;
}

.logo-box p {
    color: #a1a1aa;
}

.side-menu {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.menu-btn {
    width: 100%;
    text-align: left;
    padding: 16px 20px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: linear-gradient(145deg, #0c0f16, #080b11);
    color: #f5f5f5;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease,
        background 0.2s ease;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.03),
        0 6px 18px rgba(0, 0, 0, 0.22);
}

.menu-btn:hover {
    transform: translateX(5px);
    border-color: rgba(56, 189, 248, 0.35);
    color: #38bdf8;
    box-shadow:
        0 10px 22px rgba(0, 0, 0, 0.3),
        0 0 18px rgba(56, 189, 248, 0.1);
}

.menu-btn.active {
    background: linear-gradient(135deg, #0f172a, #0b1220);
    border-color: rgba(56, 189, 248, 0.3);
    color: #38bdf8;
    box-shadow:
        0 10px 24px rgba(0, 0, 0, 0.3),
        0 0 20px rgba(37, 99, 235, 0.16);
}

.sidebar-footer {
    position: relative;
    background: linear-gradient(145deg, #111115, #0b0b0f);
    border: 1px solid rgba(255, 255, 255, 0.07);
    padding: 18px;
    border-radius: 18px;
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.03);
    overflow: hidden;
}

.sidebar-footer::before {
    content: "";
    position: absolute;
    top: 0;
    left: 18px;
    right: 18px;
    height: 2px;
    background: linear-gradient(90deg, #38bdf8, #2563eb);
    border-radius: 999px;
}

.sidebar-footer p {
    color: #a1a1aa;
    margin-bottom: 5px;
}

.sidebar-footer strong {
    color: #38bdf8;
}

.content {
    margin-left: 310px;
    width: calc(100% - 310px);
    padding: 24px;
}

.page-section {
    display: none;
}

.active-section {
    display: block;
}

.topbar,
.section-title {
    position: relative;
    background: linear-gradient(145deg, #111115, #0b0b0f);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 24px;
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.03);
    overflow: hidden;
}

.topbar::before,
.section-title::before {
    content: "";
    position: absolute;
    top: 0;
    left: 18px;
    right: 18px;
    height: 2px;
    background: linear-gradient(90deg, #38bdf8, #2563eb);
    border-radius: 999px;
}

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

.topbar h1 {
    font-size: 34px;
    color: #ffffff;
    margin-bottom: 8px;
}

.topbar p {
    color: #a1a1aa;
}

.system-box {
    background: #18181b;
    border: 1px solid #2a2a2e;
    padding: 14px 18px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: bold;
}

.status-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
}

.online {
    background: #22c55e;
    box-shadow: 0 0 12px #22c55e;
}

.offline {
    background: #ef4444;
    box-shadow: 0 0 12px #ef4444;
}

.section-title {
    padding: 24px;
    margin-bottom: 20px;
}

.section-title h2 {
    font-size: 30px;
    margin-bottom: 8px;
}

.section-title p {
    color: #a1a1aa;
}

.grid-top {
    display: grid;
    grid-template-columns: 1.4fr 0.9fr;
    gap: 20px;
    margin-bottom: 20px;
}

.side-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.card,
.stat-card {
    position: relative;
    background: linear-gradient(145deg, #101014, #0b0b0f);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 24px;
    padding: 24px;
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.03);
    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease,
        border-color 0.25s ease;
    overflow: hidden;
}

.card::before,
.stat-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 18px;
    right: 18px;
    height: 2px;
    background: linear-gradient(90deg, #38bdf8, #2563eb, #38bdf8);
    opacity: 0.85;
    border-radius: 999px;
}

.card:hover,
.stat-card:hover {
    transform: translateY(-4px);
    border-color: rgba(56, 189, 248, 0.28);
    box-shadow:
        0 16px 35px rgba(0, 0, 0, 0.45),
        0 0 0 1px rgba(56, 189, 248, 0.07),
        0 0 28px rgba(37, 99, 235, 0.12);
}

.large-card {
    min-height: 300px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.mini-title {
    color: #8b8b95;
    font-size: 13px;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.card h2 {
    font-size: 30px;
    color: #ffffff;
    margin-bottom: 10px;
}

.card h3 {
    font-size: 22px;
    color: #ffffff;
    margin-bottom: 10px;
}

.soft-text {
    color: #b5b5bd;
    line-height: 1.6;
    margin-bottom: 10px;
}

.door-icon {
    width: 78px;
    height: 78px;
    border-radius: 18px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 36px;
}

.locked {
    background: rgba(239, 68, 68, 0.15);
}

.unlocked {
    background: rgba(34, 197, 94, 0.15);
}

.rfid-panel {
    background: #0b1220;
    border: 1px solid #1f2937;
    border-radius: 18px;
    padding: 18px;
    margin-top: 18px;
    margin-bottom: 18px;
}

.rfid-panel span {
    display: block;
    color: #94a3b8;
    margin-bottom: 8px;
}

.rfid-panel strong {
    color: #38bdf8;
    font-size: 28px;
    letter-spacing: 3px;
}

.rfid-panel p {
    color: #cbd5e1;
    margin-top: 8px;
}

.button-row {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 18px;
}

button {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 14px 20px;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        border-color 0.2s ease,
        opacity 0.2s ease,
        background 0.2s ease;
    box-shadow:
        0 8px 18px rgba(37, 99, 235, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

button:hover {
    transform: translateY(-3px) scale(1.01);
    box-shadow:
        0 12px 24px rgba(37, 99, 235, 0.35),
        0 0 20px rgba(56, 189, 248, 0.15);
    border-color: rgba(255, 255, 255, 0.16);
}

button:active {
    transform: translateY(0) scale(0.98);
}

.btn-red {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    box-shadow:
        0 8px 18px rgba(239, 68, 68, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.btn-red:hover {
    box-shadow:
        0 12px 24px rgba(239, 68, 68, 0.35),
        0 0 20px rgba(239, 68, 68, 0.18);
}

.btn-green {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    box-shadow:
        0 8px 18px rgba(34, 197, 94, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.btn-green:hover {
    box-shadow:
        0 12px 24px rgba(34, 197, 94, 0.35),
        0 0 20px rgba(34, 197, 94, 0.18);
}

.btn-orange {
    background: linear-gradient(135deg, #f97316, #ea580c);
    box-shadow:
        0 8px 18px rgba(249, 115, 22, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.btn-orange:hover {
    box-shadow:
        0 12px 24px rgba(249, 115, 22, 0.35),
        0 0 20px rgba(249, 115, 22, 0.18);
}

.btn-darkblue {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
    box-shadow:
        0 8px 18px rgba(29, 78, 216, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.btn-darkblue:hover {
    box-shadow:
        0 12px 24px rgba(29, 78, 216, 0.35),
        0 0 20px rgba(29, 78, 216, 0.18);
}

.btn-cyan {
    background: linear-gradient(135deg, #06b6d4, #0891b2);
    box-shadow:
        0 8px 18px rgba(6, 182, 212, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.btn-cyan:hover {
    box-shadow:
        0 12px 24px rgba(6, 182, 212, 0.35),
        0 0 20px rgba(6, 182, 212, 0.18);
}

.full-btn {
    width: 100%;
    margin-top: 16px;
}

.alert-box {
    margin-top: 18px;
    padding: 16px;
    border-radius: 16px;
    font-weight: bold;
    line-height: 1.5;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

.safe-box {
    background: rgba(34, 197, 94, 0.14);
    color: #86efac;
}

.danger-box {
    background: rgba(239, 68, 68, 0.14);
    color: #fca5a5;
}

.warning-box {
    background: rgba(250, 204, 21, 0.14);
    color: #fde047;
}

.timer-box {
    margin-top: 18px;
    background: #0f172a;
    border: 1px solid #1e293b;
    border-radius: 16px;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.timer-box span {
    color: #94a3b8;
}

.timer-box strong {
    color: #38bdf8;
    font-size: 28px;
}

.security-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-bottom: 20px;
}

.security-card,
.buzzer-card,
.action-card {
    min-height: 190px;
}

.security-card h2 {
    color: #4ade80;
}

.security-card.ridicat h2 {
    color: #facc15;
}

.security-card.critic h2 {
    color: #f87171;
}

.buzzer-light {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    margin: 15px 0;
}

.buzzer-light.off {
    background: #52525b;
}

.buzzer-light.active {
    background: #ef4444;
    box-shadow: 0 0 20px #ef4444;
    animation: pulse 0.8s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 0.7;
    }

    50% {
        transform: scale(1.15);
        opacity: 1;
    }

    100% {
        transform: scale(1);
        opacity: 0.7;
    }
}

.diagram-card {
    margin-bottom: 20px;
}

.diagram-top {
    margin-bottom: 18px;
}

.diagram-top h2 {
    margin-bottom: 6px;
}

.zone-diagram {
    display: grid;
    grid-template-columns: 1fr 60px 1fr 60px 1fr;
    align-items: center;
    gap: 10px;
}

.zone-box {
    background: #0b1220;
    border: 1px solid #1f2937;
    border-radius: 18px;
    padding: 22px;
    text-align: center;
    transition: 0.2s;
}

.zone-box span {
    color: #94a3b8;
    display: block;
    margin-bottom: 8px;
}

.zone-box strong {
    font-size: 20px;
    color: #e5e7eb;
}

.zone-door {
    border-color: #ef4444;
}

.zone-active {
    border-color: #f97316;
    box-shadow: 0 0 20px rgba(249, 115, 22, 0.35);
}

.zone-open {
    border-color: #22c55e;
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.35);
}

.zone-alert {
    border-color: #ef4444;
    box-shadow: 0 0 25px rgba(239, 68, 68, 0.45);
}

.arrow {
    text-align: center;
    font-size: 32px;
    color: #64748b;
}

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

.sensor-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.sensor-card p {
    margin: 16px 0;
}

.light {
    width: 22px;
    height: 22px;
    border-radius: 50%;
}

.off {
    background: #52525b;
}

.red-light {
    background: #ef4444;
    box-shadow: 0 0 12px #ef4444;
}

.green-light {
    background: #22c55e;
    box-shadow: 0 0 12px #22c55e;
}

.orange-light {
    background: #f97316;
    box-shadow: 0 0 12px #f97316;
}

.grid-status {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

textarea {
    width: 100%;
    min-height: 170px;
    resize: none;
    border: 1px solid #2e2e35;
    border-radius: 16px;
    padding: 16px;
    background: #0b0b0d;
    color: #e4e4e7;
    font-size: 15px;
    line-height: 1.6;
    outline: none;
    margin-top: 10px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 18px;
    margin-bottom: 20px;
}

.stat-card span {
    color: #a1a1aa;
    display: block;
    margin-bottom: 10px;
}

.stat-card strong {
    font-size: 32px;
    color: #60a5fa;
}

.admin-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    margin-bottom: 20px;
}

.admin-card h2 {
    margin-bottom: 8px;
}

.admin-buttons {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.logs-card {
    overflow-x: auto;
}

.logs-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.logs-top h2 {
    color: #ffffff;
    margin-bottom: 6px;
}

table {
    width: 100%;
    border-collapse: collapse;
    overflow: hidden;
    border-radius: 16px;
}

thead {
    background: #0b1220;
}

th {
    color: #e5e7eb;
    text-align: left;
    padding: 15px;
    border-bottom: 1px solid #1f2937;
}

td {
    padding: 15px;
    color: #d4d4d8;
    border-bottom: 1px solid #202024;
}

tr:hover td {
    background: #16161a;
}

.status-ok {
    color: #4ade80;
    font-weight: bold;
}

.status-warning {
    color: #facc15;
    font-weight: bold;
}

.status-danger {
    color: #f87171;
    font-weight: bold;
}

.status-info {
    color: #60a5fa;
    font-weight: bold;
}

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

    .security-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1100px) {
    .sidebar {
        position: static;
        width: 100%;
        gap: 25px;
    }

    .app {
        flex-direction: column;
    }

    .content {
        margin-left: 0;
        width: 100%;
    }

    .grid-top,
    .grid-middle,
    .grid-status {
        grid-template-columns: 1fr;
    }

    .zone-diagram {
        grid-template-columns: 1fr;
    }

    .arrow {
        transform: rotate(90deg);
    }

    .admin-card {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 700px) {
    .topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .button-row,
    .admin-buttons {
        flex-direction: column;
        width: 100%;
    }

    button {
        width: 100%;
    }
}
