/* ==========================================================================
   RAMCHAND LEAD ADMIN PORTAL - MASTER STYLESHEET
   Theme: Premium Emerald Green SaaS Theme
   Features: Dynamic Logo Switching, Anti-Flicker, Zero Horizontal Scrollbars,
             Password Toggle & Readonly Form Helpers
   ========================================================================== */

:root {
    /* Color Palette - Emerald Green SaaS */
    --bg-app: #f8fafc;
    --surface-white: #ffffff;
    --surface-muted: #f1f5f9;
    --border-subtle: #e2e8f0;
    --border-strong: #cbd5e1;

    --text-heading: #0f172a;
    --text-body: #334155;
    --text-muted: #64748b;
    --text-light: #94a3b8;

    --primary: #059669;
    --primary-hover: #047857;
    --primary-light: #ecfdf5;
    --primary-border: #a7f3d0;

    --sidebar-bg: linear-gradient(180deg, #064e3b 0%, #022c22 100%);
    --sidebar-text: #a7f3d0;
    --sidebar-text-active: #ffffff;
    --sidebar-border: rgba(255, 255, 255, 0.12);

    --success-bg: #ecfdf5;
    --success-text: #047857;
    --success-border: #a7f3d0;

    --danger-bg: #fef2f2;
    --danger-text: #b91c1c;
    --danger-border: #fecaca;

    --warning-bg: #fffbeb;
    --warning-text: #b45309;
    --warning-border: #fde68a;

    /* Layout Dimensions */
    --sidebar-collapsed-width: 72px;
    --sidebar-expanded-width: 270px;
    --header-height: 70px;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.06), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.07), 0 4px 6px -4px rgba(0, 0, 0, 0.03);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.02);
}

/* Reset & Base Setup */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    background-color: var(--bg-app);
    color: var(--text-body);
    min-height: 100vh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}

/* ==========================================================================
   IMAGE LOGO & DYNAMIC LOGO SWITCHING
   ========================================================================== */
.brand-logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    overflow: hidden;
}

.sidebar:hover .brand-logo-container,
.sidebar.is-pinned .brand-logo-container,
.sidebar-pinned-init .brand-logo-container {
    justify-content: flex-start !important;
    width: auto !important;
}

.brand-logo-small {
    display: block;
    height: 36px;
    width: 36px;
    object-fit: cover;
    border-radius: 25%;
    overflow: hidden;
    flex-shrink: 0;
    margin: 0 auto;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.brand-logo-full {
    display: none;
    height: 38px;
    max-width: 170px;
    object-fit: contain;
    flex-shrink: 0;
}

.sidebar:hover .brand-logo-small,
.sidebar.is-pinned .brand-logo-small,
.sidebar-pinned-init .brand-logo-small {
    display: none !important;
}

.sidebar:hover .brand-logo-full,
.sidebar.is-pinned .brand-logo-full,
.sidebar-pinned-init .brand-logo-full {
    display: block !important;
}

.brand-logo-img-auth {
    height: 48px;
    max-width: 240px;
    object-fit: contain;
}

/* ==========================================================================
   AUTH PAGES (LOGIN)
   ========================================================================== */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: radial-gradient(circle at 50% 0%, #d1fae5 0%, #f8fafc 75%);
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--surface-white);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    padding: 40px 32px;
    box-shadow: var(--shadow-xl);
    animation: fadeIn 0.3s ease-out;
}

.auth-brand-center {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

.auth-heading {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-heading);
    text-align: center;
    margin-bottom: 4px;
}

.auth-subheading {
    font-size: 14px;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 24px;
}

/* ==========================================================================
   COLLAPSIBLE HOVER & PINNED SIDEBAR
   ========================================================================== */
.app-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
    overflow-x: hidden;
}

.sidebar {
    width: var(--sidebar-collapsed-width);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1000 !important;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
}

.sidebar:hover,
.sidebar.is-pinned,
.sidebar-pinned-init .sidebar {
    width: var(--sidebar-expanded-width) !important;
    box-shadow: 10px 0 25px rgba(0, 0, 0, 0.25);
    z-index: 1000 !important;
}

.sidebar-brand {
    height: var(--header-height);
    padding: 0 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--sidebar-border);
    gap: 8px;
    flex-shrink: 0;
}

.sidebar:hover .sidebar-brand,
.sidebar.is-pinned .sidebar-brand,
.sidebar-pinned-init .sidebar-brand {
    padding: 0 14px !important;
    justify-content: space-between !important;
}

.sidebar-pin-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #a7f3d0;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    flex-shrink: 0;
    opacity: 0;
    visibility: hidden;
}

.sidebar:hover .sidebar-pin-btn,
.sidebar.is-pinned .sidebar-pin-btn,
.sidebar-pinned-init .sidebar-pin-btn {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.sidebar-pin-btn:hover {
    background: var(--primary);
    color: white;
}

.sidebar.is-pinned .sidebar-pin-btn,
.sidebar-pinned-init .sidebar-pin-btn {
    background: var(--primary);
    color: white;
}

.sidebar-menu {
    padding: 16px 10px;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.sidebar-menu::-webkit-scrollbar {
    width: 4px;
}

.sidebar-menu::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-menu::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.sidebar-menu::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.4);
}

.sidebar-section-title {
    font-size: 10px;
    font-weight: 700;
    color: #6ee7b7;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0 10px;
    margin-bottom: 4px;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.2s ease;
    flex-shrink: 0;
}

.sidebar:hover .sidebar-section-title,
.sidebar.is-pinned .sidebar-section-title,
.sidebar-pinned-init .sidebar-section-title {
    opacity: 1 !important;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 12px;
    color: var(--sidebar-text);
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 600;
    transition: all 0.15s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.sidebar-link:hover {
    color: var(--sidebar-text-active);
    background: rgba(255, 255, 255, 0.08);
}

.sidebar-link.active {
    color: #ffffff;
    background: var(--primary);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.4);
}

.sidebar-link i {
    width: 20px;
    font-size: 17px;
    flex-shrink: 0;
    text-align: center;
}

.sidebar-link span {
    opacity: 0;
    transition: opacity 0.2s ease;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar:hover .sidebar-link span,
.sidebar.is-pinned .sidebar-link span,
.sidebar-pinned-init .sidebar-link span {
    opacity: 1 !important;
}

.sidebar-footer {
    padding: 12px;
    border-top: 1px solid var(--sidebar-border);
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
}

.user-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px;
    width: 100%;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    white-space: nowrap;
}

.user-avatar {
    width: 34px;
    height: 34px;
    background: var(--primary);
    color: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 13px;
    flex-shrink: 0;
    margin: 0 auto;
}

.sidebar:hover .user-avatar,
.sidebar.is-pinned .user-avatar,
.sidebar-pinned-init .user-avatar {
    margin: 0;
}

.user-details {
    opacity: 0;
    width: 0;
    transition: opacity 0.2s ease, width 0.2s ease;
    display: none;
    overflow: hidden;
}

.sidebar:hover .user-details,
.sidebar.is-pinned .user-details,
.sidebar-pinned-init .user-details {
    opacity: 1 !important;
    width: auto !important;
    display: block !important;
}

.user-name {
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 11px;
    color: #a7f3d0;
    font-weight: 500;
}

.sidebar-logout-btn {
    width: 100%;
    height: 36px;
    padding: 0 10px;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
    transition: all 0.2s;
}

.sidebar-logout-btn:hover {
    background: #dc2626;
    color: white;
}

.sidebar-logout-btn i {
    flex-shrink: 0;
    font-size: 15px;
}

.sidebar-logout-btn span {
    opacity: 0;
    width: 0;
    display: none;
    transition: opacity 0.2s ease;
}

.sidebar:hover .sidebar-logout-btn span,
.sidebar.is-pinned .sidebar-logout-btn span,
.sidebar-pinned-init .sidebar-logout-btn span {
    opacity: 1 !important;
    width: auto !important;
    display: inline !important;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    z-index: 45;
}

/* Main Area Adjustment */
.main-wrapper {
    margin-left: var(--sidebar-collapsed-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.main-wrapper.is-pinned,
.sidebar-pinned-init .main-wrapper {
    margin-left: var(--sidebar-expanded-width) !important;
}

/* ==========================================================================
   TOP HEADER, BACK BUTTON & AUTO BREADCRUMBS
   ========================================================================== */
.top-header {
    height: var(--header-height);
    background: var(--surface-white);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 30;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.mobile-toggle {
    display: none;
    background: none;
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 16px;
    color: var(--text-heading);
    cursor: pointer;
}

.back-btn {
    background: var(--surface-muted);
    border: 1px solid var(--border-subtle);
    color: var(--text-body);
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s ease;
}

.back-btn:hover {
    background: var(--border-subtle);
    color: var(--text-heading);
    transform: translateX(-2px);
}

.breadcrumb-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-weight: 500;
}

.breadcrumb-link {
    color: var(--text-muted);
    transition: color 0.15s;
}

.breadcrumb-link:hover {
    color: var(--primary);
}

.breadcrumb-active {
    color: var(--text-heading);
    font-weight: 700;
}

.breadcrumb-separator {
    color: var(--text-light);
    font-size: 10px;
}

.page-title {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-heading);
    letter-spacing: -0.4px;
}

.content-body {
    padding: 32px;
    flex: 1;
}

/* ==========================================================================
   METRIC CARDS & TABLES
   ========================================================================== */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.metric-card {
    background: var(--surface-white);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.metric-value {
    font-size: 32px;
    font-weight: 800;
    color: var(--text-heading);
    line-height: 1;
    margin-bottom: 6px;
}

.metric-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
}

.metric-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

/* Cards & Tables */
.content-card {
    background: var(--surface-white);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.card-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-heading);
}

.card-subtitle {
    font-size: 13px;
    color: var(--text-muted);
}

.table-wrapper {
    width: 100%;
    overflow-x: auto;
}

.saas-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 14px;
}

.saas-table th {
    padding: 14px 20px;
    background: var(--surface-muted);
    color: var(--text-muted);
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-subtle);
}

.saas-table td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-body);
    vertical-align: middle;
}

.saas-table tr:hover td {
    background: rgba(248, 250, 252, 0.8);
}

/* Avatar & Badges */
.table-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar-small {
    width: 36px;
    height: 36px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}

.badge-active {
    background: var(--success-bg);
    color: var(--success-text);
    border: 1px solid var(--success-border);
}

.badge-inactive {
    background: var(--danger-bg);
    color: var(--danger-text);
    border: 1px solid var(--danger-border);
}

.code-pill {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 12px;
    font-weight: 700;
    color: var(--primary);
    background: var(--primary-light);
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid var(--primary-border);
}

/* ==========================================================================
   FORM CONTROLS, READONLY HELPERS & PASSWORD EYE TOGGLE
   ========================================================================== */
.btn {
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid transparent;
    transition: all 0.15s ease;
    text-decoration: none;
    justify-content: center;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 4px rgba(5, 150, 105, 0.25);
}

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 4px 8px rgba(5, 150, 105, 0.35);
}

.btn-secondary {
    background: var(--surface-white);
    border-color: var(--border-subtle);
    color: var(--text-body);
}

.btn-secondary:hover {
    background: var(--surface-muted);
    border-color: var(--border-strong);
    color: var(--text-heading);
}

.btn-danger-light {
    background: var(--danger-bg);
    border-color: var(--danger-border);
    color: var(--danger-text);
}

.btn-danger-light:hover {
    background: #fde8e8;
}

.btn-icon-btn {
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: 8px;
}

.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-heading);
    margin-bottom: 6px;
}

.input-wrapper {
    position: relative;
    width: 100%;
}

.input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 15px;
}

.form-input,
.form-select {
    width: 100%;
    padding: 10px 14px;
    background: var(--surface-white);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    color: var(--text-heading);
    font-size: 14px;
    outline: none;
    transition: all 0.15s ease;
}

.readonly-input {
    background: var(--surface-muted) !important;
    color: var(--text-muted) !important;
    border-color: var(--border-subtle) !important;
    font-weight: 700;
    cursor: not-allowed;
}

.password-toggle-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 15px;
    cursor: pointer;
    padding: 4px;
    transition: color 0.15s ease;
}

.password-toggle-btn:hover {
    color: var(--primary);
}

.input-with-icon {
    padding-left: 40px;
}

.form-input:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15);
}

/* ==========================================================================
   SELECT2 OVERRIDES
   ========================================================================== */
.select2-container--default .select2-selection--single {
    height: 42px !important;
    background-color: var(--surface-white) !important;
    border: 1px solid var(--border-subtle) !important;
    border-radius: 10px !important;
    display: flex !important;
    align-items: center !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--text-heading) !important;
    font-size: 14px !important;
    padding-left: 14px !important;
    padding-right: 28px !important;
    line-height: 40px !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 40px !important;
    right: 8px !important;
}

.select2-dropdown {
    border: 1px solid var(--border-subtle) !important;
    border-radius: 10px !important;
    box-shadow: var(--shadow-lg) !important;
    overflow: hidden !important;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: var(--primary) !important;
    color: white !important;
}

/* ==========================================================================
   MODALS
   ========================================================================== */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.modal-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.modal-dialog {
    background: var(--surface-white);
    border: 1px solid var(--border-subtle);
    border-radius: 18px;
    width: 100%;
    max-width: 540px;
    box-shadow: var(--shadow-xl);
    transform: scale(0.96) translateY(10px);
    transition: all 0.2s ease;
    overflow: hidden;
}

.modal-backdrop.active .modal-dialog {
    transform: scale(1) translateY(0);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-heading);
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text-heading);
}

.modal-body {
    padding: 24px;
    max-height: 75vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-subtle);
    background: var(--surface-muted);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.full-width {
    grid-column: span 2;
}

/* ==========================================================================
   RESPONSIVE MEDIA QUERIES
   ========================================================================== */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
        width: var(--sidebar-expanded-width) !important;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay.open {
        display: block;
    }

    .main-wrapper,
    .main-wrapper.is-pinned,
    .sidebar-pinned-init .main-wrapper {
        margin-left: 0 !important;
    }

    .mobile-toggle {
        display: block;
    }

    .top-header {
        padding: 0 20px;
    }

    .content-body {
        padding: 20px;
    }

    .sidebar-pin-btn {
        display: none !important;
    }

    .sidebar-link span,
    .sidebar-section-title,
    .user-details,
    .sidebar-logout-btn span {
        opacity: 1 !important;
        display: inline !important;
        width: auto !important;
    }

    .brand-logo-small {
        display: none !important;
    }

    .brand-logo-full {
        display: block !important;
    }
}

@media (max-width: 640px) {
    .form-grid {
        grid-template-columns: 1fr;
    }

    .full-width {
        grid-column: span 1;
    }

    .card-header {
        flex-direction: column;
        align-items: stretch;
    }

    .modal-dialog {
        margin: 10px;
        max-height: 90vh;
    }
}

/* Compact Sidebar Layout for Small Laptops (1366x768 / 1280x720 / height <= 850px) */
@media (max-height: 850px) and (min-width: 993px) {
    :root {
        --header-height: 56px;
    }

    .sidebar-brand {
        height: 56px;
    }

    .brand-logo-small {
        height: 30px;
        width: 30px;
    }

    .brand-logo-full {
        height: 30px;
    }

    .sidebar-menu {
        padding: 10px 8px;
        gap: 3px;
    }

    .sidebar-section-title {
        margin-bottom: 2px;
        font-size: 9px;
    }

    .sidebar-link {
        padding: 7px 10px;
        gap: 10px;
        font-size: 13px;
        border-radius: 8px;
    }

    .sidebar-link i {
        font-size: 15px;
        width: 18px;
    }

    .sidebar-footer {
        padding: 8px;
        gap: 6px;
    }

    .user-card {
        padding: 4px 6px;
    }

    .user-avatar {
        width: 28px;
        height: 28px;
        font-size: 11px;
        border-radius: 6px;
    }

    .user-name {
        font-size: 12px;
    }

    .user-role {
        font-size: 10px;
    }

    .sidebar-logout-btn {
        height: 32px;
        font-size: 12px;
        border-radius: 6px;
    }
}