:root {
    --text-main: #222222;
    --accent-blue: #50b4de;
    --accent-green: #b0cb1f;
    --panel: rgba(255, 255, 255, 0.84);
    --border: rgba(34, 34, 34, 0.08);
    --shadow: 0 24px 80px rgba(34, 34, 34, 0.12);
}

body {
    font-family: "Manrope", sans-serif;
    color: var(--text-main);
    background: #eef5f6;
}

.app-shell, .auth-shell {
    min-height: 100vh;
    position: relative;
}

.app-bg, .auth-shell::before {
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at top right, rgba(80, 180, 222, 0.28), transparent 25%),
        radial-gradient(circle at bottom left, rgba(176, 203, 31, 0.24), transparent 22%),
        linear-gradient(135deg, #f6fbfd 0%, #f2f3ea 100%);
    z-index: -1;
}

.glass-panel {
    background: var(--panel);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(255,255,255,.45);
    box-shadow: var(--shadow);
    border-radius: 28px;
}

.sidebar-wrap {
    padding: 20px;
    position: relative;
    z-index: 20;
}

.main-wrap {
    width: 100%;
}

.sidebar {
    min-height: calc(100vh - 48px);
    padding: 26px 22px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-logo {
    width: 168px;
    min-height: 68px;
    border-radius: 22px;
    display: grid;
    place-items: center;
    color: #fff;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-green));
}

.brand-logo-image {
    padding: 0;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.96);
}

.brand-logo-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.auth-brand-logo {
    width: 276px;
    height: auto;
    min-height: 120px;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    border: 0;
    overflow: visible;
    margin-bottom: 20px !important;
}

.auth-brand-logo img {
    width: 100%;
    height: auto;
    object-fit: contain;
    transform: none;
    max-width: 100%;
    max-height: none;
    margin-inline: auto;
}

.brand-title {
    font-weight: 800;
    font-size: 1.1rem;
}

.brand-subtitle {
    color: #6b7280;
    font-size: .9rem;
}

.side-nav .nav-link {
    color: var(--text-main);
    padding: 14px 16px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
    font-weight: 600;
}

.side-nav .nav-link:hover, .side-nav .nav-link.active {
    background: rgba(80, 180, 222, 0.14);
}

.nav-section-label {
    margin-top: 6px;
    font-size: .78rem;
    font-weight: 800;
    color: #6b7280;
    letter-spacing: .08em;
}

.topbar {
    padding: 24px 30px 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.topbar-main {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}

.topbar-title-wrap {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.page-title {
    font-size: clamp(1.8rem, 2vw, 2.4rem);
    font-weight: 800;
    margin-bottom: 6px;
}

.page-subtitle {
    color: #6b7280;
}

.content-wrap {
    padding: 24px 30px 40px;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mobile-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.mobile-brand-logo {
    flex: 1 1 auto;
    display: flex;
    justify-content: center;
    min-width: 0;
}

.mobile-brand-logo img {
    width: min(100%, 360px);
    height: auto;
    max-height: 94px;
    object-fit: contain;
    display: block;
}

.mobile-topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mobile-profile-btn {
    border-radius: 18px;
    background: rgba(255,255,255,.86);
}

.icon-btn {
    width: 52px;
    height: 52px;
    border-radius: 18px;
    background: rgba(255,255,255,.86);
    border: 1px solid var(--border);
}

.badge-count {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--accent-green);
    color: #222;
    border-radius: 999px;
    font-size: .7rem;
    padding: 2px 7px;
}

.avatar {
    width: 52px;
    height: 52px;
    object-fit: cover;
    border-radius: 18px;
}

.user-pill {
    padding: 10px 14px;
    border-radius: 22px;
    background: rgba(255,255,255,.86);
    border: 1px solid var(--border);
}

.dashboard-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 240px;
    gap: 24px;
    align-items: start;
}

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

.metric-card {
    min-width: 210px;
    min-height: 170px;
    padding: 28px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.metric-label {
    color: #6b7280;
    font-size: 1.02rem;
    font-weight: 600;
}

.metric-value {
    font-size: 3.4rem;
    font-weight: 800;
    line-height: 1;
}

.dashboard-actions {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.dashboard-action-form {
    width: 100%;
}

.chart-panel {
    position: relative;
    min-height: 340px;
}

.app-log-subtitle {
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.table-date-cell {
    white-space: nowrap;
}

.table-avatar {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 14px;
    display: block;
}

.table-avatar-inline {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    flex: 0 0 auto;
}

.table-user-cell {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.table-user-cell > div {
    min-width: 0;
}

.table-user-name {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 4px;
}

.table-user-email {
    line-height: 1.2;
}

.current-profile-photo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.current-profile-photo-image {
    width: 52px;
    height: 52px;
    border-radius: 16px;
}

.dashboard-logs-table td,
.dashboard-logs-table th,
.users-table td,
.users-table th {
    vertical-align: middle;
}

.dashboard-logs-table td:last-child,
.dashboard-logs-table th:last-child {
    white-space: nowrap;
}

.action-btn {
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-weight: 800;
    width: 100%;
}

.table, .form-control, .form-select, .btn {
    border-radius: 14px;
}

.app-table-fixed {
    width: 100%;
    table-layout: fixed;
}

.app-table-fixed th,
.app-table-fixed td {
    word-wrap: break-word;
    overflow-wrap: anywhere;
}

.table td.d-flex {
    display: table-cell !important;
}

.table td.d-flex > a,
.table td.d-flex > button,
.table td.d-flex > form {
    display: inline-flex;
    vertical-align: middle;
    margin-right: 8px;
    margin-bottom: 8px;
}

.table td.d-flex > form:last-child,
.table td.d-flex > a:last-child,
.table td.d-flex > button:last-child {
    margin-right: 0;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-blue), #4199bf);
    border: none;
}

.btn-outline-primary {
    color: #26799c;
    border-color: rgba(80, 180, 222, 0.45);
}

.btn-success {
    background: linear-gradient(135deg, var(--accent-green), #97b317);
    border: none;
    color: #222;
}

.btn-outline-dark, .btn-outline-danger {
    min-width: 112px;
}

.btn-outline-dark,
.btn-outline-danger,
.btn-outline-primary {
    text-align: center;
    justify-content: center;
}

.notification-menu {
    width: min(360px, 92vw);
    border-radius: 22px;
    overflow: hidden;
}

.notification-trigger {
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    text-align: left;
    color: inherit;
}

.notification-trigger:hover {
    opacity: 0.92;
}

.modal-content.glass-panel {
    border: 0;
    background: rgba(255, 255, 255, 0.96);
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid rgba(34, 34, 34, 0.08);
    color: #6b7280;
    font-size: .84rem;
    font-weight: 600;
}

.app-footer {
    padding: 0 30px 32px;
    color: #6b7280;
    font-size: .9rem;
    text-align: center;
}

@media (min-width: 992px) {
    .sidebar-wrap {
        flex: 0 0 20%;
        max-width: 20%;
    }

    .main-wrap {
        flex: 0 0 80%;
        max-width: 80%;
    }

    .sidebar {
        padding: 24px 18px;
    }

    .brand-logo {
        width: 144px;
        min-height: 60px;
    }
}

.auth-shell {
    display: grid;
    place-items: center;
    padding: 24px;
}

.auth-card {
    width: min(480px, 100%);
    padding: 38px;
}

.image-preview-card {
    position: relative;
    overflow: hidden;
    border-radius: 22px;
    max-width: 580px;
}

.image-preview-card img {
    width: 100%;
    display: block;
}

@media (max-width: 991.98px) {
    .content-wrap {
        padding: 18px 18px 24px;
    }

    .app-footer {
        padding: 6px 18px 34px;
    }
}

.overlay-download {
    position: absolute;
    inset: auto 16px 16px auto;
    background: rgba(34,34,34,.78);
    color: #fff;
    padding: 10px 14px;
    border-radius: 12px;
    text-decoration: none;
    opacity: 0;
    transition: .2s ease;
}

.image-preview-card:hover .overlay-download {
    opacity: 1;
}

.management-toolbar {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    margin-bottom: 22px;
}

.management-toolbar form {
    flex: 1;
}

.form-toggle-panel {
    margin-top: 22px;
    border-top: 1px solid rgba(34, 34, 34, 0.08);
    padding-top: 22px;
}

.info-strip {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    padding: 16px 18px;
    background: rgba(80,180,222,.08);
    border-radius: 18px;
}

.sidebar-close-btn {
    margin-left: auto;
    position: relative;
    z-index: 5;
}

.sidebar-toggle {
    flex: 0 0 auto;
}

.mobile-nav-offcanvas {
    width: 100vw !important;
    max-width: 100vw;
    border-right: 0;
    background: rgba(255,255,255,.97);
    backdrop-filter: blur(14px);
}

.mobile-nav-offcanvas .offcanvas-header {
    padding: 18px 18px 8px;
}

.mobile-nav-offcanvas .offcanvas-body {
    padding: 0 18px 28px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.mobile-nav-footer {
    padding: 18px 0 32px;
}

@media (max-width: 991px) {
    .table-responsive {
        overflow-x: auto;
        overflow-y: hidden;
    }

    .app-table-fixed {
        min-width: 760px;
        table-layout: auto;
    }

    .app-table-fixed th,
    .app-table-fixed td {
        white-space: nowrap;
        word-wrap: normal;
        overflow-wrap: normal;
        vertical-align: middle;
    }

    .app-table-fixed td:first-child,
    .app-table-fixed th:first-child {
        white-space: normal;
    }

    .app-table-fixed tr {
        height: auto;
    }

    .app-table-fixed td,
    .app-table-fixed th {
        height: 100%;
    }

    .topbar {
        padding: 18px 18px 0;
    }

    .topbar-main {
        gap: 12px;
    }

    .topbar-title-wrap {
        gap: 0;
    }

    .page-title {
        font-size: clamp(2.4rem, 7vw, 3.6rem);
        margin-bottom: 10px;
    }

    .page-subtitle {
        font-size: 1rem;
        line-height: 1.45;
        max-width: 19ch;
    }

    .brand {
        display: none;
    }

    .nav-section-label {
        margin-top: 2px;
    }

    .side-nav .nav-link {
        padding: 11px 14px;
        margin-bottom: 2px;
        border-radius: 14px;
    }
    .content-wrap {
        padding: 18px 18px 90px;
    }

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

    .metrics-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .metric-card {
        min-width: 0;
        min-height: 148px;
        padding: 24px;
    }

    .management-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .app-footer {
        padding-inline: 18px;
        padding-bottom: 36px;
        flex-direction: column;
        gap: 4px;
        align-items: center;
        justify-content: center;
        text-align: center;
    }
}
