* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
}

body {
    background: #f0f2f5;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Login */
.login-card {
    background: white;
    width: 90%;
    max-width: 360px;
    padding: 2rem 1.5rem;
    border-radius: 24px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    text-align: center;
}

    .login-card h2 {
        color: #1e3a8a;
        margin-bottom: 1.5rem;
    }

.input-group {
    margin-bottom: 1rem;
    text-align: left;
}

    .input-group input {
        width: 100%;
        padding: 12px;
        border: 1px solid #ccc;
        border-radius: 40px;
        font-size: 1rem;
        outline: none;
    }

button {
    background: #1e3a8a;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 40px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    width: 100%;
    transition: 0.2s;
}

    button:active {
        opacity: 0.8;
    }

/* Dashboard */
.dashboard {
    display: none;
    width: 100%;
    max-width: 600px;
    margin: 1rem;
    background: white;
    border-radius: 28px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    overflow: hidden;
}

.header {
    background: #1e3a8a;
    color: white;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

    .header h1 {
        font-size: 1.3rem;
    }

.logout-btn {
    background: rgba(255,255,255,0.2);
    width: auto;
    padding: 6px 14px;
    font-size: 0.8rem;
}

.tabs {
    display: flex;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.tab {
    flex: 1;
    text-align: center;
    padding: 12px 0;
    cursor: pointer;
    font-weight: 500;
    color: #334155;
}

    .tab.active {
        color: #1e3a8a;
        border-bottom: 2px solid #1e3a8a;
    }

.panel {
    display: none;
    padding: 1rem;
}

    .panel.active {
        display: block;
    }

.stat-card {
    background: #f8fafc;
    border-radius: 20px;
    padding: 1rem;
    text-align: center;
    margin-bottom: 1.2rem;
}

.counters {
    display: flex;
    gap: 0.8rem;
    justify-content: space-between;
    flex-wrap: wrap;
    margin: 1rem 0;
}

.counter {
    background: white;
    flex: 1;
    padding: 0.8rem;
    border-radius: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    text-align: center;
}

.counter-value {
    font-size: 2rem;
    font-weight: bold;
    color: #1e3a8a;
}

.gate-btn {
    background: #10b981;
    font-size: 1.2rem;
    padding: 12px;
    margin-top: 0.5rem;
    width: 100%;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #eef2ff;
    padding: 6px 12px;
    border-radius: 40px;
    font-size: 0.8rem;
    margin: 0.5rem 0;
}

.led {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #10b981;
}

    .led.off {
        background: #ef4444;
    }

.restart-list {
    list-style: none;
    max-height: 180px;
    overflow-y: auto;
    margin-top: 0.5rem;
}

    .restart-list li {
        padding: 8px;
        border-bottom: 1px solid #e2e8f0;
        font-size: 0.85rem;
        display: flex;
        justify-content: space-between;
    }

.form-row {
    margin-bottom: 1rem;
}

    .form-row label {
        display: block;
        font-weight: 500;
        margin-bottom: 4px;
        font-size: 0.85rem;
    }

select, input {
    width: 100%;
    padding: 10px;
    border: 1px solid #cbd5e1;
    border-radius: 40px;
    font-size: 0.9rem;
}

.toggle-switch {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.toggle {
    position: relative;
    width: 46px;
    height: 24px;
    background: #cbd5e1;
    border-radius: 30px;
    cursor: pointer;
    transition: 0.2s;
}

    .toggle.active {
        background: #1e3a8a;
    }

    .toggle::after {
        content: "";
        position: absolute;
        width: 20px;
        height: 20px;
        background: white;
        border-radius: 50%;
        top: 2px;
        left: 3px;
        transition: 0.2s;
    }

    .toggle.active::after {
        transform: translateX(22px);
    }

.small-btn {
    background: #334155;
    margin-top: 8px;
    width: auto;
    padding: 8px;
    font-size: 0.8rem;
}

.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: white;
    padding: 8px 20px;
    border-radius: 40px;
    font-size: 0.8rem;
    z-index: 1000;
    opacity: 0;
    transition: 0.2s;
    pointer-events: none;
}

    .toast.show {
        opacity: 1;
    }

hr {
    margin: 1rem 0;
}

footer {
    text-align: center;
    font-size: 0.7rem;
    padding: 0.8rem;
    color: #64748b;
    border-top: 1px solid #e2e8f0;
}
