/*
=========================================================
  DIGOM LICENSING PORTAL
  Professional, Secure, Operator-Focused Interface System
=========================================================
*/

:root {
    --bg-canvas: #08111f;
    --bg-shell: #0d1726;
    --bg-panel: rgba(10, 19, 33, 0.82);
    --bg-panel-strong: #0f1b2d;
    --bg-panel-soft: #12233a;
    --bg-card: #ffffff;
    --bg-card-muted: #f5f8fc;
    --text-primary: #e6edf7;
    --text-secondary: #a9b8cf;
    --text-strong: #07111f;
    --text-muted: #607089;
    --line-soft: rgba(148, 163, 184, 0.18);
    --line-strong: rgba(148, 163, 184, 0.28);
    --accent-core: #12304f;
    --accent-primary: #0ea5a4;
    --accent-primary-strong: #0a7d7f;
    --accent-success: #18794e;
    --accent-danger: #b42347;
    --accent-warning: #b76e12;
    --signal-safe: #5eead4;
    --shadow-soft: 0 24px 60px rgba(2, 8, 23, 0.18);
    --shadow-card: 0 18px 40px rgba(15, 23, 42, 0.08);
    --radius-sm: 10px;
    --radius-md: 18px;
    --radius-lg: 28px;
    --border-thin: 1px solid var(--line-soft);
    --border-thick: 1px solid var(--line-strong);
    --font-heading: 'Outfit', 'Segoe UI', sans-serif;
    --font-sans: 'Inter', 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', Consolas, monospace;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    background:
        radial-gradient(circle at top left, rgba(14, 165, 164, 0.12), transparent 28%),
        radial-gradient(circle at top right, rgba(37, 99, 235, 0.10), transparent 22%),
        linear-gradient(180deg, #09111d 0%, #0b1320 48%, #eef4fb 48%, #eef4fb 100%);
}

body {
    min-height: 100vh;
    font-family: var(--font-sans);
    background: transparent;
    color: var(--text-strong);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a {
    color: inherit;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: -0.04em;
    color: var(--text-strong);
}

p {
    color: var(--text-muted);
}

code,
pre {
    font-family: var(--font-mono);
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent-primary);
}

.eyebrow::before {
    content: '';
    width: 28px;
    height: 1px;
    background: currentColor;
    opacity: 0.6;
}

.login-page {
    position: relative;
    display: flex;
    min-height: 100vh;
    overflow: hidden;
}

.login-page::before,
.login-page::after {
    content: '';
    position: absolute;
    inset: auto;
    pointer-events: none;
}

.login-page::before {
    width: 540px;
    height: 540px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(14, 165, 164, 0.18) 0%, transparent 70%);
    top: -160px;
    right: -80px;
}

.login-page::after {
    width: 640px;
    height: 640px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(15, 118, 110, 0.14) 0%, transparent 72%);
    bottom: -260px;
    left: -120px;
}

.login-container {
    position: relative;
    z-index: 1;
    width: 100%;
    display: grid;
    grid-template-columns: minmax(320px, 560px) minmax(320px, 520px);
    justify-content: center;
    align-items: center;
    gap: 48px;
    padding: 40px;
}

.login-box,
.login-hero {
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(24px);
}

.login-box {
    background: rgba(255, 255, 255, 0.94);
    color: var(--text-strong);
    padding: 42px;
}

.login-hero {
    position: relative;
    overflow: hidden;
    min-height: 620px;
    padding: 44px;
    background:
        linear-gradient(160deg, rgba(12, 25, 44, 0.96), rgba(9, 18, 32, 0.92)),
        linear-gradient(90deg, rgba(14, 165, 164, 0.10), transparent);
    color: var(--text-primary);
}

.login-hero::before {
    content: '';
    position: absolute;
    inset: 22px;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.login-hero > * {
    position: relative;
    z-index: 1;
}

.login-hero h2 {
    max-width: 520px;
    margin: 18px 0 18px;
    color: #f7fbff;
    font-size: clamp(2rem, 2.6vw, 3.4rem);
}

.login-hero p {
    max-width: 520px;
    color: rgba(230, 237, 247, 0.76);
    font-size: 15px;
}

.login-hero-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-top: 34px;
}

.trust-card {
    padding: 22px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.trust-card strong {
    display: block;
    margin-bottom: 10px;
    color: #f6fbff;
    font-size: 15px;
}

.trust-card span {
    display: block;
    color: rgba(230, 237, 247, 0.7);
    font-size: 13px;
    line-height: 1.6;
}

.security-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 36px;
}

.security-chip {
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(94, 234, 212, 0.1);
    border: 1px solid rgba(94, 234, 212, 0.18);
    color: #d7fffa;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.login-header {
    margin-bottom: 28px;
}

.login-header h1 {
    margin: 16px 0 8px;
    font-size: clamp(2rem, 2vw, 2.8rem);
}

.login-header p {
    max-width: 360px;
    font-size: 14px;
}

.db-status {
    margin-top: 18px;
}

.login-form .form-group {
    margin-bottom: 22px;
}

.login-form label,
.form-inline .form-group label {
    display: block;
    margin-bottom: 8px;
    color: #55657d;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.login-form input,
.form-inline input,
.form-inline select,
.form-control,
select,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="url"],
textarea {
    width: 100%;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid #d6e1ee;
    background: #f8fbff;
    color: #102033;
    font-family: var(--font-sans);
    font-size: 14px;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.login-form input:focus,
.form-inline input:focus,
.form-inline select:focus,
.form-control:focus,
select:focus,
textarea:focus,
input:focus {
    outline: none;
    border-color: rgba(14, 165, 164, 0.55);
    box-shadow: 0 0 0 5px rgba(14, 165, 164, 0.12);
    background: #ffffff;
}

.login-footer {
    padding-top: 18px;
    border-top: 1px solid #e5edf6;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 292px;
    padding: 0;
    background: transparent;
    z-index: 1000;
}

.sidebar::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(11, 23, 38, 0.98), rgba(10, 19, 33, 0.96)),
        linear-gradient(180deg, rgba(14, 165, 164, 0.08), transparent);
    border-right: 1px solid rgba(255, 255, 255, 0.07);
    box-shadow: 0 30px 80px rgba(2, 8, 23, 0.35);
}

.sidebar > * {
    position: relative;
    z-index: 1;
}

.sidebar-header {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 24px 22px 18px;
    margin-bottom: 10px;
}

.nav-brand {
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: #f7fbff;
}

.nav-brand strong {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    letter-spacing: -0.04em;
}

.nav-brand span {
    color: rgba(230, 237, 247, 0.56);
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-weight: 700;
}

.nav-security-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    width: fit-content;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(94, 234, 212, 0.08);
    border: 1px solid rgba(94, 234, 212, 0.18);
    color: #dcfffb;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.nav-security-pill::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--signal-safe);
    box-shadow: 0 0 0 6px rgba(94, 234, 212, 0.12);
}

.nav-links {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0 12px 14px;
    height: calc(100vh - 210px);
    overflow-y: auto;
    scrollbar-width: none;
}

.nav-links::-webkit-scrollbar {
    display: none;
}

.nav-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-group-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    color: rgba(230, 237, 247, 0.85); /* Increased contrast */
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease;
    user-select: none;
    margin-top: 12px;
}

.nav-group-header:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
}

.nav-group-header::after {
    content: '\203A';
    margin-left: auto;
    font-size: 16px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.7;
}

.nav-group.open .nav-group-header::after {
    transform: rotate(90deg);
}

.nav-group.open .nav-group-header {
    color: var(--accent-primary);
}

.nav-sublinks {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease, margin 0.3s ease;
    opacity: 0;
    overflow: hidden;
    padding-left: 10px;
}

.nav-group.open .nav-sublinks {
    grid-template-rows: 1fr;
    opacity: 1;
    margin-bottom: 8px;
}

.nav-sublinks-inner {
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-links a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 12px;
    text-decoration: none;
    color: rgba(230, 237, 247, 0.74);
    font-size: 13.5px;
    font-weight: 600;
    transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
    border: 1px solid transparent;
}

.nav-links a:hover {
    transform: translateX(2px);
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
}

.nav-links a.active {
    background: linear-gradient(135deg, rgba(14, 165, 164, 0.15), rgba(14, 165, 164, 0.05));
    border-color: rgba(94, 234, 212, 0.12);
    color: #ffffff;
}

.nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    font-size: 14px;
}

.nav-spacer {
    flex-grow: 1;
}

.logout-link {
    color: #ffd6de !important;
}

.logout-link:hover {
    background: rgba(180, 35, 71, 0.18) !important;
}

.nav-user {
    margin-top: auto;
    padding: 14px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.nav-user strong {
    display: block;
    color: #f7fbff;
    font-size: 13px;
}

.nav-user span {
    display: block;
    color: rgba(230, 237, 247, 0.56);
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-top: 4px;
}

.container {
    position: relative;
    margin-left: 292px;
    min-height: 100vh;
    padding: 36px 40px 56px;
}

.container > h1:first-child {
    margin-bottom: 10px;
    font-size: clamp(2rem, 2.2vw, 3.2rem);
}

.page-hero {
    display: none;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 20px;
    margin-bottom: 26px;
    padding: 0 4px;
}

.page-header-content h1 {
    margin-bottom: 8px;
    font-size: clamp(1.9rem, 2vw, 3rem);
    color: #0c1b31;
}

.page-header-content p {
    max-width: 760px;
    color: #5f728b;
    font-size: 15px;
}

.page-title-block {
    margin-bottom: 24px;
}

.page-title-block h1 {
    margin-bottom: 8px;
    color: #0c1b31;
}

.page-title-block p {
    color: #5f728b;
}

.page-hero::after {
    content: '';
    position: absolute;
    inset: 1px;
    border-radius: 27px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    pointer-events: none;
}

.page-hero h1,
.page-hero h2,
.page-hero p,
.page-hero strong {
    position: relative;
    z-index: 1;
}

.page-hero h1 {
    color: #f6fbff;
    margin: 14px 0 12px;
}

.page-hero p {
    color: rgba(230, 237, 247, 0.74);
    max-width: 760px;
}

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 22px;
}

.hero-metric {
    padding: 10px 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #ebf4ff;
    font-size: 13px;
    font-weight: 600;
}

.card {
    background: var(--bg-card);
    border: 1px solid rgba(198, 211, 226, 0.72);
    border-radius: 24px;
    box-shadow: var(--shadow-card);
    padding: 30px;
    margin-bottom: 24px;
}

.surface-note {
    color: #61758f;
    font-size: 13px;
}

.profile-card {
    max-width: 760px;
    margin: 0 auto;
}

.form-section {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid #e5edf5;
}

.form-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

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

.form-full {
    grid-column: 1 / -1;
}

.card-header-inline {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.readonly-field {
    background: #f2f6fb !important;
    color: #5b6f88 !important;
}

.card h2 {
    font-size: 1.2rem;
    margin-bottom: 18px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.stat-card {
    position: relative;
    overflow: hidden;
    background: linear-gradient(180deg, #ffffff, #f7fbff);
    border: 1px solid rgba(198, 211, 226, 0.72);
    border-radius: 22px;
    padding: 26px 24px;
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.06);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-primary), rgba(18, 48, 79, 0.3));
}

.stat-value {
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.05em;
    color: #0a1830;
    margin-bottom: 10px;
}

.stat-label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #697c95;
}

.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
}

.table th {
    padding: 14px 16px;
    background: #f4f8fd;
    border-bottom: 1px solid #dfe7f1;
    color: #68809b;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 11px;
    font-weight: 700;
}

.table td {
    padding: 16px;
    border-bottom: 1px solid #e9f0f7;
    color: #112036;
    vertical-align: middle;
}

.table tr:hover td {
    background: #f8fbff;
}

.table code {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 10px;
    background: #eff5fb;
    border: 1px solid #dbe6f2;
    color: #0d2a49;
    font-size: 12px;
}

.hub-row {
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.hub-row:hover {
    transform: translateY(-1px);
}

.hub-details {
    display: none;
    padding: 24px;
    background: #fcfdff;
    border-top: 1px solid #e7eef7;
    animation: fadeUp 0.22s ease;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 18px;
    border-radius: 14px;
    border: 1px solid transparent;
    background: #eaf2fb;
    color: #10233b;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: -0.01em;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-primary-strong));
    color: #f7ffff;
}

.btn-success {
    background: linear-gradient(135deg, #1a8f5e, var(--accent-success));
    color: #ffffff;
}

.btn-danger {
    background: linear-gradient(135deg, #cf315c, var(--accent-danger));
    color: #ffffff;
}

.btn-info {
    border-color: #d6e3f0;
    background: #ffffff;
}

.btn-secondary {
    background: #f6f9fd;
    border-color: #d7e1ec;
}

.btn-sm {
    min-height: 34px;
    padding: 0 12px;
    font-size: 12px;
    border-radius: 12px;
}

.btn-block {
    width: 100%;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 11px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.badge-active,
.badge-success {
    background: #ddfbef;
    color: #16643f;
}

.badge-suspended,
.badge-danger {
    background: #ffe0e6;
    color: #a31e43;
}

.badge-warning {
    background: #fff0d9;
    color: #a86409;
}

.badge-info,
.badge-pro,
.badge-admin,
.badge-manager {
    background: #edf4fb;
    color: #31506f;
    border: 1px solid #d8e4f0;
}

.alert {
    border-radius: 18px;
    padding: 16px 18px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    font-size: 14px;
}

.alert-success {
    background: #e3faf0;
    border-color: #c8efd9;
    color: #155a3a;
}

.alert-error,
.alert-danger {
    background: #ffe7ec;
    border-color: #f7c3d0;
    color: #982543;
}

.alert-warning {
    background: #fff2de;
    border-color: #f2d6aa;
    color: #9b5a08;
}

.form-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
}

.form-group {
    min-width: 180px;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 28px;
}

.pagination a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    border: 1px solid #d8e3ee;
    text-decoration: none;
    color: #15304d;
    background: #ffffff;
}

.pagination a.active {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-primary-strong));
    border-color: transparent;
    color: #ffffff;
}

.text-muted {
    color: var(--text-muted);
}

.tabs-nav {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    padding-bottom: 16px;
    margin-bottom: 22px;
    border-bottom: 1px solid #e6edf5;
}

.tab-btn {
    padding: 10px 14px;
    border-radius: 12px;
    background: #eff5fb;
    color: #5b718b;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
}

.tab-btn.active {
    background: #10263f;
    color: #ffffff;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

@media (max-width: 1160px) {
    .login-container {
        grid-template-columns: 1fr;
        max-width: 720px;
        margin: 0 auto;
    }

    .login-hero {
        min-height: auto;
    }
}

@media (max-width: 980px) {
    html {
        background: linear-gradient(180deg, #09111d 0%, #0c1420 38%, #eef4fb 38%, #eef4fb 100%);
    }

    .sidebar {
        position: static;
        width: 100%;
        height: auto;
        padding: 16px 16px 0;
    }

    .sidebar::before {
        inset: 0;
    }

    .nav-links {
        height: auto;
        padding-bottom: 22px;
    }

    .container {
        margin-left: 0;
        padding: 24px 16px 40px;
    }
}

@media (max-width: 720px) {
    .login-container {
        padding: 16px;
        gap: 18px;
    }

    .login-box,
    .login-hero,
    .page-hero,
    .card {
        border-radius: 22px;
        padding: 22px;
    }

    .login-hero-grid {
        grid-template-columns: 1fr;
    }

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

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

    .table {
        font-size: 13px;
    }

    .table th,
    .table td {
        padding: 12px;
    }
}
