﻿* {
    box-sizing: border-box;
}

:root {
    --bg: #090909;
    --panel: #111111;
    --panel2: #151515;
    --border: #292929;
    --muted: #888888;
    --text: #eeeeee;

    --red: #a81414;
    --red-light: #d92b2b;

    --green: #55c875;
    --orange: #d99b2b;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at top, #1a1010 0%, #090909 42%);
    color: var(--text);
    font-family: Arial, sans-serif;
}

button,
input,
select {
    font: inherit;
}

button {
    border: 0;
    cursor: pointer;
    background: var(--red);
    color: white;
    padding: 11px 16px;
    font-weight: 700;
}

button:hover {
    background: #c51b1b;
}

button:disabled {
    opacity: .45;
    cursor: default;
}

button.secondary {
    background: #262626;
}

button.secondary:hover {
    background: #343434;
}

button.danger {
    background: #721818;
}

button.small {
    padding: 7px 10px;
    font-size: 12px;
}

.full {
    width: 100%;
}

input,
select {
    width: 100%;
    padding: 12px;
    color: white;
    background: #090909;
    border: 1px solid #333;
    outline: none;
}

input:focus,
select:focus {
    border-color: var(--red);
}

label {
    display: block;
    margin: 0 0 7px;
    color: #aaa;
    font-size: 13px;
}

.field {
    margin-bottom: 17px;
}

.brand {
    color: var(--red-light);
    font-size: 30px;
    font-weight: 800;
    letter-spacing: 3px;
}

.subtitle {
    color: #777;
    margin: 4px 0 28px;
}

.center-view {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 25px;
}

.auth-box {
    width: 100%;
    max-width: 430px;
    padding: 32px;
    background: #111;
    border: 1px solid var(--border);
    border-top: 3px solid var(--red);
    box-shadow: 0 20px 60px rgba(0,0,0,.45);
}

.error {
    color: #e66565;
    min-height: 20px;
    margin-top: 14px;
    font-size: 13px;
}

.success {
    color: var(--green);
    margin-top: 14px;
}

.info {
    color: #aaa;
    line-height: 1.6;
}

.link-button {
    padding: 10px 0;
    background: none;
    color: #999;
    font-weight: normal;
}

.link-button:hover {
    background: none;
    color: white;
}

#activationView,
#twoFactorView,
#dashboard,
#recoveryLogin {
    display: none;
}


/* APP */

.app-header {
    height: 68px;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #0e0e0e;
    border-bottom: 1px solid var(--border);
}

.app-header strong {
    color: var(--red-light);
    letter-spacing: 2px;
}

.app-shell {
    display: flex;
    min-height: calc(100vh - 68px);
}

.sidebar {
    width: 220px;
    padding: 20px 12px;
    background: #0d0d0d;
    border-right: 1px solid var(--border);
}

.nav-button {
    width: 100%;
    margin-bottom: 7px;
    padding: 12px 14px;
    text-align: left;
    background: transparent;
    color: #aaa;
    border-left: 3px solid transparent;
}

.nav-button:hover {
    background: #171717;
}

.nav-button.active {
    background: #191111;
    border-left-color: var(--red-light);
    color: white;
}

#teamNavButton {
    display: none;
}

.app-main {
    flex: 1;
    padding: 28px;
    overflow: auto;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

.page-title {
    margin: 0 0 24px;
}

.grid {
    display: grid;
    grid-template-columns:
        repeat(auto-fit, minmax(320px, 1fr));
    gap: 18px;
}

.card {
    padding: 22px;
    background: var(--panel);
    border: 1px solid var(--border);
}

.card h2,
.card h3 {
    margin-top: 0;
}

.online,
.enabled {
    color: var(--green);
}

.disabled,
.pending {
    color: var(--orange);
}

.role {
    color: var(--red-light);
    text-transform: uppercase;
}

.security-row {
    margin: 18px 0;
}

.qr-wrap {
    display: inline-block;
    background: white;
    padding: 12px;
    margin: 15px 0;
}

#twoFactorQr {
    display: block;
    width: 230px;
    height: 230px;
}

.secret {
    display: block;
    padding: 11px;
    margin: 10px 0 18px;
    background: #070707;
    border: 1px solid #333;
    word-break: break-all;
    user-select: all;
}

#twoFactorSetup,
#recoveryCodesPanel,
#inviteResult {
    display: none;
}

.warning {
    padding: 13px;
    background: #1c1710;
    border-left: 3px solid var(--orange);
    color: #e5c78a;
    line-height: 1.5;
}

.recovery-codes {
    padding: 15px;
    background: #070707;
    border: 1px solid #333;
    line-height: 1.8;
    user-select: all;
}


/* TEAM */

.team-layout {
    display: grid;
    grid-template-columns: 340px minmax(500px, 1fr);
    gap: 18px;
}

.invite-output {
    margin-top: 20px;
    padding: 15px;
    background: #0a0a0a;
    border: 1px solid #333;
}

.invite-url {
    margin: 10px 0;
    font-family: monospace;
}

.table-wrap {
    overflow-x: auto;
}

.team-table {
    width: 100%;
    border-collapse: collapse;
}

.team-table th,
.team-table td {
    padding: 12px 10px;
    text-align: left;
    border-bottom: 1px solid #282828;
    vertical-align: middle;
}

.team-table th {
    color: #888;
    font-size: 12px;
    text-transform: uppercase;
}

.team-table td {
    font-size: 14px;
}

.user-name {
    font-weight: bold;
}

.user-meta {
    margin-top: 4px;
    color: #777;
    font-size: 12px;
}

.badge {
    display: inline-block;
    padding: 5px 8px;
    background: #222;
    font-size: 11px;
    text-transform: uppercase;
}

.badge.green {
    color: var(--green);
}

.badge.orange {
    color: var(--orange);
}

.badge.red {
    color: #e26464;
}

.table-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.role-select {
    min-width: 130px;
    padding: 7px;
    font-size: 12px;
}


/* ACTIVATION */

.activation-details {
    padding: 14px;
    margin-bottom: 20px;
    background: #090909;
    border: 1px solid #292929;
}

/* PERMISSIONS */

#permissionsNavButton {
    display: none;
}

.permissions-layout {
    display: grid;
    grid-template-columns: 280px minmax(500px, 1fr);
    gap: 18px;
}

.permission-role-info {
    margin-top: 18px;
    padding: 13px;
    background: #090909;
    border: 1px solid #292929;
    color: #999;
    line-height: 1.5;
}

.permission-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}

.permissions-list {
    display: grid;
    gap: 22px;
    margin-top: 18px;
}

.permission-group {
    background: #0c0c0c;
    border: 1px solid #292929;
}

.permission-group-title {
    padding: 11px 14px;
    background: #171717;
    color: #d92b2b;
    font-size: 13px;
    font-weight: bold;
    text-transform: uppercase;
}

.permission-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 13px 14px;
    border-top: 1px solid #222;
    cursor: pointer;
}

.permission-item:hover {
    background: #131313;
}

.permission-item input {
    width: auto;
    margin: 3px 0 0;
}

.permission-name {
    font-size: 14px;
    font-weight: bold;
}

.permission-description {
    margin-top: 4px;
    color: #777;
    font-size: 12px;
}

@media (max-width: 900px) {
    .permissions-layout {
        grid-template-columns: 1fr;
    }
}


/* MOBILE */

@media (max-width: 900px) {
    .team-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    .sidebar {
        width: 150px;
    }

    .app-main {
        padding: 18px;
    }
}