body {
    margin: 0;
    background: #111827;
    color: #e5e7eb;
    font-family: Arial, sans-serif;
}

.login-box {
    width: 360px;
    margin: 90px auto;
    background: #1f2937;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 0 30px rgba(0,0,0,0.4);
}

.container {
    max-width: 1000px;
    margin: 40px auto;
    background: #1f2937;
    padding: 30px;
    border-radius: 16px;
}

h1, h2, h3 {
    color: #38bdf8;
}

input, select, button {
    width: 100%;
    padding: 12px;
    margin: 8px 0;
    border-radius: 10px;
    border: none;
    box-sizing: border-box;
}

input, select {
    background: #374151;
    color: white;
}

button {
    background: #2563eb;
    color: white;
    font-weight: bold;
    cursor: pointer;
}

button:hover {
    background: #1d4ed8;
}

a {
    color: #38bdf8;
    text-decoration: none;
    margin-right: 15px;
}

.error {
    background: #7f1d1d;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 12px;
}

.top {
    margin-bottom: 25px;
}

.cards {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.card {
    background: #374151;
    padding: 25px;
    border-radius: 14px;
    min-width: 180px;
    text-align: center;
    color: white;
    font-weight: bold;
}

.card:hover {
    background: #2563eb;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #111827;
    border-radius: 12px;
    overflow: hidden;
}

th, td {
    padding: 12px;
    border-bottom: 1px solid #374151;
}

th {
    background: #374151;
}

.check {
    display: block;
    margin: 10px 0;
}

.check input {
    width: auto;
    margin-right: 8px;
}


.dashboard-shell {
    max-width: 1150px;
    margin: 40px auto;
    padding: 28px;
}

.hero {
    background: linear-gradient(135deg, #1e3a8a, #0f172a 65%);
    border: 1px solid #334155;
    border-radius: 24px;
    padding: 34px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 25px 70px rgba(0,0,0,0.35);
}

.eyebrow {
    color: #93c5fd;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 12px;
    font-weight: bold;
    margin: 0 0 10px;
}

.hero h1 {
    font-size: 42px;
    margin: 0;
    color: #ffffff;
}

.subtitle {
    color: #cbd5e1;
    font-size: 16px;
    margin-top: 12px;
}

.user-badge {
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.2);
    padding: 14px 22px;
    border-radius: 999px;
    color: #ffffff;
    font-weight: bold;
    text-transform: uppercase;
}

.admin-actions {
    margin: 24px 0 30px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.admin-actions a {
    background: #1f2937;
    border: 1px solid #374151;
    color: #e5e7eb;
    padding: 12px 18px;
    border-radius: 14px;
    text-decoration: none;
    transition: 0.2s ease;
}

.admin-actions a:hover {
    background: #2563eb;
    border-color: #3b82f6;
    transform: translateY(-2px);
}

.admin-actions .logout-link {
    margin-left: auto;
    background: #7f1d1d;
    border-color: #991b1b;
}

.section-title {
    margin: 10px 0 18px;
    color: #e5e7eb;
}

.service-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
}

.service-card {
    background: #1f2937;
    border: 1px solid #374151;
    border-radius: 22px;
    padding: 22px;
    color: #ffffff;
    text-decoration: none;
    display: flex;
    gap: 18px;
    align-items: flex-start;
    transition: 0.2s ease;
    box-shadow: 0 15px 35px rgba(0,0,0,0.25);
}

.service-card:hover {
    background: #111827;
    border-color: #38bdf8;
    transform: translateY(-4px);
}

.service-icon {
    width: 46px;
    height: 46px;
    border-radius: 16px;
    background: #2563eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.service-card h3 {
    margin: 0 0 8px;
    color: #ffffff;
}

.service-card p {
    margin: 0;
    color: #94a3b8;
    font-size: 13px;
    word-break: break-all;
}

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

    .hero h1 {
        font-size: 32px;
    }

    .admin-actions .logout-link {
        margin-left: 0;
    }
}

.small-hero {
    padding: 28px 34px;
}

.modern-table-wrap {
    background: #1f2937;
    border: 1px solid #374151;
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 18px 45px rgba(0,0,0,0.3);
}

.modern-table {
    width: 100%;
    border-collapse: collapse;
    background: transparent;
}

.modern-table th {
    background: #111827;
    color: #93c5fd;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 1px;
}

.modern-table th,
.modern-table td {
    padding: 16px;
    border-bottom: 1px solid #374151;
}

.modern-table tr:hover td {
    background: rgba(37, 99, 235, 0.08);
}

.role-pill {
    background: #334155;
    color: #e5e7eb;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
}

.status-ok {
    background: rgba(34,197,94,0.15);
    color: #22c55e;
    padding: 7px 11px;
    border-radius: 999px;
    font-weight: bold;
    font-size: 13px;
}

.status-bad {
    background: rgba(239,68,68,0.15);
    color: #ef4444;
    padding: 7px 11px;
    border-radius: 999px;
    font-weight: bold;
    font-size: 13px;
}

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

.actions-cell a,
.muted-action {
    padding: 7px 11px;
    border-radius: 10px;
    background: #111827;
    border: 1px solid #374151;
    font-size: 13px;
}

.danger-action {
    color: #fca5a5;
}

.good-action {
    color: #86efac;
}

.muted-action {
    color: #9ca3af;
}

.modern-form-card {
    background: #1f2937;
    border: 1px solid #374151;
    border-radius: 24px;
    padding: 28px;
    box-shadow: 0 18px 45px rgba(0,0,0,0.3);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
}

.form-group label {
    display: block;
    color: #93c5fd;
    font-weight: bold;
    margin-bottom: 8px;
}

.form-group small {
    display: block;
    color: #94a3b8;
    margin-top: 6px;
    font-size: 12px;
}

.form-group input,
.form-group select {
    background: #111827;
    border: 1px solid #374151;
    color: #ffffff;
    border-radius: 14px;
    padding: 13px 14px;
}

.switch-row {
    display: flex !important;
    align-items: center;
    gap: 10px;
    background: #111827;
    border: 1px solid #374151;
    border-radius: 14px;
    padding: 14px;
    color: #e5e7eb !important;
}

.switch-row input {
    width: auto;
}

.services-panel {
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid #374151;
}

.services-panel h2 {
    color: #ffffff;
    margin-bottom: 6px;
}

.services-panel p {
    color: #94a3b8;
    margin-top: 0;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
    margin-top: 18px;
}

.service-check {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    background: #111827;
    border: 1px solid #374151;
    border-radius: 18px;
    padding: 16px;
    cursor: pointer;
    transition: 0.2s ease;
}

.service-check:hover {
    border-color: #38bdf8;
    transform: translateY(-2px);
}

.service-check input {
    width: auto;
    margin-top: 4px;
}

.service-check strong {
    display: block;
    color: #ffffff;
}

.service-check small {
    display: block;
    color: #94a3b8;
    word-break: break-all;
    margin-top: 4px;
}

.form-actions {
    margin-top: 28px;
    display: flex;
    gap: 14px;
    align-items: center;
}

.form-actions button {
    width: auto;
    padding: 13px 22px;
    border-radius: 14px;
}

.form-actions a {
    background: #111827;
    border: 1px solid #374151;
    padding: 13px 18px;
    border-radius: 14px;
    color: #e5e7eb;
}

@media (max-width: 760px) {
    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .form-actions button,
    .form-actions a {
        width: 100%;
        box-sizing: border-box;
        text-align: center;
    }
}

.form-group select {
    width: 100%;
    min-height: 48px;
    font-size: 15px;
}

.ip-pill {
    background: #111827;
    border: 1px solid #374151;
    color: #93c5fd;
    padding: 6px 10px;
    border-radius: 999px;
    font-family: monospace;
    font-size: 13px;
}

.modern-table td:last-child {
    color: #cbd5e1;
}

.url-pill {
    display: inline-block;
    background: #111827;
    border: 1px solid #374151;
    color: #93c5fd;
    padding: 7px 11px;
    border-radius: 999px;
    font-size: 12px;
    max-width: 420px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Mobile PRO - dashboard */

@media (max-width: 600px) {

    body {
        overflow-x: hidden;
    }

    .dashboard-shell {
        margin: 0;
        padding: 16px;
        max-width: 100%;
    }

    .hero {
        border-radius: 20px;
        padding: 24px 20px;
        min-height: auto;
    }

    .hero h1 {
        font-size: 28px;
        line-height: 1.15;
    }

    .subtitle {
        font-size: 14px;
        line-height: 1.5;
    }

    .user-badge {
        padding: 10px 16px;
        font-size: 12px;
    }

    .admin-actions {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
        margin: 18px 0 24px;
    }

    .admin-actions a {
        display: block;
        width: 100%;
        box-sizing: border-box;
        text-align: center;
        padding: 14px 16px;
        font-size: 15px;
    }

    .admin-actions .logout-link {
        margin-left: 0;
    }

    .section-title {
        font-size: 20px;
        margin-top: 6px;
    }

    .service-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .service-card {
        border-radius: 18px;
        padding: 18px;
        gap: 14px;
    }

    .service-icon {
        width: 42px;
        height: 42px;
        min-width: 42px;
        border-radius: 14px;
        font-size: 20px;
    }

    .service-card h3 {
        font-size: 18px;
    }

    .service-card p {
        font-size: 12px;
        line-height: 1.4;
    }
}

@media (max-width: 380px) {

    .hero h1 {
        font-size: 24px;
    }

    .admin-actions a {
        font-size: 14px;
        padding: 13px 14px;
    }

    .service-card {
        padding: 16px;
    }
}

/* Mobile PRO - users table */

@media (max-width: 700px) {

    .modern-table-wrap {
        overflow-x: auto;
        border-radius: 18px;
    }

    .modern-table {
        min-width: 720px;
    }

    .modern-table th,
    .modern-table td {
        padding: 13px 12px;
        font-size: 13px;
        white-space: nowrap;
    }

    .actions-cell {
        flex-wrap: nowrap;
    }

    .actions-cell a,
    .muted-action {
        padding: 8px 10px;
        font-size: 12px;
    }

    .role-pill,
    .status-ok,
    .status-bad {
        font-size: 12px;
        padding: 6px 9px;
    }
}

/* Mobile PRO - services table */

@media (max-width: 700px) {

    .modern-table {
        min-width: 760px;
    }

    .url-pill {
        max-width: 260px;
        display: inline-block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

@media (max-width: 420px) {

    .url-pill {
        max-width: 210px;
    }
}

/* Bigger login screen */

.login-box {
    width: 100%;
    max-width: 480px;
    padding: 42px;
    border-radius: 26px;
    box-shadow: 0 25px 70px rgba(0,0,0,0.35);
}

.login-box h1 {
    font-size: 34px;
    margin-bottom: 28px;
}

.login-box input {
    min-height: 54px;
    font-size: 16px;
    border-radius: 16px;
    padding: 14px 16px;
}

.login-box button {
    min-height: 56px;
    font-size: 16px;
    border-radius: 16px;
    margin-top: 12px;
}

.login-box a {
    font-size: 14px;
}

@media (max-width: 600px) {

    .login-box {
        max-width: 100%;
        margin: 20px;
        padding: 28px 22px;
        border-radius: 22px;
    }

    .login-box h1 {
        font-size: 28px;
    }
}

.twofa-box {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 28px;
    align-items: center;
}

.qr-code {
    width: 240px;
    height: 240px;
    background: white;
    padding: 12px;
    border-radius: 18px;
}

.secret-box {
    background: #111827;
    border: 1px solid #374151;
    padding: 12px;
    border-radius: 12px;
    color: #cbd5e1;
    word-break: break-all;
}

.secret-box code {
    color: #93c5fd;
}

@media (max-width: 700px) {
    .twofa-box {
        grid-template-columns: 1fr;
    }

    .qr-code {
        width: 220px;
        height: 220px;
        margin: 0 auto;
    }
}

.user-status-box {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-end;
}

.twofa-status {
    padding: 10px 16px;
    border-radius: 999px;
    font-weight: bold;
    font-size: 13px;
    border: 1px solid;
}

.twofa-on {
    background: rgba(34,197,94,0.16);
    color: #86efac;
    border-color: rgba(34,197,94,0.35);
}

.twofa-off {
    background: rgba(239,68,68,0.16);
    color: #fca5a5;
    border-color: rgba(239,68,68,0.35);
}

@media (max-width: 700px) {
    .user-status-box {
        align-items: flex-start;
    }
}
