:root {
    --white: #ffffff;
    --black: #0a0e17;
    --blue-50: #eff6ff;
    --blue-100: #dbeafe;
    --blue-500: #3b82f6;
    --blue-600: #2563eb;
    --blue-700: #1d4ed8;
    --blue-900: #1e3a5f;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-500: #64748b;
    --gray-700: #334155;
    --gray-900: #0f172a;
    --red-500: #ef4444;
    --red-50: #fef2f2;
    --green-500: #22c55e;
    --green-50: #f0fdf4;
    --amber-500: #f59e0b;
    --radius: 12px;
    --shadow: 0 4px 24px rgba(10, 14, 23, 0.08);
    --font: 'Inter', system-ui, -apple-system, sans-serif;
    --utc-bar-height: 2.125rem;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; }

body {
    font-family: var(--font);
    color: var(--gray-900);
    background: var(--gray-50);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--blue-600); text-decoration: none; }
a:hover { text-decoration: underline; }

.utc-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 300;
    width: 100%;
    height: var(--utc-bar-height);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 1rem;
    background: var(--black);
    color: var(--white);
    font-size: 0.8125rem;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.utc-bar time {
    color: inherit;
}

/* Forms */
.form-group { margin-bottom: 1.25rem; }

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 0.375rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.9375rem;
    font-family: inherit;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    background: var(--white);
    color: var(--gray-900);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--blue-500);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

select.form-control { cursor: pointer; }

textarea.form-control { min-height: 80px; resize: vertical; }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 600px) {
    .form-row { grid-template-columns: 1fr; }
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: inherit;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.btn:active { transform: scale(0.98); }

.btn-primary {
    background: var(--blue-600);
    color: var(--white);
}

.btn-primary:hover { background: var(--blue-700); }

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
    border: 1px solid var(--gray-200);
}

.btn-secondary:hover { background: var(--gray-200); }

.btn-danger {
    background: var(--red-500);
    color: var(--white);
}

.btn-danger:hover { background: #dc2626; }

.btn-sm { padding: 0.375rem 0.75rem; font-size: 0.8125rem; }

.btn-block { width: 100%; }

/* Alerts */
.alert {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.alert-error {
    background: var(--red-50);
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.alert-success {
    background: var(--green-50);
    color: #15803d;
    border: 1px solid #bbf7d0;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    padding: 0.875rem 1.25rem;
    background: var(--black);
    color: var(--white);
    border-radius: 8px;
    font-size: 0.875rem;
    box-shadow: var(--shadow);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s, transform 0.3s;
    z-index: 9999;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 14, 23, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}

.modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--white);
    border-radius: var(--radius);
    width: 100%;
    max-width: 640px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(10, 14, 23, 0.2);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--gray-100);
}

.modal-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--gray-500);
    cursor: pointer;
    line-height: 1;
}

.modal-body { padding: 1.5rem; }

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--gray-100);
}

/* Badge */
.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 999px;
    text-transform: capitalize;
}

.badge-active { background: var(--green-50); color: #15803d; }
.badge-locked { background: var(--red-50); color: #b91c1c; }
.badge-administrator { background: #ede9fe; color: #5b21b6; }
.badge-operator { background: var(--blue-50); color: var(--blue-700); }
.badge-user { background: var(--gray-100); color: var(--gray-700); }

/* Table */
.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    background: var(--white);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

th, td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--gray-100);
}

th {
    background: var(--gray-50);
    font-weight: 600;
    color: var(--gray-700);
    white-space: nowrap;
}

tr:last-child td { border-bottom: none; }

tr:hover td { background: var(--gray-50); }

.empty-state {
    text-align: center;
    padding: 2rem;
    color: var(--gray-500);
}

.action-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}
