/* =========================================
   ROOT
========================================= */

:root {

    --bg: #0b1220;

    --surface: #131c2e;

    --surface-light: #1a2538;

    --border: #263247;

    --text: #f8fafc;

    --text-muted: #94a3b8;

    --primary: #4f8cff;

    --primary-hover: #3c78ea;

    --radius: 22px;

}

/* =========================================
   RESET
========================================= */

* {

    box-sizing: border-box;

}

html,
body {

    margin: 0;

    padding: 0;

    overflow-x: hidden;

}

/* =========================================
   BODY
========================================= */

body {

    background: var(--bg);

    color: var(--text);

    font-family:
        Inter,
        Arial,
        sans-serif;

    min-height: 100dvh;

}

/* =========================================
   LINKS
========================================= */

a {

    text-decoration: none;

}

/* =========================================
   NAVBAR
========================================= */

.navbar {

    background: rgba(22, 30, 48, 0.92);

    backdrop-filter: blur(16px);

    border-bottom: 1px solid rgba(255, 255, 255, 0.08);

    box-shadow:
        0 4px 18px rgba(0, 0, 0, 0.28);

    padding: 14px 24px;

}

/* =========================================
   NAVBAR BRAND
========================================= */

.navbar-brand {

    display: flex;

    align-items: center;

    gap: 12px;

    padding: 8px 16px;

    background: rgba(255, 255, 255, 0.18);

    border: 1px solid rgba(255, 255, 255, 0.22);

    border-radius: 14px;

    color: #f5f7ff !important;

    font-weight: 600;

    box-shadow:
        0 4px 14px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);

    transition: all 0.2s ease;

}

.navbar-brand:hover {

    background: rgba(255, 255, 255, 0.24);

    border-color: rgba(255, 255, 255, 0.32);

    color: #ffffff !important;

    transform: translateY(-1px);

}

.navbar-brand img {

    height: 42px;

    width: auto;

    border-radius: 10px;

    filter:
        drop-shadow(0 2px 10px rgba(255,255,255,0.18));

}

/* =========================================
   NAV LINKS
========================================= */

.nav-link {

    color: var(--text-muted) !important;

    font-size: 15px;

    transition: 0.2s;

}

.nav-link:hover {

    color: white !important;

}

/* =========================================
   DASHBOARD
========================================= */

.dashboard {

    padding: 35px 20px 80px;

}

.dashboard-header {

    margin-bottom: 35px;

}

.page-title {

    font-size: 38px;

    font-weight: 800;

    margin-bottom: 10px;

}

.page-subtitle {

    color: var(--text-muted);

    font-size: 16px;

}
/* =========================================
   APP CARD
========================================= */

.app-card {

    background:
        linear-gradient(
            135deg,
            rgba(255,255,255,0.02),
            rgba(255,255,255,0.01)
        ),
        var(--surface);

    border: 1px solid
        color-mix(in srgb, var(--app-color) 28%, transparent);

    border-radius: var(--radius);

    overflow: hidden;

    height: 100%;

    position: relative;

    transition:
        transform 0.2s ease,
        background 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease;

}

.app-card:hover {

    transform: translateY(-4px);

    background:
        linear-gradient(
            135deg,
            color-mix(in srgb, var(--app-color) 10%, transparent),
            rgba(255,255,255,0.02)
        ),
        var(--surface-light);

    border-color:
        color-mix(in srgb, var(--app-color) 60%, transparent);

    box-shadow:
        0 12px 28px rgba(0,0,0,0.30),
        0 0 0 1px
            color-mix(in srgb, var(--app-color) 18%, transparent),
        0 0 24px
            color-mix(in srgb, var(--app-color) 22%, transparent);

}

.app-card .card-body {

    padding: 20px 22px;

}

/* =========================================
   APP ROW
========================================= */

.app-row {

    display: flex;

    align-items: center;

    gap: 18px;

}

/* =========================================
   APP ICON
========================================= */

.app-icon {

    width: 62px;

    height: 62px;

    min-width: 62px;

    border-radius: 18px;

    display: flex;

    align-items: center;

    justify-content: center;

    font-size: 28px;

    border: 1px solid
        color-mix(in srgb, var(--app-color) 40%, transparent);

    background:
        color-mix(in srgb, var(--app-color) 12%, transparent);

    color: var(--app-color);

    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.04),
        0 0 18px
            color-mix(in srgb, var(--app-color) 10%, transparent);

}

/* =========================================
   CONTENT
========================================= */

.app-content {

    flex: 1;

    min-width: 120px;

}

/* =========================================
   TITLE
========================================= */

.app-title {

    font-size: 18px;

    font-weight: 700;

    color: var(--text);

    margin-bottom: 6px;

    white-space: nowrap;

    overflow: hidden;

    text-overflow: ellipsis;

}

/* =========================================
   DETAILS BUTTON
========================================= */

.btn-details {

    padding: 0;

    border: none;

    background: transparent;

    color:
        color-mix(in srgb, var(--app-color) 72%, white);

    font-size: 13px;

    transition:
        color 0.2s ease,
        opacity 0.2s ease;

    opacity: 0.78;

}

.btn-details:hover {

    opacity: 1;

}

/* =========================================
   LAUNCH BUTTON
========================================= */

.btn-launch {

    height: 48px;

    padding: 0 22px;

    border: none;

    border-radius: 14px;

    background:
        color-mix(in srgb, var(--app-color) 72%, #ffffff 8%);

    color: white;

    font-size: 14px;

    font-weight: 700;

    display: inline-flex;

    align-items: center;

    justify-content: center;

    transition:
        background 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease;

    white-space: nowrap;

    box-shadow:
        0 6px 16px
        color-mix(in srgb, var(--app-color) 22%, transparent);

}

.btn-launch:hover {

    background:
        color-mix(in srgb, var(--app-color) 88%, #ffffff 4%);

    transform: translateY(-1px);

    box-shadow:
        0 10px 22px
        color-mix(in srgb, var(--app-color) 28%, transparent);

}

.app-open-btn {

    min-width: 120px;

    flex-shrink: 0;

}

/* =========================================
   DESCRIPTION
========================================= */

.app-collapse {

    margin-top: 18px;

}

.app-description {

    color: var(--text-muted);

    font-size: 14px;

    line-height: 1.6;

    padding-top: 18px;

    border-top: 1px solid rgba(255,255,255,0.06);

}

/* =========================================
   LOGIN
========================================= */

.login-wrapper {

    min-height: 100dvh;

    display: flex;

    align-items: center;

    justify-content: center;

    padding: 24px;

}

.login-card {

    width: 100%;

    max-width: 440px;

    background: var(--surface);

    border: 1px solid var(--border);

    border-radius: 28px;

    padding: 42px;

    box-shadow:
        0 10px 40px rgba(0,0,0,0.35);

}

/* =========================================
   LOGIN LOGO
========================================= */

.login-logo {

    display: flex;

    justify-content: center;

    align-items: center;

    margin-bottom: 24px;

}

.login-logo-img {

    width: 180px;

    height: auto;

    border-radius: 18px;

    padding: 10px 14px;

    background: rgba(255, 255, 255, 0.06);

    border: 1px solid rgba(255, 255, 255, 0.08);

    box-shadow:
        0 8px 22px rgba(0,0,0,0.28),
        inset 0 1px 0 rgba(255,255,255,0.04);

    backdrop-filter: blur(12px);

}

/* =========================================
   LOGIN TITLE
========================================= */

.login-title {

    font-size: 2.2rem;

    font-weight: 700;

    color: #f5f7ff;

    text-align: center;

    margin-bottom: 8px;

}

/* =========================================
   LOGIN SUBTITLE
========================================= */

.login-subtitle {

    color: var(--text-muted);

    text-align: center;

    margin-bottom: 35px;

}

/* =========================================
   FORM
========================================= */

form {

    width: 100%;

}

.mb-4 {

    width: 100%;

}

.form-label {

    display: block;

    color: var(--text-muted);

    margin-bottom: 10px;

    font-size: 14px;

}

.form-control {

    display: block;

    width: 100%;

    height: 56px;

    padding: 0 18px;

    border-radius: 14px;

    border: 1px solid var(--border);

    background: #0e1626 !important;

    color: white !important;

    font-size: 15px;

}

.form-control:focus {

    background: #0e1626 !important;

    color: white !important;

    border-color: var(--primary);

    box-shadow: none;

}

/* =========================================
   ALERT
========================================= */

.alert {

    border-radius: 14px;

}

/* =========================================
   EMPTY STATE
========================================= */

.empty-state {

    text-align: center;

    padding: 80px 20px;

}

.empty-state i {

    display: block;

    font-size: 60px;

    color: var(--text-muted);

    margin-bottom: 20px;

}

.empty-state h3 {

    margin-bottom: 12px;

}

.empty-state p {

    color: var(--text-muted);

}

/* =========================================
   MOBILE
========================================= */

@media (max-width: 768px) {

    .page-title {

        font-size: 30px;

    }

    .login-card {

        padding: 30px;

    }

    .login-title {

        font-size: 34px;

    }

}

/* =========================================
   ADMIN TABLE
========================================= */

.admin-table-wrapper {

    background:
        linear-gradient(
            180deg,
            rgba(255,255,255,0.03),
            rgba(255,255,255,0.01)
        ),
        var(--surface);

    border: 1px solid var(--border);

    border-radius: 24px;

    overflow: hidden;

    box-shadow:
        0 10px 30px rgba(0,0,0,0.22);

}

/* TABLE */

.admin-table {

    width: 100%;

    margin: 0;

    border-collapse: collapse;

    background: transparent !important;

    color: var(--text);

    --bs-table-bg: transparent;

    --bs-table-striped-bg: transparent;

    --bs-table-hover-bg: rgba(255,255,255,0.03);

    --bs-table-color: var(--text);

    --bs-table-border-color: rgba(255,255,255,0.06);

}

/* HEAD */

.admin-table thead {

    background:
        rgba(255,255,255,0.03);

    border-bottom:
        1px solid rgba(255,255,255,0.06);

}

.admin-table th {

    color: var(--text-muted);

    font-size: 12px;

    font-weight: 700;

    text-transform: uppercase;

    letter-spacing: 0.08em;

    border: none !important;

    padding: 20px 24px;

    background: transparent !important;

}

/* BODY */

.admin-table td {

    border: none !important;

    border-bottom:
        1px solid rgba(255,255,255,0.04);

    padding: 20px 24px;

    vertical-align: middle;

    background: transparent !important;

    color: var(--text);

}

.admin-table tbody tr {

    transition:
        background 0.2s ease;

}

.admin-table tbody tr:hover {

    background:
        rgba(255,255,255,0.025);

}

.admin-table tbody tr:last-child td {

    border-bottom: none;

}

/* =========================================
   USER CELL
========================================= */

.user-cell {

    display: flex;

    align-items: center;

    gap: 14px;

}

.user-avatar {

    width: 48px;

    height: 48px;

    border-radius: 16px;

    display: flex;

    align-items: center;

    justify-content: center;

    background:
        rgba(79, 140, 255, 0.16);

    color: var(--primary);

    font-weight: 700;

    font-size: 16px;

    flex-shrink: 0;

}

.user-name {

    font-weight: 600;

    font-size: 15px;

}

.user-id {

    color: var(--text-muted);

    font-size: 13px;

    margin-top: 2px;

}

.user-email {

    color: var(--text-muted);

    font-size: 14px;

}

/* =========================================
   BADGES
========================================= */

.badge {

    padding: 8px 12px;

    border-radius: 999px;

    font-size: 12px;

    font-weight: 600;

    letter-spacing: 0.02em;

}

.bg-success {

    background:
        rgba(25, 135, 84, 0.18) !important;

    color:
        #7ee2a8 !important;

}

.bg-danger {

    background:
        rgba(220, 53, 69, 0.18) !important;

    color:
        #ff8b98 !important;

}

.bg-secondary {

    background:
        rgba(108, 117, 125, 0.18) !important;

    color:
        #c8d0d8 !important;

}

.bg-dark {

    background:
        rgba(255,255,255,0.08) !important;

    color:
        #c7d0db !important;

}

/* =========================================
   MODAL
========================================= */

.admin-modal {

    background: var(--surface);

    border: 1px solid var(--border);

    border-radius: 24px;

    color: var(--text);

}

.modal-muted {

    color: var(--text-muted);

    opacity: 0.92;

}

/* =========================================
   ADMIN
========================================= */

.admin-section-title {

    font-size: 22px;

    font-weight: 700;

}

/* =========================================
   USER LIST
========================================= */

.permissions-user-list {

    display: flex;

    flex-direction: column;

    gap: 14px;

}

/* =========================================
   USER ITEM
========================================= */

.permissions-user-item {

    display: flex;

    justify-content: space-between;

    align-items: center;

    gap: 14px;

    padding: 18px;

    border-radius: 18px;

    background: rgba(255,255,255,0.03);

    border: 1px solid rgba(255,255,255,0.06);

    transition: 0.2s;

    color: white;

}

.permissions-user-item:hover {

    background: rgba(255,255,255,0.06);

    transform: translateY(-2px);

}

.permissions-user-item.active {

    border-color: var(--primary);

    background: rgba(79,140,255,0.12);

}

/* =========================================
   USER INFO
========================================= */

.permissions-user-name {

    font-weight: 700;

    margin-bottom: 4px;

}

.permissions-user-email {

    color: var(--text-muted);

    font-size: 14px;

}

/* =========================================
   ADMIN BADGE
========================================= */

.admin-badge {

    background: rgba(255,255,255,0.08);

    border: 1px solid rgba(255,255,255,0.08);

    border-radius: 999px;

    padding: 6px 12px;

    font-size: 12px;

    color: white;

}

/* =========================================
   APP PERMISSIONS
========================================= */

.permission-app-card {

    display: block;

    cursor: pointer;

    background: rgba(255,255,255,0.03);

    border: 1px solid rgba(255,255,255,0.06);

    border-radius: 22px;

    padding: 22px;

    transition: 0.2s;

    height: 100%;

}

.permission-app-card:hover {

    transform: translateY(-2px);

    background: rgba(255,255,255,0.05);

}

/* =========================================
   CHECKBOX
========================================= */

.permission-checkbox {

    display: none;

}

.permission-checkbox:checked
+ .permission-app-content {

    border-color: var(--app-color);

    background:
        color-mix(
            in srgb,
            var(--app-color) 14%,
            transparent
        );

}

/* =========================================
   APP CONTENT
========================================= */

.permission-app-content {

    display: flex;

    align-items: center;

    gap: 18px;

    border-radius: 18px;

    border: 1px solid transparent;

    padding: 14px;

    transition: 0.2s;

}

/* =========================================
   APP ICON
========================================= */

.permission-app-icon {

    width: 64px;

    height: 64px;

    min-width: 64px;

    display: flex;

    align-items: center;

    justify-content: center;

    border-radius: 18px;

    background:
        color-mix(
            in srgb,
            var(--app-color) 16%,
            transparent
        );

    color: var(--app-color);

    font-size: 28px;

}

/* =========================================
   APP TEXT
========================================= */

.permission-app-title {

    font-size: 18px;

    font-weight: 700;

    margin-bottom: 6px;

    color: white;

}

.permission-app-description {

    font-size: 14px;

    color: var(--text-muted);

    line-height: 1.6;

}

/* =========================================
   APP DESIGNER MODAL
========================================= */

#appDesignerModal .modal-dialog {

    max-width: 1600px;

}

#appDesignerModal .modal-content,
.app-designer-modal {

    background: #131c2e !important;

    border: 1px solid #263247 !important;

    border-radius: 28px;

    overflow: hidden;

    box-shadow:
        0 24px 80px rgba(0,0,0,0.62);

    color: var(--text);

}

#appDesignerModal .modal-header {

    padding: 28px 32px;

    background: #182235;

    border-bottom: 1px solid rgba(255,255,255,0.08);

}

#appDesignerModal .modal-body {

    padding: 32px;

    background: #131c2e;

}

.modal-muted {

    color: rgba(255,255,255,0.72);

}

/* =========================================
   DESIGNER LAYOUT
========================================= */

.app-designer-layout {

    display: grid;

    grid-template-columns:
        320px
        1fr
        420px;

    gap: 28px;

    align-items: start;

}

.designer-sidebar,
.designer-icons,
.designer-preview {

    background: rgba(255,255,255,0.035);

    border: 1px solid rgba(255,255,255,0.08);

    border-radius: 24px;

    padding: 24px;

}

/* =========================================
   COLOR PRESETS
========================================= */

.color-presets {

    display: flex;

    flex-wrap: wrap;

    gap: 12px;

}

.color-preset {

    width: 46px;

    height: 46px;

    border-radius: 15px;

    border: 2px solid rgba(255,255,255,0.16);

    cursor: pointer;

    transition:
        transform 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease;

    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.18),
        0 6px 14px rgba(0,0,0,0.22);

}

.color-preset:hover {

    transform: scale(1.08);

    border-color: rgba(255,255,255,0.42);

}

/* =========================================
   ICON TABS
========================================= */

#iconTabs {

    gap: 12px;

}

#iconTabs .nav-link {

    background: rgba(255,255,255,0.05);

    border: 1px solid rgba(255,255,255,0.08);

    color: #cbd5e1 !important;

    border-radius: 14px;

    padding: 12px 18px;

    font-weight: 600;

}

#iconTabs .nav-link.active {

    background: #4f8cff;

    color: white !important;

    border-color: #4f8cff;

}

/* =========================================
   ICON GRID
========================================= */

.icon-grid {

    display: grid;

    grid-template-columns:
        repeat(auto-fill, minmax(120px, 1fr));

    gap: 18px;

    max-height: 620px;

    overflow-y: auto;

    padding-right: 6px;

}

/* =========================================
   ICON ITEM
========================================= */

.icon-item {

    position: relative;

    background: rgba(255,255,255,0.04);

    border: 1px solid rgba(255,255,255,0.08);

    border-radius: 22px;

    padding: 22px 16px;

    display: flex;

    flex-direction: column;

    align-items: center;

    justify-content: center;

    gap: 14px;

    cursor: pointer;

    transition:
        transform 0.2s ease,
        background 0.2s ease,
        border-color 0.2s ease;

    min-height: 150px;

    text-align: center;

}

.icon-item:hover {

    transform: translateY(-2px);

    background: rgba(255,255,255,0.07);

    border-color: rgba(79,140,255,0.45);

}

.icon-item input {

    display: none;

}

.icon-item i {

    font-size: 34px;

    color: #f8fafc;

}

.icon-item span {

    font-size: 13px;

    color: #94a3b8;

    line-height: 1.5;

    word-break: break-word;

}

.icon-item:has(input:checked) {

    border-color: #4f8cff;

    background:
        linear-gradient(
            135deg,
            rgba(79,140,255,0.20),
            rgba(79,140,255,0.06)
        );

}

.icon-item input:checked + i,
.icon-item input:checked + img {

    transform: scale(1.12);

}

/* =========================================
   SVG
========================================= */

.svg-picker-icon {

    width: 42px;

    height: 42px;

    object-fit: contain;

}

.app-svg-icon {

    width: 34px;

    height: 34px;

    object-fit: contain;

}

/* =========================================
   UPLOAD
========================================= */

.upload-dropzone {

    width: 100%;

    border: 2px dashed rgba(255,255,255,0.18);

    border-radius: 24px;

    padding: 38px 24px;

    text-align: center;

    cursor: pointer;

    transition:
        background 0.2s ease,
        border-color 0.2s ease;

    background: rgba(255,255,255,0.04);

    display: block;

}

.upload-dropzone:hover {

    border-color: #4f8cff;

    background: rgba(79,140,255,0.08);

}

.upload-content i {

    font-size: 42px;

    color: #4f8cff;

    margin-bottom: 18px;

}

.upload-content h4 {

    font-size: 22px;

    margin-bottom: 10px;

}

.upload-content p {

    color: #94a3b8;

    margin: 0;

}

/* =========================================
   PREVIEW
========================================= */

.preview-title {

    margin-bottom: 22px;

    font-size: 24px;

    font-weight: 700;

}

.designer-preview .app-card {

    background:
        linear-gradient(
            135deg,
            color-mix(in srgb, var(--app-color) 14%, transparent),
            rgba(255,255,255,0.03)
        ),
        var(--surface);

    border:
        1px solid color-mix(in srgb, var(--app-color) 38%, transparent);

}

.designer-preview .app-icon {

    width: 72px;

    height: 72px;

    min-width: 72px;

    border-radius: 22px;

    font-size: 32px;

    color: var(--app-color);

    border-color:
        color-mix(in srgb, var(--app-color) 40%, transparent);

    background:
        color-mix(in srgb, var(--app-color) 14%, transparent);

}

.designer-preview .app-title {

    font-size: 24px;

    margin-bottom: 10px;

}

.designer-preview .app-description {

    font-size: 15px;

    line-height: 1.7;

}

/* =========================================
   MOBILE
========================================= */

@media (max-width: 1400px) {

    .app-designer-layout {

        grid-template-columns: 1fr;

    }

}

/* =========================================
   SVG MASK ICON
========================================= */

.svg-mask-icon {

    width: 42px;

    height: 42px;

    background: currentColor;

    mask-image: var(--svg-url);

    -webkit-mask-image: var(--svg-url);

    mask-size: contain;

    -webkit-mask-size: contain;

    mask-repeat: no-repeat;

    -webkit-mask-repeat: no-repeat;

    mask-position: center;

    -webkit-mask-position: center;

    color: #ffffff;

}

/* =========================================
   SVG APP ICON
========================================= */

.app-svg-icon {

    width: 34px;

    height: 34px;

    object-fit: contain;

    filter:
        brightness(0)
        saturate(100%)
        invert(100%);

}

/* =========================================
   DISABLED CARD
========================================= */

.app-card-disabled {

    opacity: 0.55;

    filter: grayscale(0.4);

}

/* =========================================
   STATUS BADGES
========================================= */

.status-badge {

    padding: 4px 10px;

    border-radius: 999px;

    font-size: 11px;

    font-weight: 700;

}

.status-active {

    background:
        rgba(25,135,84,0.18);

    color:
        #4ade80;

    border:
        1px solid rgba(25,135,84,0.35);

}

.status-disabled {

    background:
        rgba(220,53,69,0.18);

    color:
        #f87171;

    border:
        1px solid rgba(220,53,69,0.35);

}

/* =========================================
   ACTIONS
========================================= */

.app-actions {

    display: flex;

    align-items: center;

    gap: 10px;

}

.btn-action {

    width: 40px;

    height: 40px;

    border-radius: 12px;

    display: flex;

    align-items: center;

    justify-content: center;

    background:
        rgba(255,255,255,0.04);

    border:
        1px solid rgba(255,255,255,0.08);

    color:
        #cbd5e1;

    transition: 0.2s;

}

.btn-action:hover {

    transform: translateY(-2px);

    background:
        rgba(255,255,255,0.08);

}