:root {
    --bg: #f4f6fb;
    --surface: #ffffff;
    --text: #111827;
    --muted: #6b7280;
    --border: #e5e7eb;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --danger: #dc2626;
    --success-bg: #dcfce7;
    --success-text: #166534;
    --danger-bg: #fee2e2;
    --danger-text: #991b1b;
    --warning-bg: #fef3c7;
    --warning-text: #92400e;
    --shadow: 0 10px 30px rgba(17, 24, 39, 0.08);
    --radius: 14px;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
    display: flex;
    flex-direction: column;
}

/* Navbar */
.navbar {
    background: #1f2429 !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
}

.navbar-brand {
    font-weight: 700;
    letter-spacing: 0.2px;
}

.navbar .nav-link {
    color: rgba(255, 255, 255, 0.75) !important;
    transition: color 0.2s ease;
}

.navbar .nav-link:hover,
.navbar .nav-link.active {
    color: #ffffff !important;
}

.navbar .nav-link.text-danger {
    color: #ff5c5c !important;
}

/* Main layout */
main {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    padding: 24px 16px 40px;
    flex: 1;
}

/* Cards */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: visible;
}

.card-body {
    padding: 22px;
}

/* Forms */
label {
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text);
}

input,
textarea,
select {
    width: 100%;
    padding: 11px 12px;
    margin: 6px 0 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #ffffff;
    color: var(--text);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

/* Buttons */
.btn {
    border-radius: 9px;
    font-weight: 500;
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

button.danger,
.danger {
    background: var(--danger);
    color: #ffffff;
    border: 0;
    border-radius: 9px;
    padding: 10px 14px;
    cursor: pointer;
}

button.danger:hover,
.danger:hover {
    background: #b91c1c;
}

/* Alerts */
.alert {
    border: 0;
    border-radius: 12px;
    padding: 13px 16px;
    box-shadow: 0 6px 18px rgba(17, 24, 39, 0.06);
}

.ok {
    background: var(--success-bg);
    color: var(--success-text);
}

.err {
    background: var(--danger-bg);
    color: var(--danger-text);
}

/* Table */
table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
}

.table {
    margin-bottom: 0;
}

.table th {
    background: #1f2429;
    color: #ffffff;
    font-weight: 600;
    border-color: #363d45;
}

.table td,
.table th {
    padding: 12px;
    vertical-align: middle;
}

.table tbody tr:hover {
    background: #f9fafb;
}

/* OTA table - no horizontal scroll */
.ota-table {
    width: 100%;
    table-layout: fixed;
}

.ota-table th,
.ota-table td {
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.ota-table th:nth-child(1),
.ota-table td:nth-child(1) {
    width: 8%;
}

.ota-table th:nth-child(2),
.ota-table td:nth-child(2) {
    width: 32%;
}

.ota-table th:nth-child(3),
.ota-table td:nth-child(3) {
    width: 8%;
}

.ota-table th:nth-child(4),
.ota-table td:nth-child(4) {
    width: 32%;
}

.ota-table th:nth-child(5),
.ota-table td:nth-child(5) {
    width: 9%;
}

.ota-table th:nth-child(6),
.ota-table td:nth-child(6) {
    width: 11%;
}

/* Dropdown */
.dropdown-menu {
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 8px;
}

.dropdown-item {
    border-radius: 8px;
    padding: 9px 12px;
}

.dropdown-item:hover {
    background: #f3f4f6;
}

/* Badge */
.badge {
    padding: 6px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.approved {
    background: var(--success-bg);
    color: var(--success-text);
}

.blocked {
    background: var(--danger-bg);
    color: var(--danger-text);
}

.unregistered {
    background: var(--warning-bg);
    color: var(--warning-text);
}

/* Helpers */
.muted {
    color: var(--muted);
}

.actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Footer */
footer {
    margin-top: auto;
    background: #1f2429 !important;
    color: #ffffff;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* Mobile */
@media (max-width: 768px) {
    main {
        padding: 18px 12px 32px;
    }

    .card-body {
        padding: 16px;
    }

    .ota-table {
        font-size: 12px;
    }

    .ota-table td,
    .ota-table th {
        padding: 8px;
    }

    .btn,
    .dropdown-toggle {
        font-size: 12px;
        padding: 7px 10px;
    }

    .badge {
        font-size: 11px;
        padding: 5px 7px;
    }
}
.ota-table th,
.ota-table td {
    text-align: center;
    vertical-align: middle;
}