* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #f7f5fa;
    color: #252329;
}

.hidden {
    display: none !important;
}

.center-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: white;
    border-radius: 24px;
    padding: 42px;
    box-shadow: 0 15px 45px rgba(0,0,0,0.08);
}

.brand {
    font-size: 36px;
    font-weight: 800;
    text-align: center;
    margin-bottom: 5px;
}

.subtitle {
    text-align: center;
    color: #777;
    margin-bottom: 32px;
}

input {
    width: 100%;
    padding: 15px 16px;
    margin-bottom: 12px;
    border: 1px solid #ccc;
    border-radius: 12px;
    font-size: 16px;
}

button {
    border: 0;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 700;
}

.primary {
    background: #6b4caf;
    color: white;
    padding: 14px 22px;
}

.primary:hover {
    background: #5b3ea0;
}

.secondary {
    background: #eeeaf2;
    color: #433c4a;
    padding: 14px 22px;
}

.login-card .primary {
    width: 100%;
    margin-top: 8px;
}

.small {
    padding: 11px 18px;
}

.error {
    color: #b3261e;
    margin-top: 12px;
}

.version {
    text-align: center;
    color: #888;
    font-size: 13px;
    margin-top: 30px;
}

header {
    min-height: 85px;
    padding: 18px 40px;
    background: white;
    border-bottom: 1px solid #e5e1e8;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-logo {
    font-size: 25px;
    font-weight: 800;
}

.header-user {
    font-size: 14px;
    color: #777;
    margin-top: 3px;
}

.text-button {
    background: transparent;
    color: #6b4caf;
    padding: 10px;
}

main {
    max-width: 1180px;
    margin: auto;
    padding: 30px;
}

.status-row {
    display: flex;
    justify-content: space-between;
    color: #666;
    margin-bottom: 20px;
}

.dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 7px;
}

.online {
    background: #2ca66f;
}

.offline {
    background: #bb3b3b;
}

.gate-card {
    background: white;
    padding: 32px;
    border-radius: 24px;
    box-shadow: 0 7px 30px rgba(0,0,0,0.05);
    margin-bottom: 36px;
}

.label {
    font-size: 12px;
    color: #777;
    font-weight: 700;
    letter-spacing: 1.5px;
}

.gate-card h1 {
    margin: 8px 0;
}

.gate-status {
    color: #666;
}

.open-button {
    width: 100%;
    background: #6b4caf;
    color: white;
    font-size: 22px;
    padding: 23px;
    margin-top: 28px;
    border-radius: 18px;
}

.open-button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.result {
    text-align: center;
    margin-top: 16px;
    min-height: 20px;
}

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

.section-header h2 {
    margin-bottom: 4px;
}

.muted {
    color: #777;
}

.create-panel {
    background: white;
    padding: 25px;
    border-radius: 18px;
    margin-bottom: 24px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
}

.form-actions {
    display: flex;
    gap: 10px;
}

.table-wrapper {
    overflow-x: auto;
    background: white;
    border-radius: 18px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    text-align: left;
    padding: 16px;
    border-bottom: 1px solid #eee;
}

th {
    font-size: 13px;
    color: #777;
}

.badge {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}

.badge-active {
    background: #e5f5ec;
    color: #1f7a4c;
}

.badge-disabled {
    background: #f4e7e7;
    color: #9b3333;
}

.badge-access {
    background: #eee9f8;
    color: #6042a4;
}

.action-button {
    padding: 8px 11px;
    margin: 2px;
    font-size: 12px;
}

.action-purple {
    background: #6b4caf;
    color: white;
}

.action-gray {
    background: #eee;
    color: #444;
}

@media (max-width: 750px) {

    header {
        padding: 16px 20px;
    }

    main {
        padding: 20px;
    }

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

    .section-header {
        align-items: flex-start;
        flex-direction: column;
    }
}
