@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&family=Inter:wght@400;500;600&display=swap');

:root {
    --sidebar-width: 200px;
    --header-height: 92px;
    --primary-blue: #364A6F;
    --light-gray: #949494;
    --border-color: #E6E4F0;
    --bg-sidebar: #1F263E;
    --bg-content: #FCFCFC;
    --white: #FFFFFF;
    --search-border: #D9D9D9;
}

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

body {
    font-family: 'Poppins', sans-serif;
    color: var(--light-gray);
    background-color: var(--white);
    overflow-x: hidden;
}

#main-layout {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* Sidebar Styling */
.app-sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    flex-shrink: 0;
    background: var(--bg-sidebar);
    border-right: none;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    display: flex;
    flex-direction: column;
    padding: 32px 23px;
    z-index: 1000;
    overflow-y: scroll;
    overflow-x: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.app-sidebar::-webkit-scrollbar {
    display: none;
}

.sidebar-logo {
    width: 100%;
    margin-bottom: 40px;
    text-align: center;
}

.sidebar-logo img {
    max-width: 100%;
    height: auto;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 24px;
    width: 100%;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 16px;
    line-height: 24px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.nav-item:hover,
.nav-item.active {
    color: #FFFFFF;
}

.nav-item svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
}

.unfold-btn svg {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-item.sub-open .unfold-btn svg {
    transform: rotate(180deg);
}

.nav-item.active svg path {
    stroke: #FFFFFF;
}

/* Sub-nav / Son pages */
.sub-nav {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-left: 28px;
    margin-top: 0;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.25s ease,
        margin-top 0.3s ease;
}

.sub-nav.open {
    max-height: 500px;
    opacity: 1;
    margin-top: 4px;
}

.sub-nav a {
    text-decoration: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
    transition: color 0.2s ease;
}

.sub-nav a:hover {
    color: #FFFFFF;
}

.sub-nav a.active {
    color: #FFFFFF;
    font-weight: 600;
}

/* Content Area Styling */
.content-wrapper {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-width: 0;
}



.top-header {
    height: var(--header-height);
    background: var(--white);
    border-bottom: 1px solid var(--border-color);
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 999;
}

.header-left {
    display: flex;
    flex-direction: column;
}

.header-page-title {
    font-size: 18px;
    font-weight: 500;
    color: var(--primary-blue);
    line-height: 27px;
}

.header-page-desc {
    font-size: 14px;
    color: var(--light-gray);
    line-height: 21px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 24px;
}

.header-search {
    position: relative;
    width: 386px;
    height: 43px;
}

.header-search input {
    width: 100%;
    height: 100%;
    border: 1px solid var(--search-border);
    border-radius: 8px;
    padding: 0 12px 0 36px;
    font-family: inherit;
    font-size: 14px;
    outline: none;
}

.header-search svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    stroke: var(--light-gray);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.notification-icon {
    position: relative;
    cursor: pointer;
}

.notification-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background: #E32828;
    border-radius: 50%;
}

.user-profile {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #D9D9D9;
    /* Placeholder */
    overflow: hidden;
    cursor: pointer;
}

.user-profile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Main Content Area */
.main-content {
    padding: 24px;
    flex: 1;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
}

/* Unified Tools Container (Module-specific sidebars) */
.module-tools {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.module-tools h3 {
    width: 100%;
    font-size: 16px;
    color: var(--primary-blue);
    margin-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 5px;
}

.tool-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Legacy Support / Overrides */
#wrapper,
#innerwrapper {
    all: unset;
    display: contents;
}

/* Page body: flex row holding page-sidebar + content */
.page-body {
    display: flex;
    flex: 1;
    min-height: 0;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
}

/* Page-specific sidebar (legacy #sidebar) – fixed panel next to nav */
#sidebar {
    width: 220px;
    min-width: 220px;
    background: var(--white);
    border-right: 1px solid var(--border-color);
    padding: 20px 16px;
    overflow-y: auto;
    height: calc(100vh - var(--header-height));
    position: sticky;
    top: var(--header-height);
    display: block !important;
    float: none;
}

#sidebar h2 {
    font-size: 15px;
    font-weight: 600;
    color: var(--primary-blue);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

#sidebar h3 {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary-blue);
    margin-bottom: 8px;
    margin-top: 16px;
}

#sidebar ul.subnav {
    list-style: none;
    padding: 0;
    margin: 0 0 12px 0;
}

#sidebar ul.subnav li {
    margin-bottom: 6px;
}

#sidebar ul.subnav li a {
    color: var(--light-gray);
    text-decoration: none;
    font-size: 13px;
    transition: color 0.2s;
    display: block;
    padding: 3px 0;
}

#sidebar ul.subnav li a:hover {
    color: var(--primary-blue);
}

#sidebar ul.subnav li a.active {
    color: var(--primary-blue);
    font-weight: 600;
}

#sidebar input[type="text"],
#sidebar select {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: inherit;
    font-size: 12px;
    margin-top: 4px;
    box-sizing: border-box;
}

#sidebar .sidebutton,
#sidebar input[type="submit"] {
    cursor: pointer;
    background: var(--primary-blue);
    color: white;
    border: none;
    padding: 7px 14px;
    border-radius: 4px;
    font-weight: 500;
    font-size: 12px;
    margin-top: 8px;
    width: 100%;
}

#sidebar input[type="checkbox"] {
    width: auto;
}

/* Main content area next to page sidebar */
#contentnorightbar,
#content {
    flex: 1;
    min-width: 0;
    padding: 24px;
    display: block;
    float: none;
    width: auto;
}

#header {
    display: none;
    /* Hide old header */
}

#footer {
    display: none;
}

/* Hide legacy subnav tabs – navigation is handled by the global sidebar */
#subnav {
    display: none;
}




/* Alert Messages */
.alert {
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 20px;
    font-family: 'Poppins', sans-serif;
}

.alert-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.alert-danger {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

/* Form Card */
.form-card {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 20px;
}

.form-card h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-blue);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.form-card .form-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.form-card .form-row label {
    font-size: 13px;
    font-weight: 500;
    color: var(--primary-blue);
}

.form-card .form-row input[type="text"],
.form-card .form-row input[type="password"],
.form-card .form-row textarea,
.form-card .form-row select {
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
    color: #333;
    transition: border-color 0.2s;
}

.form-card .form-row input:focus,
.form-card .form-row textarea:focus,
.form-card .form-row select:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(54, 74, 111, 0.1);
}

.btn-primary {
    cursor: pointer;
    background: var(--primary-blue);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    font-family: inherit;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: #2a3d5c;
}

/* Editor Layout */
.editor-layout {
    display: flex;
    gap: 20px;
    height: 68vh;
}

.editor-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.editor-panel h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-blue);
    margin-bottom: 8px;
}

.editor-panel textarea {
    flex: 1;
    width: 100%;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    resize: none;
    color: #333;
}

.editor-panel textarea:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(54, 74, 111, 0.1);
}

.editor-panel iframe {
    flex: 1;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: white;
}

.editor-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.btn-outline {
    padding: 6px 14px;
    border: 2px solid var(--primary-blue);
    background: white;
    color: var(--primary-blue);
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    transition: all 0.2s;
}

.btn-outline:hover,
.btn-outline.active {
    background: var(--primary-blue);
    color: white;
}

/* Upload Panels */
.upload-row {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
}

.upload-card {
    flex: 1;
    padding: 16px;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.upload-card h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-blue);
    margin-bottom: 10px;
}

.upload-card form {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.upload-card input[type=file] {
    font-size: 13px;
    font-family: inherit;
}

.upload-card button {
    padding: 6px 16px;
    background: var(--primary-blue);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-family: inherit;
    font-weight: 500;
}

.upload-card button:hover {
    background: #2a3d5c;
}

/* Tables and content overrides for daloRADIUS */
table.maintable {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

table.maintable th {
    text-align: left;
    padding: 12px;
    background: #f8fafc;
    border-bottom: 2px solid var(--border-color);
    color: var(--primary-blue);
}

table.maintable td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
}

/* Dashboard Styles */
.dash-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.dash-stat-card {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .04);
    transition: box-shadow .2s, transform .2s;
}

.dash-stat-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, .07);
    transform: translateY(-1px);
}

.dash-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dash-stat-info {
    display: flex;
    flex-direction: column;
}

.dash-stat-num {
    font-size: 26px;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1.2;
}

.dash-stat-label {
    font-size: 12px;
    color: var(--light-gray);
    margin-top: 2px;
}

.dash-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.dash-card {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .04);
}

.dash-card-wide {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .04);
}

.dash-card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.dash-card-header h3 {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a2e;
    margin: 0;
}

.dash-card-body {
    padding: 20px;
}

.dash-quick-link {
    text-decoration: none;
    transition: box-shadow .2s, transform .2s;
    cursor: pointer;
}

.dash-quick-link:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, .07);
    transform: translateY(-1px);
}

/* Service Status List */
.service-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.service-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: #f8f9fc;
    border-radius: 10px;
    transition: background .15s;
}

.service-item:hover {
    background: #f0f2f8;
}

.service-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.service-indicator.online {
    background: #27ae60;
    box-shadow: 0 0 6px rgba(39, 174, 96, 0.4);
}

.service-indicator.offline {
    background: #e74c3c;
    box-shadow: 0 0 6px rgba(231, 76, 60, 0.4);
}

.service-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.service-name {
    font-size: 13px;
    font-weight: 600;
    color: #1a1a2e;
}

.service-status {
    font-size: 11px;
    color: var(--light-gray);
    margin-top: 2px;
}

.service-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    white-space: nowrap;
}

.badge-online {
    background: #e8f5e9;
    color: #2e7d32;
}

.badge-offline {
    background: #fce4ec;
    color: #c62828;
}

@media (max-width: 900px) {
    .dash-row {
        grid-template-columns: 1fr;
    }
}

/* ── Overview Table ──────────────────────────── */
.ov-table {
    width: 100%;
    border-collapse: collapse;
}

.ov-table thead th {
    background: #f8f9fc;
    padding: 11px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    color: var(--light-gray);
    text-transform: uppercase;
    letter-spacing: .4px;
    border-bottom: 1px solid var(--border);
}

.ov-table tbody td {
    padding: 11px 16px;
    font-size: 13px;
    color: #444;
    border-bottom: 1px solid #f5f5f5;
    vertical-align: middle;
}

.ov-table tbody tr:last-child td {
    border-bottom: none;
}

.ov-table tbody tr:hover {
    background: #f8f9fc;
}

.ov-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.ov-badge-local {
    background: #e8f5e9;
    color: #2e7d32;
}

.ov-badge-guest {
    background: #fff3e0;
    color: #e65100;
}

.ov-badge-unauth {
    background: #fce4ec;
    color: #c62828;
}

.ov-action-btn {
    border: none;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    margin-right: 4px;
    transition: opacity .15s;
}

.ov-action-btn:hover {
    opacity: .8;
}

.ov-btn-revoke {
    background: #fff3e0;
    color: #e65100;
}

.ov-btn-delete {
    background: #fce4ec;
    color: #c62828;
}

/* Toast */
#ov-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    color: #fff;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    z-index: 9999;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .2);
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: opacity .25s, transform .25s;
}

#ov-toast.ov-toast-show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

#ov-toast.success {
    background: #27ae60;
}

/* ===== Users List Table (mng-list-all) ===== */
.ul-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.ul-title {
    font-family: 'Poppins', 'Inter', sans-serif;
    font-weight: 500;
    font-size: 18px;
    line-height: 24px;
    color: #364A6F;
    margin: 0;
}

.ul-actions {
    display: flex;
    gap: 12px;
}

.ul-btn {
    box-sizing: border-box;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 10px 16px;
    gap: 8px;
    background: #fff;
    border: 1px solid #D0D5DD;
    border-radius: 8px;
    font-family: 'Poppins', 'Inter', sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 20px;
    color: #103657;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}

.ul-btn:hover {
    background: #f8f9fc;
    border-color: #b0b8cc;
}

.ul-card {
    border: 1px solid #DFE5F9;
    border-radius: 6px;
    background: #fff;
    overflow-x: auto;
    width: 100%;
    max-width: 100%;
}

.ul-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
}

.ul-table thead th {
    background: rgba(240, 241, 246, 0.87);
    border-bottom: 1px solid #F0F1F6;
    font-weight: 400;
    font-size: 14px;
    line-height: 18px;
    color: #364A6F;
    padding: 12px 24px;
    text-align: center;
    white-space: nowrap;
}

.ul-table thead th a {
    color: #364A6F;
    text-decoration: none;
}

.ul-table thead th a:hover {
    text-decoration: underline;
}

.ul-table tbody td {
    padding: 12px 24px;
    border-bottom: 1px solid #F7F7F7;
    font-weight: 400;
    font-size: 14px;
    line-height: 20px;
    color: #8F8F8F;
    text-align: center;
    vertical-align: middle;
}

.ul-table tbody tr:hover {
    background: rgba(240, 241, 246, 0.35);
}

/* ── Responsive tables (Mobile Expandable) ── */
.resp-expand-cell {
    display: none;
    width: 44px;
}

.resp-expand-btn {
    background: none;
    border: none;
    color: #364A6F;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 4px;
    transition: background 0.2s;
    padding: 0;
}

.resp-expand-btn:hover {
    background: rgba(54, 74, 111, 0.1);
}

.resp-expand-btn svg {
    transition: transform 0.2s;
}

.resp-expand-btn.expanded svg {
    transform: rotate(180deg);
}

.resp-detail-row {
    background: #F8F9FA;
}

.resp-detail-list {
    margin: 0;
    padding: 16px 20px;
    list-style: none;
    font-size: 13.5px;
    color: #444;
}

.resp-detail-list li {
    margin-bottom: 8px;
    display: flex;
}

.resp-detail-label {
    font-weight: 600;
    color: #364A6F;
    width: 140px;
    flex-shrink: 0;
}

.resp-detail-value {
    flex: 1;
    word-break: break-word;
}

/* ── Responsive Tables (Mobile Design) ── */
@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }
    
    .resp-expand-cell {
        display: table-cell !important;
    }
    
    .content-wrapper {
        margin-left: 0;
        width: 100%;
    }

    /* Don't hide sidebar — the later transform rule handles slide-in */

    /* ── Responsive forms / structure Adjustments ── */
    .mng-form-grid {
        grid-template-columns: 1fr;
    }

    /* Adjust page-body for mobile */
    .page-body {
        flex-direction: column;
    }

    /* ── Sub-sidebar (ul-subnav): full width ── */
    .ul-subnav {
        width: 100%;
        margin-bottom: 20px;
    }

    .main-content {
        flex-direction: column !important;
        padding: 16px;
    }

    .ul-topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .ul-actions {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 8px;
    }

    /* ── Dashboard Quick Links: stack on mobile ── */
    .dash-row[style*="repeat(3"] {
        grid-template-columns: 1fr !important;
    }

    /* ── Responsive Tabs - Wrap instead of horizontal scroll ── */
    .mng-tabs {
        flex-wrap: wrap !important;
        justify-content: flex-start;
    }

    .mng-tab-btn {
        flex: 1 1 auto;
        text-align: center;
        padding: 8px 12px;
    }

    /* ── Responsive Attribute Rows (Mobile wrapping) ── */
    .attr-row {
        flex-wrap: wrap !important;
        padding: 14px 12px !important;
        gap: 8px !important;
    }

    .attr-label {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        margin-bottom: 4px;
        white-space: normal !important;
    }

    .attr-input {
        flex: 1 1 0% !important;
        height: 44px !important;
    }

    .attr-select {
        flex: 0 0 80px !important;
        height: 44px !important;
    }

    .attr-del-btn {
        flex: 0 0 44px !important;
        width: 44px !important;
        height: 44px !important;
    }
}

/* Checkbox column */
.ul-th-check,
.ul-td-check {
    width: 20px;
    min-width: 20px;
    text-align: center;
    padding-left: 12px !important;
    padding-right: 4px !important;
}

.ul-check {
    width: 14px;
    height: 14px;
    border: 0.8px solid rgba(157, 157, 157, 0.3);
    border-radius: 3px;
    cursor: pointer;
    accent-color: #EFBC85;
}

.ul-check:checked {
    accent-color: #EFBC85;
}

/* Status dot */
.ul-status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
}

.ul-dot-active {
    background: #27ae60;
}

.ul-dot-disabled {
    background: #e74c3c;
}

/* Muted text */
.ul-muted {
    color: #8F8F8F;
}

/* Action column */
.ul-th-action {
    width: 180px;
}

.ul-td-action {
    white-space: nowrap;
}

.ul-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    color: #8F8F8F;
    cursor: pointer;
    border-radius: 4px;
    transition: color .15s, background .15s;
    padding: 0;
    text-decoration: none;
}

.ul-icon-btn:hover {
    color: #364A6F;
    background: rgba(54, 74, 111, 0.06);
}

/* Pagination */
.ul-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 14px 20px;
    border-top: 1px solid #F0F1F6;
}

.ul-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border-radius: 6px;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    color: #364A6F;
    text-decoration: none;
    transition: background .15s;
}

.ul-page-btn:hover {
    background: rgba(240, 241, 246, 0.87);
}

.ul-page-btn.active {
    background: #364A6F;
    color: #fff;
    font-weight: 600;
}

.ul-page-dots {
    font-size: 13px;
    color: #8F8F8F;
    padding: 0 4px;
}

.ul-page-info {
    font-size: 12px;
    color: #8F8F8F;
    margin-left: 16px;
}

/* Sub-sidebar for management pages */
.ul-subnav {
    width: 200px;
    min-width: 200px;
    background: #fff;
    border: 1px solid #DFE5F9;
    border-radius: 6px;
    padding: 16px 0;
    flex-shrink: 0;
}

.ul-subnav-title {
    font-family: 'Poppins', 'Inter', sans-serif;
    font-weight: 500;
    font-size: 14px;
    color: #364A6F;
    padding: 0 16px 12px;
    margin: 0;
    border-bottom: 1px solid #F0F1F6;
}

.ul-subnav-list {
    list-style: none;
    margin: 0;
    padding: 8px 0 0;
}

.ul-subnav-list li {
    margin: 0;
}

.ul-subnav-link {
    display: block;
    padding: 8px 16px;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    color: #8F8F8F;
    text-decoration: none;
    transition: color .15s, background .15s;
    border-left: 3px solid transparent;
}

.ul-subnav-link:hover {
    color: #364A6F;
    background: rgba(240, 241, 246, 0.5);
}

.ul-subnav-link.active {
    color: #364A6F;
    font-weight: 600;
    background: rgba(240, 241, 246, 0.87);
    border-left-color: #364A6F;
}

.ul-subnav-search {
    padding: 8px 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ul-subnav-search label {
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 500;
    color: #8F8F8F;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.ul-subnav-search input[type="text"],
.ul-subnav-search input[type="date"],
.ul-subnav-search input[type="datetime-local"],
.ul-subnav-search select {
    width: 100%;
    padding: 7px 10px;
    font-family: 'Inter', sans-serif;
    font-size: 12.5px;
    color: #364A6F;
    background: #F7F8FC;
    border: 1px solid #DFE5F9;
    border-radius: 6px;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
    box-sizing: border-box;
}

.ul-subnav-search input[type="text"]:focus,
.ul-subnav-search input[type="date"]:focus,
.ul-subnav-search input[type="datetime-local"]:focus,
.ul-subnav-search select:focus {
    border-color: #364A6F;
    box-shadow: 0 0 0 2px rgba(54, 74, 111, 0.10);
    background: #fff;
}

.ul-subnav-search input::placeholder {
    color: #B0B7C8;
    font-weight: 400;
}

.ul-subnav-search .btn-subnav-search {
    width: 100%;
    padding: 7px 0;
    margin-top: 2px;
    font-family: 'Poppins', sans-serif;
    font-size: 12.5px;
    font-weight: 500;
    color: #fff;
    background: #364A6F;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background .2s;
    letter-spacing: 0.3px;
}

.ul-subnav-search .btn-subnav-search:hover {
    background: #2a3d5c;
}

/* ── Management New User / Tabbed Forms ── */
.mng-tabs {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 10px;
    border-bottom: 1px solid #E6E4F0;
    margin-bottom: 28px;
    padding-bottom: 12px;
    scrollbar-width: none; /* Firefox */
}

.mng-tabs::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.mng-tab-btn {
    flex-shrink: 0;
    background: #F7F8FC;
    border: 1px solid #E6E4F0;
    border-radius: 50px;
    padding: 8px 20px;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 14px;
    color: #646464;
    cursor: pointer;
    transition: all .2s ease;
}

.mng-tab-btn:hover {
    color: #364A6F;
    background: #EDF0F7;
    border-color: #D3D9E8;
}

.mng-tab-btn.active {
    color: #fff;
    background: #364A6F;
    border-color: #364A6F;
    box-shadow: 0 4px 12px rgba(54, 74, 111, 0.15);
}

.mng-tab-panel {
    display: none;
}

.mng-tab-panel.active {
    display: block;
}

/* Auth section cards */
.auth-card {
    background: #fff;
    border: 1px solid #E1E7EC;
    border-radius: 11px;
    padding: 28px 32px;
    margin-bottom: 20px;
}

.auth-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.auth-card-header input[type="radio"] {
    accent-color: #364A6F;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.auth-card-header label {
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    font-size: 18px;
    color: #364A6F;
    cursor: pointer;
}

/* Two-column form grid inside cards */
.mng-form-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 18px 24px;
}

.mng-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

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

.mng-form-group label {
    font-family: 'Poppins', sans-serif;
    font-weight: 400;
    font-size: 14px;
    color: #646464;
}

.mng-form-group input[type="text"],
.mng-form-group input[type="password"],
.mng-form-group input[type="date"],
.mng-form-group input[type="datetime-local"],
.mng-form-group select,
.mng-form-group textarea {
    width: 100%;
    box-sizing: border-box;
    height: 44px;
    padding: 0 14px;
    border: 1px solid #E2E2E2;
    border-radius: 6px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: #333;
    background: #fff;
    transition: border-color .2s;
}

.mng-form-group textarea {
    height: 80px;
    padding: 10px 14px;
    resize: vertical;
}

.mng-form-group input:focus,
.mng-form-group select:focus,
.mng-form-group textarea:focus {
    outline: none;
    border-color: #364A6F;
    box-shadow: 0 0 0 3px rgba(54, 74, 111, .1);
}

.mng-form-group input:disabled {
    background: #F5F5F5;
    color: #949494;
}

.mng-form-group .input-with-btn {
    display: flex;
    gap: 8px;
}

.mng-form-group .input-with-btn input {
    flex: 1;
    min-width: 0;
}

.mng-form-group .btn-random {
    background: none;
    border: 1px solid #E2E2E2;
    border-radius: 6px;
    padding: 0 14px;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    color: #364A6F;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s, border-color .15s;
}

.mng-form-group .btn-random:hover {
    background: #f5f5f5;
    border-color: #364A6F;
}

.mng-form-group .group-select-wrap {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.mng-form-group .add-group-link {
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    color: #364A6F;
    text-decoration: none;
    cursor: pointer;
}

.mng-form-group .add-group-link:hover {
    text-decoration: underline;
}

.auth-card-footer {
    margin-top: 24px;
    display: flex;
}

.btn-apply {
    width: 160px;
    height: 43px;
    background: #364A6F;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-weight: 400;
    font-size: 16px;
    cursor: pointer;
    transition: background .2s;
}

.btn-apply:hover {
    background: #2a3d5c;
}

/* Section heading inside user info / billing */
.mng-section-title {
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    font-size: 18px;
    color: #364A6F;
    margin: 28px 0 16px;
    padding: 0;
}

.mng-section-title:first-child {
    margin-top: 0;
}

.mng-form-card {
    background: #fff;
    border: 1px solid #E1E7EC;
    border-radius: 11px;
    padding: 28px 32px;
    margin-bottom: 20px;
}

/* Checkbox row */
.mng-check-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.mng-check-row input[type="checkbox"] {
    accent-color: #364A6F;
    width: 16px;
    height: 16px;
}

.mng-check-row label {
    font-family: 'Poppins', sans-serif;
    font-weight: 400;
    font-size: 14px;
    color: #646464;
}

/* Attributes vendor/attribute section */
.attr-radio-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.attr-radio-row input[type="radio"] {
    accent-color: #364A6F;
    width: 16px;
    height: 16px;
}

.attr-radio-row label {
    font-family: 'Poppins', sans-serif;
    font-weight: 400;
    font-size: 16px;
    color: #646464;
}

/* ── Responsive Attribute Rows for RADIUS Check/Reply ── */
.attr-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #F8F9FA;
    border: 1px solid #E1E7EC;
    border-radius: 8px;
    margin-bottom: 12px;
    transition: background .2s, border-color .2s;
}

.attr-row:hover {
    background: #fff;
    border-color: #DFE5F9;
}

.attr-del-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(230, 57, 70, 0.1);
    color: #E63946;
    border-radius: 6px;
    transition: all .2s;
    text-decoration: none;
    flex-shrink: 0;
}

.attr-del-btn:hover {
    background: #E63946;
    color: #FFF;
}

.attr-label {
    flex: 0 0 160px;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #364A6F;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.attr-input {
    flex: 1;
    min-width: 0;
    height: 38px;
    padding: 0 10px;
    border: 1px solid #DFE5F9;
    border-radius: 6px;
    font-family: 'Inter', sans-serif;
    font-size: 13.5px;
    color: #333;
    outline: none;
    transition: border-color .2s;
    box-sizing: border-box;
}

.attr-input:focus {
    border-color: #364A6F;
}

.attr-select {
    width: 70px;
    flex-shrink: 0;
    height: 38px;
    padding: 0 4px;
    border: 1px solid #DFE5F9;
    border-radius: 6px;
    background: #fff;
    outline: none;
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    color: #364A6F;
    box-sizing: border-box;
}

/* Action messages */
.mng-alert {
    padding: 14px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
}

.mng-alert-success {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}

.mng-alert-danger {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

#ov-toast.error {
    background: #e74c3c;
}

/* ═══════════════════════════════════════════════
   MOBILE RESPONSIVE — ADDONS ONLY (≤ 768px)
   Append to end of stylesheet. Nothing above is changed.
═══════════════════════════════════════════════ */

/* Hamburger toggle button (injected by JS below) */
#mob-menu-btn {
    display: none;
    position: fixed;
    top: 20px;
    left: 16px;
    z-index: 1200;
    background: var(--bg-sidebar);
    border: none;
    border-radius: 6px;
    width: 40px;
    height: 40px;
    cursor: pointer;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 0;
}

#mob-menu-btn span {
    display: block;
    width: 20px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: transform 0.3s, opacity 0.3s;
}

#mob-menu-btn.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

#mob-menu-btn.open span:nth-child(2) {
    opacity: 0;
}

#mob-menu-btn.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Dim overlay behind open sidebar */
#mob-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 999;
}

#mob-overlay.visible {
    display: block;
}

@media (max-width: 768px) {

    /* Show hamburger */
    #mob-menu-btn {
        display: flex;
    }

    /* ── Sidebar: hidden off-screen, slides in ── */
    .app-sidebar {
        display: flex !important;
        position: fixed !important;
        top: 0 !important;
        left: -250px !important;
        height: 100vh !important;
        width: 200px !important;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        z-index: 1100 !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    .app-sidebar.mob-open {
        left: 0 !important;
        box-shadow: 4px 0 24px rgba(0,0,0,0.15);
    }

    /* ── Content wrapper: full width ── */
    .content-wrapper {
        margin-left: 0 !important;
        width: 100% !important;
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }

    /* ── Prevent horizontal scroll globally ── */
    html, body {
        overflow-x: hidden !important;
        max-width: 100vw !important;
    }
    .main-content {
        overflow-x: hidden;
        max-width: 100%;
        display: block !important;
    }

    /* ── Top header: accommodate hamburger and long titles ── */
    .top-header {
        padding-left: 64px;
        height: auto;
        min-height: var(--header-height);
        padding-top: 12px;
        padding-bottom: 12px;
        align-items: flex-start;
    }

    .header-page-title {
        font-size: 16px;
        line-height: 22px;
    }

    .header-page-desc {
        font-size: 12px;
        line-height: 18px;
        margin-top: 2px;
    }

    /* ── Collapse search bar to icon on very small screens ── */
    .header-search {
        width: 160px;
    }

    /* ── Page body: stack sidebar + content ── */
    .page-body {
        flex-direction: column;
    }

    /* ── Legacy #sidebar: static, full width ── */
    #sidebar {
        width: 100%;
        min-width: unset;
        height: auto;
        position: static;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    /* ── Dashboard grid: 1 column ── */
    .dash-stats {
        grid-template-columns: 1fr 1fr;
    }

    .dash-row {
        grid-template-columns: 1fr;
    }

    /* ── Upload cards: stack vertically ── */
    .upload-row {
        flex-direction: column;
    }

    /* ── Editor layout: stack panels ── */
    .editor-layout {
        flex-direction: column;
        height: auto;
    }

    .editor-panel textarea,
    .editor-panel iframe {
        height: 280px;
    }

    /* ── Form grid: 1 column ── */
    .mng-form-grid {
        grid-template-columns: 1fr;
    }

    /* ── Auth card padding reduction ── */
    .auth-card,
    .mng-form-card {
        padding: 20px 16px;
    }

    /* ── Sub-sidebar (ul-subnav): full width ── */
    .ul-subnav {
        width: 100%;
        min-width: unset;
        border-bottom: 1px solid #DFE5F9;
        border-right: none;
        display: block !important;
        margin-bottom: 20px;
    }

    /* ── Tables: allow horizontal scroll ── */
    .ul-card,
    .dash-card,
    .dash-card-wide {
        overflow-x: visible; /* Changed from auto to prevent scrollbar since tables are responsive */
    }

    .ul-table,
    .ov-table,
    table.maintable {
        min-width: unset;
        width: 100%;
        table-layout: auto;
        word-break: break-word;
    }

    .ul-table tbody td,
    .ov-table tbody td,
    .ul-table thead th,
    .ov-table thead th {
        padding: 8px 10px !important; /* Reduce padding on mobile */
        white-space: normal !important; /* Allow wrapping to prevent overflow */
    }

    /* Keep action buttons gracefully side by side */
    .ul-table tbody td:last-child,
    .ov-table tbody td:last-child {
        white-space: nowrap !important;
        text-align: right;
    }

    /* ── Module tools: single column ── */
    .module-tools {
        flex-direction: column;
    }

    /* ── Tab buttons: scrollable row ── */
    .mng-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* ── Topbar: stack actions ── */
    .ul-topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .ul-actions {
        width: 100%;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 4px;
    }

    /* ── Stat cards: stack icon + text ── */
    .dash-stat-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    /* ── Quick links: stack to 1 column ── */
    .dash-row {
        grid-template-columns: 1fr !important;
    }

    /* ── Quick link cards: prevent text truncation ── */
    .dash-quick-link .dash-card-body {
        flex-wrap: nowrap;
        min-width: 0;
    }

    .dash-quick-link .dash-card-body>div:last-child {
        min-width: 0;
    }

    .dash-quick-link .dash-card-body span {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
}

@media (max-width: 480px) {
    .dash-stats {
        grid-template-columns: 1fr;
    }

    .header-search {
        display: none;
        /* hide search on very small phones */
    }

    .main-content,
    #contentnorightbar,
    #content {
        padding: 16px;
    }
}

/* ── Responsive Expandable Tables ── */
@media (max-width: 768px) {
    .hide-mobile { display: none !important; }
}

/* Expansion column styling */
th.resp-expand-th, td.resp-expand-cell {
    width: 32px;
    min-width: 32px;
    text-align: center;
    cursor: pointer;
    vertical-align: middle;
}

.resp-expand-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: transparent;
    color: var(--primary-blue);
    border-radius: 4px;
    transition: transform 0.2s, background 0.2s;
    cursor: pointer;
}

.resp-expand-btn svg {
    width: 18px;
    height: 18px;
    transition: transform 0.2s ease;
}

tr.expanded .resp-expand-btn svg {
    transform: rotate(180deg);
}

.resp-expand-btn:hover {
    background: rgba(54, 74, 111, 0.08);
}

@media (min-width: 769px) {
    /* Hide the expansion cell entirely on larger screens, assuming the table is fully visible */
    th.resp-expand-th, td.resp-expand-cell {
        display: none !important;
    }
    .resp-child-row {
        display: none !important;
    }
}

/* Child row card */
.resp-child-row td {
    padding: 12px 14px !important;
    background: #FAFAFD;
    border-bottom: 2px solid var(--border-color);
}

.resp-detail-card {
    background: #fff;
    border: 1px solid #E1E7EC;
    border-radius: 10px;
    padding: 18px 20px;
    box-shadow: 0 4px 16px rgba(54, 74, 111, 0.06);
}

.resp-detail-header {
    display: flex;
    align-items: center;
    font-size: 15px;
    font-weight: 600;
    color: var(--primary-blue);
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid #E1E7EC;
}

.resp-header-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
    color: #BF9E5C; 
}

.resp-header-icon svg {
    stroke-width: 2.2;
}

.resp-detail-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.resp-detail-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px dashed #E6E4F0;
    font-size: 13.5px;
}

.resp-detail-list li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.resp-detail-label {
    font-weight: 500;
    color: var(--light-gray);
    flex-shrink: 0;
    margin-right: 16px;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.3px;
}

.resp-detail-value {
    color: #1a1a2e;
    text-align: right;
    word-break: break-word;
    font-weight: 500;
}

/* Entrance animation */
@keyframes dropdownFade {
    0% { opacity: 0; transform: translateY(-10px); }
    100% { opacity: 1; transform: translateY(0); }
}

.animated-drop {
    animation: dropdownFade 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ===== Mobile Schublade: Schließen-Knopf lag auf dem Logo ===== */
@media (max-width: 768px) {
    /* Geschlossen bleibt der Knopf oben links; offen wandert er an den
       rechten Rand der Schublade (Breite 200px). */
    #mob-menu-btn.open {
        left: auto !important;
        right: calc(100vw - 200px + 10px) !important;
        top: 12px !important;
        background: transparent !important;
    }
    /* Logo bekommt eine eigene Zeile unter dem Knopf */
    .app-sidebar .sidebar-logo {
        padding-top: 40px;
        margin-bottom: 24px;
    }
    .app-sidebar .sidebar-logo img {
        max-width: 130px;
        margin: 0 auto;
        display: block;
    }
}
