/**
 * Little Magic - Admin Portal Master Stylesheet (css/admin-portal.css)
 * Extracted for performance, modularity & instant browser caching
 */

:root {
      --bg-dark: #090214;
      --bg-card: rgba(255, 255, 255, 0.03);
      --bg-card-hover: rgba(255, 255, 255, 0.06);
      --border-color: rgba(255, 255, 255, 0.08);
      --accent-gold: #ffd700;
      --accent-purple: #8b5cf6;
      --text-main: #f3f4f6;
      --text-muted: #9ca3af;
      --error-color: #ef4444;
      --success-color: #10b981;
    }

    * {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
      font-family: 'Plus Jakarta Sans', sans-serif;
    }

    select,
    option,
    select.filter-select,
    .form-control {
      color-scheme: dark !important;
    }

    select option {
      background-color: #0b0517 !important;
      color: #ffffff !important;
      padding: 10px !important;
    }

    select option:hover,
    select option:focus,
    select option:active,
    select option:checked {
      background-color: #ffd700 !important;
      background: #ffd700 !important;
      color: #000000 !important;
      font-weight: 800 !important;
      box-shadow: 0 0 10px 100px #ffd700 inset !important;
    }

    html, body {
      width: 100% !important;
      height: 100% !important;
      min-width: 100% !important;
      min-height: 100% !important;
      margin: 0 !important;
      padding: 0 !important;
      overflow: hidden !important;
      position: absolute !important;
      top: 0 !important;
      left: 0 !important;
      right: 0 !important;
      bottom: 0 !important;
      display: flex !important;
      background-color: var(--bg-dark);
      color: var(--text-main);
    }

    /* Login Screen Overlay */
    #login-overlay {
      position: fixed !important;
      top: 0 !important;
      left: 0 !important;
      right: 0 !important;
      bottom: 0 !important;
      width: 100% !important;
      height: 100% !important;
      min-width: 100% !important;
      min-height: 100% !important;
      background: radial-gradient(circle at center, #1b0b30 0%, var(--bg-dark) 100%);
      z-index: 1000;
      display: flex;
      justify-content: center;
      align-items: center;
      padding: 20px;
    }

    .login-card {
      background: rgba(15, 7, 30, 0.6);
      border: 1.5px solid var(--border-color);
      backdrop-filter: blur(20px);
      padding: 40px;
      border-radius: 24px;
      width: 100%;
      max-width: 420px;
      box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
      text-align: center;
    }

    .login-logo {
      font-family: 'Outfit', sans-serif;
      font-weight: 800;
      font-size: 2.2rem;
      background: linear-gradient(135deg, #FFEA00 0%, #EC4899 50%, #3B82F6 100%);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      margin-bottom: 8px;
      text-align: center;
    }

    .login-subtitle {
      color: var(--text-muted);
      font-size: 0.9rem;
      margin-bottom: 30px;
    }

    .form-group {
      text-align: left;
      margin-bottom: 20px;
    }

    .form-group label {
      display: block;
      font-size: 0.8rem;
      font-weight: 600;
      color: var(--text-muted);
      margin-bottom: 8px;
      text-transform: uppercase;
      letter-spacing: 0.05em;
    }

    .form-control {
      width: 100%;
      background: rgba(255, 255, 255, 0.05);
      border: 1.5px solid var(--border-color);
      border-radius: 12px;
      padding: 12px 16px;
      color: #fff;
      font-size: 0.95rem;
      transition: all 0.3s ease;
    }

    .form-control:focus {
      outline: none;
      border-color: var(--accent-gold);
      box-shadow: none;
      background: rgba(255, 255, 255, 0.08);
    }

    /* Style all Select Controls with Gold Chevron Arrow, Ample 38px Right Padding, and Dark Option Theme */
    select.form-control,
    select.filter-select {
      appearance: none !important;
      -webkit-appearance: none !important;
      -moz-appearance: none !important;
      background-color: rgba(15, 7, 30, 0.9) !important;
      border: 1.5px solid var(--border-color);
      border-radius: 12px;
      color: #ffffff !important;
      padding: 10px 38px 10px 16px !important;
      font-weight: 600;
      cursor: pointer;
      outline: none;
      box-sizing: border-box;
      background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffd700' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e") !important;
      background-repeat: no-repeat !important;
      background-position: right 14px center !important;
      background-size: 13px 13px !important;
      transition: border-color 0.2s ease;
    }

    select.form-control:focus,
    select.filter-select:focus {
      border-color: var(--accent-gold) !important;
    }

    /* Style option dropdowns to use portal theme yellow color and avoid light blue OS highlights */
    select option,
    .form-control option,
    .filter-select option {
      background-color: #110922 !important;
      color: #ffffff !important;
      padding: 10px 14px !important;
      font-size: 0.88rem !important;
      font-weight: 600 !important;
    }

    select option:hover,
    select option:focus,
    select option:active,
    select option:checked {
      background-color: #ffd700 !important;
      background: #ffd700 !important;
      color: #000000 !important;
      font-weight: 800 !important;
      box-shadow: 0 0 10px 100px #ffd700 inset !important;
    }

    .flatpickr-calendar {
      z-index: 999999 !important;
      background: #130a24 !important;
      border: 1.5px solid var(--accent-gold) !important;
      box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6) !important;
    }

    .save-all-ads-btn {
      width: auto !important;
      width: fit-content !important;
      display: inline-flex !important;
      align-items: center !important;
      justify-content: center !important;
      flex-shrink: 0 !important;
      transition: all 0.2s ease !important;
    }

    .ads-save-details-btn {
      transition: all 0.2s ease !important;
    }

    .save-all-ads-btn:hover,
    .ads-save-details-btn:hover {
      transform: translateY(-1px) !important;
      filter: brightness(1.12) !important;
      box-shadow: 0 4px 14px rgba(247, 211, 106, 0.4) !important;
    }

    .save-all-ads-btn.unsaved:hover {
      background: rgba(247, 211, 106, 0.28) !important;
      border-color: var(--accent-gold) !important;
    }

    .btn {
      width: 100%;
      background: linear-gradient(135deg, var(--accent-gold), #e6b800);
      color: #000;
      border: none;
      padding: 14px;
      border-radius: 12px;
      font-weight: 700;
      font-size: 0.95rem;
      cursor: pointer;
      transition: all 0.3s ease;
      box-shadow: none;
    }

    .btn:hover {
      transform: translateY(-2px);
      box-shadow: none;
    }

    .btn-secondary {
      background: rgba(255, 255, 255, 0.08);
      color: #fff;
      border: 1.5px solid var(--border-color);
      box-shadow: none;
      margin-top: 10px;
    }

    .btn-secondary:hover {
      background: rgba(255, 255, 255, 0.12);
      box-shadow: none;
    }

    /* Global custom ultra-thin gold scrollbar matching portal theme */
    * {
      scrollbar-width: thin !important;
      scrollbar-color: rgba(255, 215, 0, 0.25) transparent !important;
    }

    *::-webkit-scrollbar,
    ::-webkit-scrollbar {
      width: 4px !important;
      height: 4px !important;
    }

    *::-webkit-scrollbar-track,
    ::-webkit-scrollbar-track {
      background: transparent !important;
    }

    *::-webkit-scrollbar-thumb,
    ::-webkit-scrollbar-thumb {
      background: rgba(255, 215, 0, 0.25) !important;
      border-radius: 4px !important;
    }

    *::-webkit-scrollbar-thumb:hover,
    ::-webkit-scrollbar-thumb:hover {
      background: rgba(255, 215, 0, 0.5) !important;
    }

    .login-error {
      color: var(--error-color);
      font-size: 0.85rem;
      margin-top: 15px;
      display: none;
    }

    /* Main Application Wrapper */
    #admin-app {
      display: none;
      /* Shown after auth */
      width: 100% !important;
      height: 100% !important;
      min-width: 100% !important;
      min-height: 100% !important;
      position: absolute !important;
      top: 0 !important;
      left: 0 !important;
      right: 0 !important;
      bottom: 0 !important;
      display: flex !important;
      box-sizing: border-box !important;
      overflow: hidden !important;
    }

    /* Sidebar Base & Iconic Collapsible States */
    .sidebar {
      width: 200px;
      background: rgba(10, 5, 20, 0.95);
      border-right: 1.5px solid var(--border-color);
      padding: 20px 10px;
      display: flex;
      flex-direction: column;
      flex-shrink: 0;
      height: 100%;
      position: relative;
      top: 0;
      box-sizing: border-box;
      transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1), padding 0.25s ease;
      overflow-y: auto;
      overflow-x: hidden !important;
      scrollbar-width: thin;
    }

    /* Custom thin sidebar scrollbar: reduced to 3px to avoid chunky appearance */
    .sidebar {
      scrollbar-width: thin !important;
      scrollbar-color: rgba(255, 215, 0, 0.2) transparent !important;
    }
    .sidebar::-webkit-scrollbar {
      width: 3px !important;
      height: 0px !important;
    }
    .sidebar::-webkit-scrollbar-track {
      background: transparent !important;
    }
    .sidebar::-webkit-scrollbar-thumb {
      background: rgba(255, 215, 0, 0.2) !important;
      border-radius: 3px !important;
    }
    .sidebar::-webkit-scrollbar-thumb:hover {
      background: rgba(255, 215, 0, 0.45) !important;
    }

    .nav-section-title {
      font-size: 0.65rem;
      font-weight: 800;
      letter-spacing: 1.2px;
      text-transform: uppercase;
      color: rgba(255, 255, 255, 0.35);
      padding: 14px 12px 4px 12px;
      margin-top: 4px;
      user-select: none;
      display: block;
      width: 100%;
    }

    .nav-section-title .nav-section-text {
      display: block;
    }

    .nav-section-title .nav-section-divider {
      display: none;
    }

    .sidebar.collapsed {
      width: 60px !important;
      padding: 16px 2px !important;
      align-items: center !important;
      overflow-x: hidden !important;
    }

    .sidebar.collapsed .nav-section-title {
      display: flex !important;
      justify-content: center !important;
      align-items: center !important;
      padding: 6px 0 !important;
      margin: 4px 0 !important;
      width: 100% !important;
    }

    .sidebar.collapsed .nav-section-title .nav-section-text {
      display: none !important;
    }

    .sidebar.collapsed .nav-section-title .nav-section-divider {
      display: block !important;
      width: 28px !important;
      height: 0 !important;
      border: none !important;
      border-top: 1.5px solid rgba(255, 215, 0, 0.35) !important;
      margin: 4px auto !important;
    }

    .sidebar.collapsed .menu-list {
      align-items: center !important;
      width: 100% !important;
      gap: 4px !important;
    }

    .sidebar.collapsed .menu-item {
      justify-content: center !important;
      align-items: center !important;
      padding: 0 !important;
      width: 40px !important;
      height: 40px !important;
      border-radius: 10px !important;
      gap: 0 !important;
      margin: 0 auto !important;
      box-sizing: border-box !important;
    }

    .sidebar.collapsed .menu-item span {
      display: none !important;
    }

    .sidebar.collapsed .menu-item i,
    .sidebar.collapsed .menu-item svg {
      margin: 0 !important;
      width: 20px !important;
      height: 20px !important;
      flex-shrink: 0 !important;
    }

    .sidebar.collapsed .menu-item.active {
      border-left: none !important;
      background: rgba(255, 215, 0, 0.15) !important;
      border: 1.5px solid var(--accent-gold) !important;
      color: var(--accent-gold) !important;
      border-radius: 10px !important;
    }

    .sidebar-logo {
      font-family: 'Outfit', sans-serif;
      font-weight: 800;
      font-size: 1.6rem;
      color: #fff;
      margin-bottom: 40px;
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .sidebar-logo span {
      background: linear-gradient(135deg, #FFEA00 0%, #EC4899 50%, #3B82F6 100%);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
    }

    .menu-list {
      list-style: none;
      display: flex;
      flex-direction: column;
      gap: 3px;
      flex-grow: 1;
    }

    .menu-item {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 9px 12px;
      border-radius: 10px;
      color: var(--text-muted);
      text-decoration: none;
      font-weight: 500;
      font-size: 0.9rem;
      cursor: pointer;
      transition: all 0.2s ease;
    }

    .menu-item:hover,
    .menu-item.active {
      color: #fff;
      background: var(--bg-card);
    }

    .menu-item.active {
      border-left: 3px solid var(--accent-gold);
      border-radius: 0 10px 10px 0;
      background: rgba(255, 215, 0, 0.04);
      color: var(--accent-gold);
    }

    .user-info {
      padding: 15px;
      background: rgba(255, 255, 255, 0.02);
      border-radius: 12px;
      border: 1px solid var(--border-color);
      margin-top: auto;
    }

    .user-email {
      font-size: 0.8rem;
      color: var(--text-muted);
      word-break: break-all;
      margin-bottom: 10px;
    }

    .logout-btn {
      color: var(--error-color);
      font-size: 0.85rem;
      font-weight: 700;
      cursor: pointer;
      display: flex;
      align-items: center;
      gap: 8px;
    }

    /* Content Area - Scalable 100% Flex Box (No empty margins on right) */
    .content-wrapper {
      flex: 1 1 auto;
      width: 100%;
      max-width: 100%;
      margin: 0;
      padding: 0 24px 140px 24px;
      overflow-y: auto;
      overflow-x: hidden;
      height: 100%;
      box-sizing: border-box;
      scrollbar-width: thin !important;
      scrollbar-color: rgba(255, 215, 0, 0.25) transparent !important;
    }

    .content-wrapper::-webkit-scrollbar {
      width: 4px !important;
      height: 4px !important;
    }

    .content-wrapper::-webkit-scrollbar-track {
      background: transparent !important;
    }

    .content-wrapper::-webkit-scrollbar-thumb {
      background: rgba(255, 215, 0, 0.25) !important;
      border-radius: 4px !important;
    }

    .content-wrapper::-webkit-scrollbar-thumb:hover {
      background: rgba(255, 215, 0, 0.5) !important;
    }

    /* Mobile App Landscape Simulator & Device Viewport Ultra-Thin Scrollbars */
    body.is-mobile-app .sidebar::-webkit-scrollbar {
      width: 2.5px !important;
    }
    body.is-mobile-app .content-wrapper::-webkit-scrollbar {
      width: 3px !important;
    }
    body.is-mobile-app *::-webkit-scrollbar {
      width: 3px !important;
      height: 3px !important;
    }

    /* Section Tabs Portal Theme (No Glow Effect) */
    .ads-tab-btn {
      display: inline-flex !important;
      align-items: center !important;
      justify-content: center !important;
      gap: 8px !important;
      padding: 10px 20px !important;
      height: 42px !important;
      border-radius: 12px !important;
      font-weight: 700 !important;
      font-size: 0.88rem !important;
      cursor: pointer !important;
      transition: all 0.2s ease !important;
      box-shadow: none !important;
      border: 1.5px solid var(--border-color) !important;
      background: var(--bg-card) !important;
      color: var(--text-muted) !important;
      width: auto !important;
      flex-shrink: 0 !important;
      box-sizing: border-box !important;
    }

    .ads-tab-btn:hover {
      border-color: var(--accent-gold) !important;
      color: #fff !important;
      background: rgba(255, 215, 0, 0.08) !important;
      box-shadow: none !important;
    }

    .ads-tab-btn.active {
      background: rgba(255, 215, 0, 0.08) !important;
      color: var(--accent-gold) !important;
      border: 1.5px solid var(--accent-gold) !important;
      box-shadow: none !important;
    }

    .ads-tab-btn.active i,
    .ads-tab-btn.active svg {
      color: var(--accent-gold) !important;
      stroke: var(--accent-gold) !important;
    }

    .ads-tab-btn.active .ad-tab-count-badge {
      background: rgba(255, 215, 0, 0.15) !important;
      color: var(--accent-gold) !important;
      border: 1px solid rgba(255, 215, 0, 0.25) !important;
    }

    .ad-tab-count-badge {
      font-size: 0.74rem !important;
      padding: 3px 8px !important;
      border-radius: 12px !important;
      font-weight: 800 !important;
      line-height: 1 !important;
      display: inline-block !important;
    }

    .header-section {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 24px;
      /* Increased to give a nice gap between title and filters */
      flex-shrink: 0;
    }

    .actions-bar {
      position: sticky;
      top: 0;
      z-index: 100;
      background: #090214;
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-top: 0;
      margin-bottom: 12px;
      padding-top: 12px;
      padding-bottom: 12px;
      border-bottom: 1.5px solid var(--border-color);
      flex-shrink: 0;
      box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    }

    body.light-theme .actions-bar {
      background: #ffffff !important;
    }

    .header-title h1 {
      font-family: 'Outfit', sans-serif;
      font-weight: 700;
      font-size: 2rem;
      margin-bottom: 6px;
      color: var(--accent-gold);
    }

    .header-title p {
      color: var(--text-muted);
      font-size: 0.95rem;
    }

    /* Dashboard Widgets */
    .filter-select {
      background: rgba(255, 255, 255, 0.04);
      border: 1px solid rgba(255, 255, 255, 0.1);
      border-radius: 8px;
      color: #fff;
      padding: 6px 16px 6px 6px;
      font-size: 0.75rem;
      font-weight: 700;
      cursor: pointer;
      outline: none;
      transition: all 0.2s;
      appearance: none;
      -webkit-appearance: none;
      -moz-appearance: none;
      background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffd700' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
      background-repeat: no-repeat;
      background-position: right 4px center;
      background-size: 8px;

      /* Width constraints to prevent displacement */
      max-width: 140px;
      text-overflow: ellipsis;
      white-space: nowrap;
      overflow: hidden;
    }

    #uploaded-select-story,
    #uploaded-select-rhyme,
    #uploaded-select-mantra,
    #uploaded-select-book {
      max-width: 170px;
    }

    #sort-select-story,
    #sort-select-rhyme,
    #sort-select-mantra,
    #sort-select-book,
    #status-select-story,
    #status-select-rhyme,
    #status-select-mantra,
    #status-select-book {
      width: auto !important;
      min-width: 85px !important;
      max-width: 150px !important;
    }

    .filter-select:focus,
    .filter-select.active-filter {
      border-color: var(--accent-gold);
      color: var(--accent-gold);
      box-shadow: none;
    }

    .filter-select option {
      background: #090214;
      color: #fff;
      font-weight: 600;
    }

    /* Custom Dropdown Styling */
    .custom-select-container {
      position: relative;
      display: inline-block;
      min-width: 90px;
    }

    .custom-select-container.full-width,
    .form-group .custom-select-container {
      width: 100% !important;
      display: block !important;
      margin-top: 6px !important;
    }

    .custom-select-container.full-width .custom-select-trigger,
    .form-group .custom-select-trigger {
      width: 100% !important;
      height: 42px !important;
      min-height: 42px !important;
      font-size: 0.88rem !important;
      border-radius: 12px !important;
      box-sizing: border-box !important;
      display: inline-flex !important;
      align-items: center !important;
      justify-content: space-between !important;
      padding: 0 42px 0 16px !important;
      line-height: normal !important;
      background-position: right 18px center !important;
      background-size: 10px 10px !important;
    }

    .form-group label {
      display: block !important;
      margin-bottom: 0 !important;
    }

    .modal-footer button,
    .modal-footer .btn-secondary {
      margin: 0 !important;
    }

    .form-group input,
    .form-group select {
      margin-top: 8px !important;
    }

    .form-group .custom-select-list {
      width: 100% !important;
      max-width: 100% !important;
      box-sizing: border-box !important;
    }

    .custom-select-container.right-aligned {
      min-width: 150px;
      width: max-content;
    }

    .custom-select-trigger {
      background: rgba(255, 255, 255, 0.04);
      border: 1px solid rgba(255, 255, 255, 0.1);
      border-radius: 8px;
      color: #fff;
      padding: 0 42px 0 16px;
      height: 42px;
      font-size: 0.82rem;
      font-weight: 700;
      cursor: pointer;
      outline: none;
      transition: all 0.2s;
      position: relative;
      text-overflow: ellipsis;
      white-space: nowrap;
      overflow: hidden;
      display: inline-flex !important;
      align-items: center !important;
      justify-content: space-between !important;
      line-height: normal !important;
      box-sizing: border-box !important;

      /* White Arrow Icon */
      background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
      background-repeat: no-repeat;
      background-position: right 18px center !important;
      background-size: 10px 10px !important;
    }

    .custom-select-trigger:hover,
    .custom-select-trigger.active-filter {
      border-color: var(--accent-gold);
      color: var(--accent-gold);
      box-shadow: none;
      /* Gold Arrow Icon */
      background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffd700' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
      background-position: right 18px center !important;
      background-size: 10px 10px !important;
    }

    /* Actions Bar Layout Optimizations to fit all elements without overlapping */
    .actions-bar {
      display: flex !important;
      flex-wrap: wrap !important;
      align-items: center !important;
      justify-content: space-between !important;
      gap: 8px 12px !important;
    }

    .actions-bar > div {
      display: flex !important;
      align-items: center !important;
      flex-wrap: wrap !important;
      gap: 6px 10px !important;
      margin: 0 !important;
    }

    .custom-select-container {
      position: relative !important;
      overflow: visible !important;
    }

    .custom-select-list {
      display: none;
      position: absolute;
      top: calc(100% + 4px);
      left: 0;
      background: #0d061c !important;
      background-color: #0d061c !important;
      border: 1.5px solid var(--accent-gold) !important;
      border-radius: 12px !important;
      z-index: 99999999 !important;
      min-width: 100%;
      width: max-content;
      max-width: 320px;
      max-height: none !important;
      overflow: visible !important;
      box-shadow: 0 14px 40px rgba(0, 0, 0, 0.98) !important;
      padding: 0 !important;
    }

    /* DROP-UP POSITIONING FOR BOTTOM-POSITIONED DROPDOWNS */
    .custom-select-container.drop-up .custom-select-list,
    .drop-up .custom-select-list,
    #editor-modal .custom-select-container.drop-up .custom-select-list {
      top: auto !important;
      bottom: calc(100% + 6px) !important;
      box-shadow: 0 -15px 40px rgba(0, 0, 0, 0.95) !important;
    }

    .custom-select-list.open {
      display: block !important;
    }

    /* Ensure actions bars, filter containers, and modals do NOT clip dropdown lists */
    .actions-bar,
    .filter-bar,
    .filter-select-wrapper,
    .form-group,
    .admin-pane,
    .modal-content,
    .modal-card,
    #editor-modal .modal-collapsible-body {
      overflow: visible !important;
    }

    .modal-body {
      max-height: 75vh !important;
      overflow-y: auto !important;
      overflow-x: visible !important;
      padding-bottom: 70px !important;
    }

    .custom-select-item {
      padding: 8px 12px;
      font-size: 0.75rem;
      font-weight: 600;
      color: #fff;
      cursor: pointer;
      transition: all 0.2s;
      white-space: nowrap;
      text-align: left;
      position: relative;
      background: #0d061c;
    }

    .custom-select-item:first-child {
      border-top-left-radius: 10px !important;
      border-top-right-radius: 10px !important;
    }

    .custom-select-item:last-child {
      border-bottom-left-radius: 10px !important;
      border-bottom-right-radius: 10px !important;
    }

    .custom-select-container.right-aligned .custom-select-item {
      text-align: right;
      /* Right align the uploader options list */
    }

    /* Yellow hover and selection instead of blue! */
    .custom-select-item:hover,
    .custom-select-item:focus,
    .custom-select-item.selected,
    .custom-select-sub-item:hover {
      background: #ffd700 !important;
      background-color: #ffd700 !important;
      color: #000000 !important;
      font-weight: 800 !important;
    }

    /* Custom Portal Dropdown Styling (Gold Highlight on Hover & Focus) */
    .custom-portal-dropdown-wrapper {
      position: relative;
      display: inline-block;
    }

    .custom-portal-dropdown-trigger {
      height: 38px;
      background: #0b0517;
      border: 1.5px solid rgba(255, 255, 255, 0.15);
      border-radius: 8px;
      color: #fff;
      padding: 0 12px;
      font-size: 0.8rem;
      font-weight: 600;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      user-select: none;
      transition: all 0.2s ease;
    }

    .custom-portal-dropdown-trigger:hover,
    .custom-portal-dropdown-wrapper.open .custom-portal-dropdown-trigger {
      border-color: var(--accent-gold);
      background: rgba(255, 215, 0, 0.05);
    }

    .custom-portal-dropdown-menu {
      display: none;
      position: absolute;
      top: calc(100% + 4px);
      left: 0;
      width: 100%;
      min-width: 180px;
      max-height: 240px;
      overflow-y: auto;
      background: #110922;
      border: 1.5px solid var(--accent-gold);
      border-radius: 10px;
      box-shadow: 0 12px 30px rgba(0, 0, 0, 0.8);
      z-index: 99999;
      padding: 4px 0;
      box-sizing: border-box;
    }

    .custom-portal-dropdown-wrapper.open .custom-portal-dropdown-menu {
      display: block;
    }

    .custom-portal-dropdown-option {
      padding: 9px 14px;
      font-size: 0.8rem;
      font-weight: 600;
      color: #cbd5e1;
      cursor: pointer;
      transition: all 0.15s ease;
      white-space: nowrap;
      text-overflow: ellipsis;
      overflow: hidden;
    }

    .custom-portal-dropdown-option:hover,
    .custom-portal-dropdown-option:focus,
    .custom-portal-dropdown-option.selected {
      background: #ffd700 !important;
      background-color: #ffd700 !important;
      color: #000000 !important;
      font-weight: 800 !important;
    }

    /* Sub-menu styling (Fly-out on mouse hover with smart left/right positioning) */
    .custom-select-sub-menu {
      display: none;
      position: absolute;
      top: -2px;
      left: calc(100% + 4px);
      background: #0d061c !important;
      background-color: #0d061c !important;
      border: 1.5px solid var(--accent-gold) !important;
      border-radius: 10px !important;
      z-index: 999999999 !important;
      min-width: 130px;
      width: max-content;
      box-shadow: 0 12px 35px rgba(0, 0, 0, 0.98) !important;
      padding: 4px 0 !important;
      pointer-events: none;
    }

    .custom-select-container.right-aligned .custom-select-sub-menu,
    .custom-select-container.fly-left .custom-select-sub-menu {
      left: auto !important;
      right: calc(100% + 4px) !important;
    }

    .custom-select-item:hover .custom-select-sub-menu {
      display: flex !important;
      flex-direction: column !important;
    }

    .custom-select-sub-item {
      padding: 6px 12px;
      font-size: 0.65rem;
      font-weight: 500;
      color: #fff;
      text-align: left;
      white-space: nowrap;
      pointer-events: none;
      /* Make non-selectable, click passes through to parent */
      cursor: default;
    }

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

    .stat-card {
      background: var(--bg-card);
      border: 1.5px solid var(--border-color);
      border-radius: 20px;
      padding: 24px;
      display: flex;
      align-items: center;
      gap: 20px;
    }

    .stat-card:hover {
      background: var(--bg-card-hover);
    }

    .stat-icon {
      width: 50px;
      height: 50px;
      border-radius: 14px;
      display: flex;
      align-items: center;
      justify-content: center;
      background: rgba(255, 215, 0, 0.1);
      color: var(--accent-gold);
    }

    .stat-icon.purple {
      background: rgba(139, 92, 246, 0.1);
      color: var(--accent-purple);
    }

    .stat-info h3 {
      font-size: 1.8rem;
      font-weight: 800;
      font-family: 'Outfit', sans-serif;
      margin-bottom: 4px;
    }

    .stat-info p {
      color: var(--text-muted);
      font-size: 0.85rem;
      font-weight: 600;
    }

    /* Content Pane */
    .admin-pane {
      display: none;
    }

    .admin-pane.active {
      display: flex;
      flex-direction: column;
      height: auto !important;
      min-height: 100% !important;
    }

    .search-box {
      position: relative;
      flex-grow: 1;
      max-width: 400px;
    }

    .search-box input {
      width: 100%;
      padding: 12px 16px 12px 42px;
      font-size: 0.9rem;
    }

    .search-box i,
    .search-box svg {
      position: absolute;
      left: 14px;
      top: 50%;
      transform: translateY(-50%);
      color: var(--text-muted);
      width: 18px;
      height: 18px;
      pointer-events: none;
    }

    .btn-add {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 12px 20px;
      width: auto;
      font-size: 0.9rem;
    }

    /* Table Styling - Single Outer Scrollbar Standard */
    .table-container {
      background: var(--bg-card);
      border: 1.5px solid var(--border-color);
      border-radius: 12px;
      overflow-x: auto;
      overflow-y: visible !important;
      max-height: none !important;
      box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
      margin-bottom: 120px !important;
      padding-bottom: 140px !important;
      flex-grow: 1;
      position: relative;
    }

    /* Style horizontal scrollbar if table exceeds screen width (width: 0 to ensure NO vertical scrollbar) */
    .table-container::-webkit-scrollbar {
      height: 6px;
      width: 0px !important;
    }

    .table-container::-webkit-scrollbar-track {
      background: rgba(255, 255, 255, 0.02);
      border-radius: 6px;
    }

    .table-container::-webkit-scrollbar-thumb {
      background: rgba(255, 215, 0, 0.25);
      border-radius: 6px;
    }

    .table-container::-webkit-scrollbar-thumb:hover {
      background: rgba(255, 215, 0, 0.50);
    }

    /* 3-Dot Action Button Styling - Yellow OUTLINE on Hover / Active */
    .action-3dot-btn {
      background: transparent !important;
      border: 1.5px solid var(--border-color);
      color: #ffffff;
      width: 32px;
      height: 32px;
      border-radius: 8px;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      transition: all 0.2s ease !important;
    }

    .action-3dot-btn:hover,
    .action-3dot-btn:focus,
    .action-3dot-btn.active {
      background: rgba(247, 211, 106, 0.12) !important;
      border-color: #f7d36a !important;
      color: #f7d36a !important;
      box-shadow: 0 0 12px rgba(247, 211, 106, 0.45) !important;
    }

    .action-3dot-btn:hover i,
    .action-3dot-btn:focus i,
    .action-3dot-btn.active i,
    .action-3dot-btn:hover svg,
    .action-3dot-btn:focus svg,
    .action-3dot-btn.active svg {
      stroke: #f7d36a !important;
      color: #f7d36a !important;
    }

    /* Style the inner story scrollbar in admin theme colors */
    .story-scrollable::-webkit-scrollbar {
      width: 6px;
      height: 6px;
    }

    .story-scrollable::-webkit-scrollbar-track {
      background: rgba(255, 255, 255, 0.02);
      border-radius: 4px;
    }

    .story-scrollable::-webkit-scrollbar-thumb {
      background: rgba(255, 215, 0, 0.35);
      border-radius: 4px;
    }

    .story-scrollable::-webkit-scrollbar-thumb:hover {
      background: rgba(255, 215, 0, 0.60);
    }

    table {
      width: 100%;
      border-collapse: separate;
      border-spacing: 0;
      text-align: left;
    }

    /* Apply rounded corners to separate collapse table matching 12px radius */
    tr:first-child th:first-child {
      border-top-left-radius: 10px;
    }

    tr:first-child th:last-child {
      border-top-right-radius: 10px;
    }

    tr:last-child td:first-child {
      border-bottom-left-radius: 10px;
    }

    tr:last-child td:last-child {
      border-bottom-right-radius: 10px;
    }

    th {
      background: #110922;
      border-bottom: 2px solid var(--accent-gold);
      padding: 16px 12px;
      font-size: 0.75rem;
      font-weight: 700;
      color: var(--accent-gold);
      text-transform: uppercase;
      letter-spacing: 0.05em;
    }

    body.light-theme th {
      background: #f8fafc !important;
      color: #0f172a !important;
    }

    th:not(:last-child) {
      border-right: 1.5px solid rgba(255, 215, 0, 0.2);
      /* Gold separator line | between columns */
    }

    /* Thumbnail Image Sizing (prevents large images from overflowing in either view mode) */
    .thumbnail-container img {
      width: 100% !important;
      height: 100% !important;
      object-fit: cover !important;
      border-radius: 8px !important;
      display: block !important;
    }

    /* Admin List View (Compact) Overrides */
    .admin-list-view .col-title .col-meta {
      display: none !important;
    }

    .admin-list-view .chips-container {
      display: none !important;
    }

    .admin-list-view td {
      padding: 6px 12px !important;
      vertical-align: middle !important;
      /* Extra compact padding for list view */
    }

    .admin-list-view .col-cover {
      width: 60px !important;
      padding: 6px 12px !important;
      vertical-align: middle !important;
      /* Center thumbnail vertically in list mode */
    }

    .admin-list-view .col-title {
      vertical-align: middle !important;
      /* Center title vertically in list mode */
    }

    .admin-list-view .cover-wrapper {
      width: 44px !important;
      gap: 0px !important;
      margin: 0 auto;
    }

    .admin-list-view .thumbnail-container {
      width: 44px !important;
      height: 44px !important;
    }

    .admin-list-view .play-pause-toggle {
      display: none !important;
      /* Hide audio play buttons in list view */
    }


    /* Specific Row Expand & Audio Playing Overrides in List View */
    .admin-list-view tr.row-expanded .col-title .col-meta,
    .admin-list-view tr.audio-playing .col-title .col-meta {
      display: -webkit-box !important;
    }

    .admin-list-view tr.row-expanded .chips-container,
    .admin-list-view tr.audio-playing .chips-container {
      display: flex !important;
    }

    .admin-list-view tr.row-expanded td,
    .admin-list-view tr.audio-playing td {
      padding: 18px 12px !important;
    }

    .admin-list-view tr.row-expanded .col-cover,
    .admin-list-view tr.audio-playing .col-cover {
      width: 110px !important;
      vertical-align: top !important;
      /* Reset to top alignment when expanded/playing */
    }

    .admin-list-view tr.row-expanded .col-title,
    .admin-list-view tr.audio-playing .col-title {
      vertical-align: top !important;
      /* Reset to top alignment when expanded/playing */
    }

    .admin-list-view tr.row-expanded .cover-wrapper,
    .admin-list-view tr.audio-playing .cover-wrapper {
      width: 85px !important;
      gap: 8px !important;
    }

    .admin-list-view tr.row-expanded .thumbnail-container,
    .admin-list-view tr.audio-playing .thumbnail-container {
      width: 85px !important;
      height: 85px !important;
    }

    .admin-list-view tr.row-expanded .play-pause-toggle,
    .admin-list-view tr.audio-playing .play-pause-toggle {
      display: inline-flex !important;
    }


    /* Highlight title in yellow when audio is playing */
    tr.audio-playing .col-title>div:first-child {
      color: var(--accent-gold) !important;
    }

    /* Content Title & Description Font Size Overrides */
    .col-title>div:first-child {
      font-size: 14px !important;
    }

    .col-title .col-meta {
      font-size: 12px !important;
      display: -webkit-box !important;
      -webkit-line-clamp: 2 !important;
      -webkit-box-orient: vertical !important;
      overflow: hidden !important;
    }

    /* User Profiles Font Size Overrides */
    #table-body-users td:first-child>div:first-child {
      font-size: 16px !important;
    }

    #table-body-users td div div[style*="font-weight: 700"]>span:first-child {
      font-size: 13px !important;
    }

    /* User Profiles Redesign Styles */
    .user-avatar-container {
      width: 50px;
      height: 50px;
      border-radius: 8px;
      overflow: visible;
      /* Changed from hidden to allow popup display */
      position: relative;
      flex-shrink: 0;
      background: #110826;
      border: 1.5px solid rgba(255, 215, 0, 0.2);
    }

    .user-avatar-img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      border-radius: 8px;
      display: block;
      cursor: pointer;
    }



    /* User profiles row expand/collapse controls */
    #table-body-users tr.row-expanded .user-profile-collapsed-show {
      display: none !important;
    }

    #table-body-users tr.row-expanded .user-profile-collapsed-hide {
      display: block !important;
    }

    .user-card-container {
      transition: all 0.3s ease;
    }

    .user-card-container:hover {
      box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
      transform: translateY(-2px);
    }

    td {
      padding: 18px 12px;
      /* Increased row height padding */
      border-bottom: 1px solid var(--border-color);
      font-size: 0.85rem;
      color: var(--text-main);
      vertical-align: middle;
    }

    tr:last-child td {
      border-bottom: none;
    }

    tr:hover td {
      background: rgba(255, 255, 255, 0.01);
    }

    .col-cover,
    .col-title {
      vertical-align: top !important;
    }

    .cover-wrapper {
      position: relative;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 8px;
      width: 85px;
    }

    .thumbnail-container {
      position: relative;
      cursor: pointer;
      width: 85px;
      height: 85px;
    }

    .modal-thumbnail-container {
      position: relative;
      cursor: pointer;
      width: 120px !important;
      height: 120px !important;
    }

    .modal-thumbnail-container img {
      width: 100% !important;
      height: 100% !important;
      object-fit: cover !important;
      border-radius: 8px !important;
      display: block !important;
    }

    .play-pause-toggle {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      padding: 4px 8px;
      background: rgba(16, 185, 129, 0.15);
      border: 1.5px solid rgba(16, 185, 129, 0.35);
      color: #10b981;
      border-radius: 6px;
      font-size: 0.65rem;
      font-weight: 700;
      cursor: pointer;
      text-transform: uppercase;
      transition: all 0.2s ease;
      width: 100%;
      box-sizing: border-box;
      user-select: none;
    }

    .play-pause-toggle:hover {
      background: rgba(16, 185, 129, 0.25);
      border-color: rgba(16, 185, 129, 0.5);
    }

    .col-cover img {
      width: 85px;
      /* Increased cover size for better visibility */
      height: 85px;
      border-radius: 10px;
      object-fit: cover;
      border: 1px solid var(--border-color);
    }

    .col-title {
      font-weight: 700;
      font-size: 1.05rem;
      /* Increased title font size */
    }

    .col-meta {
      font-size: 0.8rem;
      /* Reduced description font size */
      color: var(--text-muted);
      margin-top: 6px;
    }

    .badge {
      display: inline-block;
      padding: 4px 10px;
      border-radius: 8px;
      font-size: 0.75rem;
      font-weight: 700;
      background: rgba(255, 215, 0, 0.1);
      border: 1.5px solid rgba(255, 215, 0, 0.25);
      color: var(--accent-gold);
    }

    .badge.purple {
      background: rgba(139, 92, 246, 0.1);
      border: 1.5px solid rgba(139, 92, 246, 0.3);
      color: var(--accent-purple);
    }

    .badge.green {
      background: rgba(16, 185, 129, 0.15);
      border: 1.5px solid rgba(16, 185, 129, 0.35);
      color: var(--success-color);
    }

    .badge.red {
      background: rgba(239, 68, 68, 0.15);
      border: 1.5px solid rgba(239, 68, 68, 0.35);
      color: var(--error-color);
    }

    .badge.category-badge {
      background: rgba(14, 165, 233, 0.1);
      color: #38bdf8;
      border: 1.5px solid rgba(14, 165, 233, 0.3);
    }

    .action-icons {
      display: flex;
      gap: 12px;
    }

    .action-icon-btn {
      background: none;
      border: none;
      color: var(--text-muted);
      cursor: pointer;
      transition: color 0.2s ease;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .action-icon-btn:hover {
      color: #fff;
    }

    .action-icon-btn.delete:hover {
      color: var(--error-color);
    }

    /* Modal Form Overlay */
    .modal-overlay {
      position: fixed !important;
      top: 0 !important;
      left: 0 !important;
      right: 0 !important;
      bottom: 0 !important;
      width: 100vw !important;
      height: 100vh !important;
      background: rgba(5, 2, 14, 0.85) !important;
      backdrop-filter: blur(14px) !important;
      -webkit-backdrop-filter: blur(14px) !important;
      z-index: 999999 !important;
      display: none;
      justify-content: center;
      align-items: center;
      padding: 20px;
      box-sizing: border-box;
    }

    .modal-overlay.active {
      display: flex !important;
    }

    /* Sub-tab Active States (Yellow icon & text) */
    .tab-btn.active {
      color: var(--accent-gold) !important;
      border-color: var(--accent-gold) !important;
      background: rgba(255, 215, 0, 0.08) !important;
    }

    .tab-btn.active i,
    .tab-btn.active svg {
      color: var(--accent-gold) !important;
      stroke: var(--accent-gold) !important;
    }

    /* Sticky Sub-tabs and Header Bars across Admin Portal (Zero Gap & Leakage-Proof) */
    .sticky-portal-tabs-bar {
      position: sticky !important;
      top: 0px !important;
      z-index: 999 !important;
      background: var(--bg-dark, #090214) !important;
      backdrop-filter: blur(14px) !important;
      -webkit-backdrop-filter: blur(14px) !important;
      margin-top: 0px !important;
      padding-top: 12px !important;
      padding-bottom: 10px !important;
      margin-bottom: 14px !important;
      border-bottom: 1.5px solid var(--border-color) !important;
    }

    body.light-theme .sticky-portal-tabs-bar {
      background: #ffffff !important;
    }

    /* Fix Ads Control Pane Height for Persistent Sticky Scrolling when Accordions Expand */
    #pane-ads.admin-pane.active {
      height: auto !important;
      min-height: 100% !important;
    }

    .modal-card {
      background: #110922;
      border: 1.5px solid var(--border-color);
      border-radius: 24px;
      width: 100%;
      max-width: 600px;
      box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
      display: flex;
      flex-direction: column;
      max-height: 90vh;
    }

    .modal-header {
      padding: 24px;
      border-bottom: 1.5px solid var(--border-color);
      display: flex;
      justify-content: space-between;
      align-items: center;
    }

    .modal-header h2 {
      font-family: 'Outfit', sans-serif;
      font-size: 1.4rem;
      font-weight: 700;
    }

    .modal-close {
      background: none;
      border: none;
      color: var(--text-muted);
      cursor: pointer;
      font-size: 1.5rem;
    }

    .close-btn {
      background: transparent !important;
      border: none !important;
      color: #fff !important;
      font-size: 1.5rem !important;
      cursor: pointer !important;
      outline: none !important;
      padding: 0 !important;
      line-height: 1 !important;
      display: inline-flex !important;
      align-items: center !important;
      justify-content: center !important;
    }

    .close-btn:hover {
      color: var(--accent-gold) !important;
    }

    .modal-body {
      padding: 24px;
      overflow-y: auto;
      flex-grow: 1;
    }

    .modal-footer {
      padding: 24px;
      border-top: 1.5px solid var(--border-color);
      display: flex;
      justify-content: flex-end;
      gap: 12px;
    }

    .row {
      display: flex;
      gap: 15px;
    }

    .col {
      flex: 1;
    }

    /* Helper styling */
    .empty-state {
      padding: 60px 20px;
      text-align: center;
      color: var(--text-muted);
    }

    .empty-state i {
      font-size: 3rem;
      margin-bottom: 16px;
      display: block;
      color: rgba(255, 255, 255, 0.1);
    }

    /* Switch Toggle Switch Slider Styles */
    .switch-toggle input:checked+.slider-round {
      background-color: var(--accent-gold) !important;
      border-color: var(--accent-gold) !important;
    }

    .switch-toggle .slider-round::before {
      content: "";
      position: absolute;
      height: 12px;
      width: 12px;
      left: 3px;
      bottom: 2px;
      background-color: white;
      transition: .3s;
      border-radius: 50%;
    }

    .switch-toggle input:checked+.slider-round::before {
      transform: translateX(16px);
    }

    /* Upload file card focus state styling */
    .upload-file-box:hover {
      border-color: var(--accent-gold) !important;
      background: rgba(255, 255, 255, 0.04) !important;
    }

    /* Multiselect trigger hover */
    .custom-multiselect-trigger:hover {
      border-color: var(--accent-gold) !important;
    }

    /* Collapsible Details select styles */
    .portal-details summary::-webkit-details-marker {
      display: none;
    }

    .portal-details[open] summary i {
      transform: rotate(180deg);
    }

    .custom-checkbox-label {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      background: rgba(255, 255, 255, 0.04);
      border: 1.5px solid var(--border-color);
      border-radius: 20px;
      padding: 6px 14px;
      font-size: 0.75rem;
      font-weight: 700;
      color: var(--text-muted);
      cursor: pointer;
      transition: all 0.2s ease;
      user-select: none;
      text-transform: uppercase;
      margin: 4px;
    }

    .custom-checkbox-label:hover {
      border-color: rgba(255, 215, 0, 0.3);
      color: #fff;
    }

    .custom-checkbox-label:has(.custom-checkbox-input:checked) {
      background: rgba(255, 215, 0, 0.08) !important;
      border-color: rgba(255, 215, 0, 0.3) !important;
      color: var(--accent-gold) !important;
    }

    /* Collapsible items layout for admin portal content managed */
    .upload-collapsible-section {
      background: var(--bg-card);
      border: 1.5px solid var(--border-color);
      border-radius: 16px;
      margin-bottom: 20px;
      overflow: hidden;
    }

    .upload-collapsible-header {
      padding: 18px 24px;
      cursor: pointer;
      display: flex;
      justify-content: space-between;
      align-items: center;
      background: rgba(255, 255, 255, 0.02);
      user-select: none;
    }

    .upload-collapsible-header h2 {
      font-family: 'Outfit', sans-serif;
      font-size: 1.25rem;
      font-weight: 700;
      color: #fff;
      display: flex;
      align-items: center;
      gap: 12px;
      margin: 0;
    }

    .upload-collapsible-body {
      padding: 24px;
      border-top: 1.5px solid var(--border-color);
      display: none;
    }

    .upload-collapsible-section.open .upload-collapsible-body {
      display: block;
    }

    .upload-collapsible-section.open .upload-collapsible-header i.chevron {
      transform: rotate(180deg);
    }

    /* Access control style chips */
    .access-control-chip-label:hover {
      border-color: rgba(255, 215, 0, 0.3) !important;
      background: rgba(255, 255, 255, 0.04) !important;
    }

    .access-control-chip-label:has(.custom-checkbox-input:checked) {
      border-color: var(--accent-gold) !important;
      background: rgba(255, 215, 0, 0.05) !important;
    }

    .access-control-chip-label:has(.custom-checkbox-input:checked) span {
      color: var(--accent-gold) !important;
    }

    .access-control-chip-label:has(.custom-checkbox-input:checked) .status-indicator-dot {
      background: var(--accent-gold) !important;
      border-color: var(--accent-gold) !important;
      color: #000 !important;
      font-weight: 800;
    }

    /* Moods specific highlights */
    .modal-collapsible-block#modal-block-moods .access-control-chip-label:hover {
      border-color: rgba(236, 72, 153, 0.3) !important;
      background: rgba(255, 255, 255, 0.04) !important;
    }

    .modal-collapsible-block#modal-block-moods .access-control-chip-label:has(.custom-checkbox-input:checked) {
      border-color: var(--accent-pink) !important;
      background: rgba(236, 72, 153, 0.05) !important;
    }

    .modal-collapsible-block#modal-block-moods .access-control-chip-label:has(.custom-checkbox-input:checked) span {
      color: var(--accent-pink) !important;
    }

    .modal-collapsible-block#modal-block-moods .access-control-chip-label:has(.custom-checkbox-input:checked) .status-indicator-dot {
      background: var(--accent-pink) !important;
      border-color: var(--accent-pink) !important;
      color: #fff !important;
      font-weight: 800;
    }

    /* Collapsible behavior */
    .modal-collapsible-block {
      flex-shrink: 0 !important;
    }

    .portal-details {
      flex-shrink: 0 !important;
    }

    .modal-collapsible-block.open .modal-collapsible-body {
      display: flex !important;
    }

    .modal-collapsible-block.open .chevron-icon {
      transform: rotate(180deg);
    }

    /* Monetization Pane Layout & Scroll fixes */
    #pane-monetization {
      padding-right: 8px;
    }

    .monetization-subpane {
      display: none;
    }

    .monetization-subpane.active {
      display: block !important;
    }

    /* Action Dropdown Context Menu Styles */
    .action-dropdown-menu {
      animation: fadeInDropdown 0.15s ease-out;
    }
    @keyframes fadeInDropdown {
      from { opacity: 0; transform: translateY(-4px); }
      to { opacity: 1; transform: translateY(0); }
    }
    .action-dropdown-item {
      transition: all 0.15s ease !important;
    }
    .action-dropdown-item:hover {
      background: rgba(247, 211, 106, 0.15) !important;
      color: #ffffff !important;
    }

    /* Portal Theme Root & Native Picker Styles */
    :root {
      color-scheme: dark;
    }

    select,
    input[type="date"],
    input[type="time"] {
      color-scheme: dark !important;
      background-color: #110922 !important;
      color: #ffffff !important;
    }

    select option {
      background-color: #110922 !important;
      color: #ffffff !important;
      padding: 8px 12px !important;
    }

    select option:hover,
    select option:focus,
    select option:checked {
      background-color: var(--accent-gold) !important;
      color: #090d2a !important;
      font-weight: 700 !important;
    }

    input[type="date"]::-webkit-calendar-picker-indicator,
    input[type="time"]::-webkit-calendar-picker-indicator {
      filter: invert(0.85) sepia(1) saturate(5) hue-rotate(350deg);
      cursor: pointer;
      opacity: 0.9;
    }

    /* Custom Portal Theme Dropdowns (Image 5 Match - Pure Dark with Gold Border & Gold Selection Highlight) */
    .custom-portal-dropdown-wrapper {
      position: relative;
      display: inline-block;
      user-select: none;
      width: 100%;
    }

    .custom-portal-dropdown-trigger {
      background: #110922 !important;
      border: 1.5px solid var(--accent-gold) !important;
      border-radius: 8px !important;
      color: #ffffff !important;
      padding: 6px 12px !important;
      font-size: 0.78rem !important;
      font-weight: 700 !important;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
      box-sizing: border-box;
      height: 38px;
    }

    .custom-portal-dropdown-trigger:hover {
      box-shadow: none;
    }

    .custom-portal-dropdown-menu {
      position: absolute;
      top: calc(100% + 4px);
      left: 0;
      right: 0;
      background: #110922 !important;
      border: 1.5px solid var(--accent-gold) !important;
      border-radius: 12px !important;
      box-shadow: none;
      overflow: hidden;
      z-index: 999999;
      display: none;
      max-height: 240px;
      overflow-y: auto;
    }

    .custom-portal-dropdown-wrapper.open .custom-portal-dropdown-menu {
      display: block !important;
    }

    .custom-portal-dropdown-option {
      padding: 9px 14px !important;
      color: #ffffff !important;
      font-size: 0.78rem !important;
      font-weight: 600 !important;
      cursor: pointer;
      transition: background 0.15s ease, color 0.15s ease;
    }

    .custom-portal-dropdown-option:hover,
    .custom-portal-dropdown-option.selected {
      background-color: var(--accent-gold) !important;
      color: #090D2A !important;
      font-weight: 800 !important;
    }

    /* Universal Portal Search Box Styling (Matching Images 1, 2, 3) */
    .portal-search-box {
      position: relative;
      display: inline-flex;
      align-items: center;
    }

    .portal-search-box input {
      width: 100%;
      box-sizing: border-box;
      background: rgba(255, 255, 255, 0.03) !important;
      border: 1px solid rgba(255, 255, 255, 0.1) !important;
      border-radius: 20px !important;
      color: #ffffff !important;
      padding: 9px 36px 9px 38px !important;
      font-size: 0.82rem !important;
      font-weight: 500 !important;
      outline: none !important;
      transition: all 0.2s ease !important;
      box-shadow: none !important;
    }

    .portal-search-box input::placeholder {
      color: var(--text-muted) !important;
      font-weight: 400 !important;
    }

    .portal-search-box input:focus,
    .portal-search-box input:not(:placeholder-shown) {
      border-color: var(--accent-gold) !important;
      box-shadow: none !important;
      background: rgba(0, 0, 0, 0.4) !important;
    }

    .portal-search-box i.search-icon {
      position: absolute;
      left: 14px;
      width: 16px;
      height: 16px;
      color: var(--text-muted);
      pointer-events: none;
      transition: color 0.2s ease;
    }

    .portal-search-box input:focus~i.search-icon,
    .portal-search-box input:not(:placeholder-shown)~i.search-icon {
      color: var(--accent-gold);
    }

    /* GLOBAL REMOVAL OF ALL GLOW EFFECTS (No box-shadow glows on buttons, inputs, selects, cards, or focus states) */
    button,
    input,
    select,
    textarea,
    .btn,
    .btn-primary,
    .btn-secondary,
    .btn-add,
    .search-box,
    .filter-select,
    .custom-select-trigger,
    .modal-card,
    .login-card,
    div {
      box-shadow: none !important;
    }

    /* Top Navigation Header Bar (Matching Images 1, 2, 3, 5) */
    .portal-top-bar {
      width: 100%;
      height: 66px;
      background: rgba(10, 5, 20, 0.96);
      border-bottom: 1.5px solid var(--border-color);
      backdrop-filter: blur(16px);
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 0 24px;
      z-index: 1000;
      box-sizing: border-box;
      flex-shrink: 0;
      transition: padding-left 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    }

    /* Shift toggle button left when sidebar is collapsed so it aligns perfectly with centered menu icons */
    body.sidebar-collapsed .portal-top-bar,
    #admin-app:has(.sidebar.collapsed) .portal-top-bar {
      padding-left: 13px !important;
    }

    body.sidebar-collapsed .portal-top-left,
    #admin-app:has(.sidebar.collapsed) .portal-top-left {
      gap: 12px !important;
    }

    .portal-top-left {
      display: flex;
      align-items: center;
      gap: 20px;
      min-width: 0;
    }

    .portal-logo-box {
      display: flex;
      align-items: center;
      gap: 12px;
      padding-right: 20px;
      border-right: 1.5px solid rgba(255, 255, 255, 0.12);
      flex-shrink: 0;
    }

    .portal-logo-img {
      height: 38px;
      width: auto;
      object-fit: contain;
    }

    .portal-logo-text-group {
      display: flex;
      flex-direction: column;
      line-height: 1.15;
    }

    .portal-logo-title {
      font-family: 'Outfit', sans-serif;
      font-weight: 800;
      font-size: 1.15rem;
      color: #ffffff;
      letter-spacing: -0.02em;
    }

    .portal-logo-role {
      font-size: 0.85rem;
      font-weight: 800;
      background: linear-gradient(135deg, #FFEA00 0%, #EC4899 50%, #3B82F6 100%);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
    }

    .portal-page-header {
      display: flex;
      flex-direction: column;
      gap: 2px;
      min-width: 0;
    }

    .portal-page-title {
      font-family: 'Outfit', sans-serif;
      font-weight: 800;
      font-size: 1.35rem;
      color: var(--accent-gold);
      margin: 0;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .portal-page-desc {
      font-size: 0.78rem;
      color: var(--text-muted);
      margin: 0;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .portal-top-right {
      display: flex;
      align-items: center;
      gap: 12px;
      flex-shrink: 0;
    }

    .portal-action-btn {
      background: var(--accent-gold);
      color: #0f172a;
      border: none;
      padding: 8px 18px;
      border-radius: 10px;
      font-weight: 800;
      font-size: 0.84rem;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      gap: 6px;
      height: 38px;
      transition: all 0.2s ease;
      white-space: nowrap;
    }

    .portal-action-btn:hover {
      transform: translateY(-1px);
      filter: brightness(1.1);
    }

    .portal-search-wrapper {
      position: relative;
      width: 220px;
    }

    .portal-search-input {
      width: 100%;
      height: 38px;
      background: rgba(255, 255, 255, 0.04);
      border: 1.5px solid var(--border-color);
      border-radius: 10px;
      padding: 8px 30px 8px 36px !important;
      color: #ffffff;
      font-size: 0.82rem;
      outline: none;
      transition: border-color 0.2s ease;
    }

    .portal-search-input::-webkit-search-cancel-button,
    .portal-search-input::-webkit-search-decoration {
      -webkit-appearance: none;
      appearance: none;
    }

    .portal-search-clear-btn {
      position: absolute;
      right: 8px;
      top: 50%;
      transform: translateY(-50%);
      background: transparent;
      border: none;
      color: var(--text-muted);
      cursor: pointer;
      display: none;
      align-items: center;
      justify-content: center;
      width: 22px;
      height: 22px;
      border-radius: 50%;
      transition: all 0.2s ease;
      outline: none;
      padding: 0;
      z-index: 5;
    }

    .portal-search-clear-btn:hover {
      color: var(--accent-gold);
      background: rgba(255, 215, 0, 0.15);
    }

    .portal-search-input:focus {
      border-color: var(--accent-gold);
    }

    .portal-search-icon {
      position: absolute;
      left: 11px;
      top: 50%;
      transform: translateY(-50%);
      color: var(--text-muted);
      width: 15px;
      height: 15px;
      pointer-events: none;
    }

    .portal-icon-btn {
      width: 38px;
      height: 38px;
      border-radius: 10px;
      background: rgba(255, 255, 255, 0.04);
      border: 1.5px solid var(--border-color);
      color: #ffffff;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      position: relative;
      transition: all 0.2s ease;
    }

    .portal-icon-btn:hover {
      border-color: var(--accent-gold);
      color: var(--accent-gold);
      background: rgba(255, 215, 0, 0.06);
    }

    .notification-badge-pill {
      position: absolute;
      top: -3px;
      right: -3px;
      background: #ef4444;
      color: #ffffff;
      font-size: 0.65rem;
      font-weight: 800;
      padding: 1px 5px;
      border-radius: 10px;
      border: 1.5px solid #090214;
      line-height: 1;
    }

    .portal-profile-pill {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 4px 14px 4px 6px;
      border-radius: 12px;
      background: rgba(255, 255, 255, 0.03);
      border: 1.5px solid var(--border-color);
      cursor: pointer;
      transition: all 0.2s ease;
      user-select: none;
      height: 40px;
      box-sizing: border-box;
    }

    .portal-profile-pill:hover {
      border-color: #ec4899;
      background: rgba(236, 72, 153, 0.06);
    }

    .portal-avatar-wrapper {
      width: 30px;
      height: 30px;
      border-radius: 50%;
      border: 2px solid #ec4899;
      overflow: hidden;
      display: flex;
      align-items: center;
      justify-content: center;
      background: linear-gradient(135deg, var(--accent-gold), var(--accent-pink));
      color: #fff;
      font-weight: 800;
      font-size: 0.82rem;
      flex-shrink: 0;
    }

    .portal-profile-info {
      display: flex;
      flex-direction: column;
      line-height: 1.15;
      text-align: left;
    }

    .portal-profile-name {
      font-size: 0.8rem;
      font-weight: 700;
      color: #ffffff;
      white-space: nowrap;
    }

    .portal-profile-role {
      font-size: 0.68rem;
      color: var(--text-muted);
      white-space: nowrap;
    }

    /* Light Theme Theme Overrides */
    body.light-theme {
      --bg-dark: #f8fafc;
      --bg-card: rgba(0, 0, 0, 0.03);
      --bg-card-hover: rgba(0, 0, 0, 0.06);
      --border-color: rgba(0, 0, 0, 0.1);
      --text-main: #0f172a;
      --text-muted: #64748b;
    }

    body.light-theme .portal-top-bar {
      background: rgba(255, 255, 255, 0.95);
      border-bottom: 1.5px solid rgba(0, 0, 0, 0.1);
    }

    body.light-theme .portal-logo-title,
    body.light-theme .portal-profile-name {
      color: #0f172a !important;
    }

    body.light-theme .portal-search-input {
      background: rgba(0, 0, 0, 0.04);
      color: #0f172a;
      border-color: rgba(0, 0, 0, 0.12);
    }

    body.light-theme .sidebar {
      background: #ffffff;
      border-right: 1.5px solid rgba(0, 0, 0, 0.1);
    }
    /* Profile Dropdown Menu Styles */
    .profile-dropdown-container {
      position: relative;
      display: inline-block;
    }

    .profile-dropdown-menu {
      position: absolute;
      top: calc(100% + 8px);
      right: 0;
      width: 220px;
      background: #160d29;
      border: 1.5px solid var(--border-color, rgba(255, 255, 255, 0.12));
      border-radius: 14px;
      box-shadow: 0 12px 35px rgba(0, 0, 0, 0.6);
      backdrop-filter: blur(16px);
      padding: 8px 0;
      z-index: 10000;
      display: flex;
      flex-direction: column;
      animation: dropdownFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    }

    @keyframes dropdownFadeIn {
      from {
        opacity: 0;
        transform: translateY(-8px) scale(0.96);
      }
      to {
        opacity: 1;
        transform: translateY(0) scale(1);
      }
    }

    .profile-dropdown-menu .dropdown-item {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 10px 16px;
      font-size: 0.88rem;
      font-weight: 700;
      color: #fff;
      cursor: pointer;
      transition: background 0.15s ease, color 0.15s ease;
    }

    .profile-dropdown-menu .dropdown-item:hover {
      background: rgba(255, 255, 255, 0.08);
    }

    .profile-dropdown-menu .dropdown-divider {
      height: 1px;
      background: var(--border-color, rgba(255, 255, 255, 0.1));
      margin: 6px 0;
    }

    .profile-dropdown-menu .dropdown-item.logout-item:hover {
      background: rgba(239, 68, 68, 0.15);
      color: #ef4444;
    }

    /* NOTIFICATION DROPDOWN MENU FLOATING BELOW BELL ICON */
    .notification-dropdown-container {
      position: relative;
      display: inline-block;
    }

    .notification-dropdown-menu {
      position: absolute;
      top: calc(100% + 8px);
      right: 0;
      width: 380px;
      max-height: 520px;
      background: #140b24;
      border: 1.5px solid var(--border-color, rgba(255, 255, 255, 0.15));
      border-radius: 16px;
      box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85);
      backdrop-filter: blur(20px);
      -webkit-backdrop-filter: blur(20px);
      padding: 0;
      z-index: 10000;
      display: flex;
      flex-direction: column;
      overflow: hidden;
      animation: dropdownFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .notif-dropdown-header {
      padding: 12px 16px;
      border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
      display: flex;
      align-items: center;
      justify-content: space-between;
      background: rgba(0, 0, 0, 0.3);
      flex-shrink: 0;
    }

    .notif-dropdown-header span {
      font-size: 0.88rem;
      font-weight: 800;
      color: var(--accent-gold);
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .notif-dropdown-body {
      padding: 10px 12px;
      display: flex;
      flex-direction: column;
      gap: 8px;
      max-height: 440px;
      overflow-y: auto;
      scrollbar-width: thin;
      scrollbar-color: rgba(247, 211, 106, 0.4) rgba(0, 0, 0, 0.2);
    }

    .notif-dropdown-body::-webkit-scrollbar,
    .notif-accordion-content::-webkit-scrollbar {
      width: 6px;
    }

    .notif-dropdown-body::-webkit-scrollbar-track,
    .notif-accordion-content::-webkit-scrollbar-track {
      background: rgba(0, 0, 0, 0.2);
      border-radius: 4px;
    }

    .notif-dropdown-body::-webkit-scrollbar-thumb,
    .notif-accordion-content::-webkit-scrollbar-thumb {
      background: rgba(247, 211, 106, 0.35);
      border-radius: 4px;
    }

    .notif-dropdown-body::-webkit-scrollbar-thumb:hover,
    .notif-accordion-content::-webkit-scrollbar-thumb:hover {
      background: rgba(247, 211, 106, 0.6);
    }

    .notif-accordion-content {
      max-height: 260px;
      overflow-y: auto;
      scrollbar-width: thin;
      scrollbar-color: rgba(247, 211, 106, 0.4) rgba(0, 0, 0, 0.2);
    }

    .notif-dropdown-item {
      padding: 10px 12px;
      background: rgba(255, 255, 255, 0.03);
      border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
      border-radius: 10px;
      font-size: 0.82rem;
      transition: all 0.2s ease;
    }

    .notif-dropdown-item:hover {
      background: rgba(255, 255, 255, 0.06);
      border-color: rgba(255, 215, 0, 0.3);
    }

    .notif-dropdown-item .notif-title {
      font-weight: 700;
      color: var(--accent-gold);
      margin-bottom: 3px;
      font-size: 0.82rem;
    }

    .notif-dropdown-item .notif-desc {
      color: var(--text-muted, #94a3b8);
      font-size: 0.76rem;
      line-height: 1.35;
    }

    /* ADMIN ACCOUNT & ROLES MODAL SCROLLBAR & LANDSCAPE LAYOUT */
    #admin-account-modal .modal-card {
      max-width: 660px !important;
      width: 95% !important;
      height: 92vh !important;
      max-height: 94vh !important;
      display: flex !important;
      flex-direction: column !important;
      overflow: hidden !important;
      padding: 0 !important;
    }

    #admin-account-modal .modal-body {
      flex: 1 1 auto !important;
      height: calc(100% - 110px) !important;
      max-height: calc(94vh - 110px) !important;
      overflow-y: auto !important;
      padding: 16px 20px !important;
      scrollbar-width: thin !important;
      scrollbar-color: var(--accent-gold) rgba(255,255,255,0.08) !important;
    }

    #admin-account-modal .modal-body::-webkit-scrollbar {
      width: 6px !important;
    }

    #admin-account-modal .modal-body::-webkit-scrollbar-track {
      background: rgba(0, 0, 0, 0.2) !important;
      border-radius: 8px !important;
    }

    #admin-account-modal .modal-body::-webkit-scrollbar-thumb {
      background: var(--accent-gold) !important;
      border-radius: 8px !important;
    }

    #admin-account-modal .custom-select-container .custom-select-list {
      top: calc(100% + 4px) !important;
      bottom: auto !important;
      z-index: 99999999 !important;
      max-height: 200px !important;
      overflow-y: auto !important;
    }

    /* ZERO-SCROLL 2-COLUMN DROPDOWNS & SOLID OPAQUE PATCH FOR UPLOAD MODAL */
    #editor-modal .custom-select-list {
      display: none;
      position: absolute !important;
      top: calc(100% + 4px) !important;
      bottom: auto !important;
      left: 0 !important;
      background: #0f071e !important;
      backdrop-filter: blur(20px) !important;
      -webkit-backdrop-filter: blur(20px) !important;
      border: 1.5px solid var(--accent-gold) !important;
      border-radius: 12px !important;
      z-index: 99999999 !important;
      width: 320px !important;
      max-width: 88vw !important;
      max-height: 190px !important;
      box-shadow: 0 15px 50px rgba(0, 0, 0, 0.98) !important;
      padding: 8px !important;
      box-sizing: border-box !important;
      overflow-y: auto !important;
      overflow-x: hidden !important;
      scrollbar-width: thin !important;
    }

    #editor-modal .custom-select-container.drop-up .custom-select-list,
    #editor-modal .drop-up .custom-select-list {
      top: auto !important;
      bottom: calc(100% + 4px) !important;
      box-shadow: 0 -15px 50px rgba(0, 0, 0, 0.98) !important;
    }

    #editor-modal .custom-select-container {
      position: relative !important;
      overflow: visible !important;
    }

    #editor-modal .form-group:has(.custom-select-container.open),
    #editor-modal .col:has(.custom-select-container.open),
    #editor-modal .custom-select-container.open {
      z-index: 99999999 !important;
      position: relative !important;
    }

    #editor-modal .custom-select-list.open {
      display: grid !important;
      grid-template-columns: 1fr 1fr !important;
      gap: 6px !important;
    }

    #editor-modal .custom-select-item {
      padding: 7px 10px !important;
      font-size: 0.73rem !important;
      font-weight: 600 !important;
      color: #ffffff !important;
      border-radius: 6px !important;
      background: #1b0e3b !important;
      border: 1px solid rgba(255, 255, 255, 0.12) !important;
      white-space: nowrap !important;
      overflow: hidden !important;
      text-overflow: ellipsis !important;
      text-align: left !important;
      transition: all 0.15s ease !important;
    }

    #editor-modal .custom-select-item:hover,
    #editor-modal .custom-select-item.active,
    #editor-modal .custom-select-item.selected {
      background: var(--accent-gold) !important;
      color: #000000 !important;
      font-weight: 800 !important;
      border-color: var(--accent-gold) !important;
    }

    #editor-modal .modal-collapsible-body {
      max-height: none !important;
      overflow: visible !important;
    }

    #editor-modal #themes-dropdown-list,
    #editor-modal #moods-dropdown-list {
      display: flex !important;
      flex-wrap: wrap !important;
      gap: 4px !important;
      max-height: none !important;
      overflow: visible !important;
    }
  
    /* BULLETPROOF LOGIN OVERLAY SCREEN (COVER TOP HEADER & DASHBOARD) */
    #login-overlay {
      position: fixed !important;
      top: 0 !important;
      left: 0 !important;
      right: 0 !important;
      bottom: 0 !important;
      width: 100vw !important;
      height: 100vh !important;
      background: #090214 !important;
      z-index: 99999999 !important;
      display: flex;
      align-items: center !important;
      justify-content: center !important;
    }

    /* Mobile & Tablet Landscape Optimization Rules */
    @media screen and (max-width: 1024px) {
      /* Top bar scaling - Compact Inline Layout */
      .portal-top-bar {
        height: 50px !important;
        padding: 0 12px !important;
        gap: 8px !important;
      }
      .portal-top-left {
        gap: 10px !important;
        flex: 0 1 auto !important;
        min-width: 0 !important;
      }
      .portal-top-right {
        gap: 8px !important;
        flex: 0 0 auto !important;
        margin-left: auto !important;
      }
      .portal-logo-box {
        gap: 6px !important;
        padding-right: 10px !important;
      }
      .portal-logo-img {
        height: 28px !important;
      }
      .portal-logo-title {
        font-size: 0.95rem !important;
      }
      .portal-logo-role {
        font-size: 0.7rem !important;
      }
      .portal-page-title {
        font-size: 1.05rem !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
      }
      .portal-page-desc {
        font-size: 0.7rem !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
      }
      .portal-search-wrapper {
        width: 160px !important;
        max-width: 160px !important;
        flex: 0 0 auto !important;
      }
      .portal-search-input {
        height: 32px !important;
        font-size: 0.76rem !important;
        padding-left: 28px !important;
      }
      .portal-icon-btn {
        width: 32px !important;
        height: 32px !important;
        flex-shrink: 0 !important;
      }
      .portal-action-btn {
        height: 32px !important;
        padding: 4px 10px !important;
        font-size: 0.76rem !important;
        white-space: nowrap !important;
        flex-shrink: 0 !important;
      }
      .portal-profile-pill {
        height: 32px !important;
        padding: 2px 8px 2px 4px !important;
        flex-shrink: 0 !important;
      }
      .portal-avatar-wrapper {
        width: 24px !important;
        height: 24px !important;
        font-size: 0.7rem !important;
      }
      .portal-profile-name {
        font-size: 0.72rem !important;
      }
      .portal-profile-role {
        font-size: 0.62rem !important;
      }

      /* Collapsible Sidebar (When Collapsed Mode Active) */
      .sidebar.collapsed {
        width: 52px !important;
        padding: 10px 4px !important;
        align-items: center !important;
      }
      .sidebar.collapsed .sidebar-logo {
        margin-bottom: 16px !important;
        justify-content: center !important;
        gap: 0 !important;
      }
      .sidebar.collapsed .sidebar-logo span {
        display: none !important;
      }
      .sidebar.collapsed .sidebar-logo img {
        height: 26px !important;
      }
      .sidebar.collapsed .nav-section-title {
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        padding: 4px 0 !important;
        margin: 4px 0 !important;
        width: 100% !important;
      }
      .sidebar.collapsed .nav-section-title .nav-section-text {
        display: none !important;
      }
      .sidebar.collapsed .nav-section-title .nav-section-divider {
        display: block !important;
        width: 26px !important;
        height: 0 !important;
        border: none !important;
        border-top: 1.5px solid rgba(255, 215, 0, 0.35) !important;
        margin: 2px auto !important;
      }
      .sidebar.collapsed .menu-list {
        align-items: center !important;
        width: 100% !important;
        gap: 4px !important;
      }
      .sidebar.collapsed .menu-item {
        justify-content: center !important;
        align-items: center !important;
        padding: 0 !important;
        width: 40px !important;
        height: 40px !important;
        border-radius: 10px !important;
        font-size: 0 !important;
        margin: 0 auto !important;
      }
      .sidebar.collapsed .menu-item span {
        display: none !important;
      }
      .sidebar.collapsed .menu-item i, .sidebar.collapsed .menu-item svg {
        width: 18px !important;
        height: 18px !important;
        margin: 0 !important;
      }
      .sidebar.collapsed .menu-item.active {
        border-left: none !important;
        background: rgba(255, 215, 0, 0.15) !important;
        border: 1.5px solid var(--accent-gold) !important;
        color: var(--accent-gold) !important;
        border-radius: 10px !important;
      }

      /* Content Area Landscape & Mobile Fitting - Full Width & Height Utilization */
      .content-wrapper {
        width: 100% !important;
        max-width: 100% !important;
        flex: 1 1 auto !important;
        margin: 0 !important;
        padding: 10px 12px 30px 12px !important;
        box-sizing: border-box !important;
      }

      .admin-pane {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
      }

      /* Editor Modal Responsive Layout Fix for Mobile Landscape */
      #editor-modal.modal-overlay {
        padding: 3px 6px !important;
        align-items: center !important;
        justify-content: center !important;
      }
      #editor-modal .modal-card {
        width: 99.5% !important;
        max-width: 100% !important;
        height: calc(100vh - 6px) !important;
        max-height: calc(100vh - 6px) !important;
        margin: 0 auto !important;
        border-radius: 10px !important;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.95) !important;
      }
      #editor-modal .modal-header {
        padding: 6px 12px !important;
        flex-shrink: 0 !important;
      }
      #editor-modal .modal-header h2 {
        font-size: 0.95rem !important;
      }
      #editor-modal .modal-header span {
        font-size: 0.65rem !important;
      }
      #editor-modal .modal-footer {
        padding: 6px 12px !important;
        flex-shrink: 0 !important;
      }
      #editor-modal .modal-footer span {
        font-size: 0.65rem !important;
      }
      #editor-modal .modal-footer .btn {
        padding: 5px 12px !important;
        font-size: 0.75rem !important;
      }
      #editor-modal .modal-body {
        grid-template-columns: 1.05fr 1fr 0.95fr !important;
        gap: 10px !important;
        padding: 8px 12px !important;
        flex: 1 1 auto !important;
        max-height: none !important;
        overflow-y: auto !important;
        scrollbar-width: thin !important;
      }

      /* Actions Bar & Filter Controls horizontal fitting */
      .actions-bar {
        padding-top: 6px !important;
        padding-bottom: 6px !important;
        margin-bottom: 8px !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        gap: 8px !important;
        width: 100% !important;
      }

      select.filter-select, select.form-control {
        height: 32px !important;
        padding: 2px 26px 2px 10px !important;
        font-size: 0.78rem !important;
        border-radius: 8px !important;
        max-width: 100% !important;
      }

      /* Filter Header Boxes (Gold Bordered Boxes) Stretch 100% */
      div[style*="border: 1.5px solid #f7d36a"] {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        justify-content: space-evenly !important;
        gap: 10px 14px !important;
        padding: 10px 14px !important;
      }

      /* Cards & Grid Containers Stretch 100% Across Landscape Screen */
      .stats-grid, .grid, .dashboard-cards-grid, .ads-slots-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) !important;
        gap: 12px !important;
        width: 100% !important;
        max-width: 100% !important;
      }

      div[style*="display: flex; gap: 20px; flex-wrap: wrap;"] {
        width: 100% !important;
        box-sizing: border-box !important;
      }

      /* Table Full Width Expansion Fix - Table expands across 100% container width */
      .table-wrapper, .table-container {
        width: 100% !important;
        max-width: 100% !important;
        display: block !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        margin-bottom: 20px !important;
      }
      
      table {
        width: 100% !important;
        min-width: 100% !important;
        display: table !important;
        border-collapse: collapse !important;
        table-layout: auto !important;
      }
      
      table th, table td {
        padding: 8px 10px !important;
        font-size: 0.78rem !important;
        white-space: nowrap !important;
      }
    }

    /* Extra Low-Height Mobile Landscape Overlay Fit */
    @media screen and (max-height: 520px) {
      #login-overlay {
        padding: 12px !important;
        overflow-y: auto !important;
      }
      .login-card {
        padding: 16px 24px !important;
        max-width: 360px !important;
        max-height: 96vh !important;
        overflow-y: auto !important;
        border-radius: 16px !important;
      }
      .login-card img {
        height: 60px !important;
      }
      .login-logo {
        font-size: 1.4rem !important;
      }
      .login-subtitle {
        font-size: 0.78rem !important;
        margin-bottom: 12px !important;
      }
      .form-group {
        margin-bottom: 10px !important;
      }
      .form-control {
        padding: 8px 12px !important;
        font-size: 0.85rem !important;
      }
      .btn {
        padding: 9px !important;
        font-size: 0.85rem !important;
      }
      .portal-top-bar {
        height: 46px !important;
      }
    }

  
    /* ENHANCED MODAL INTERNAL SCROLLING & BOUNDS */
    .modal-overlay {
      position: absolute !important;
      top: 0 !important;
      left: 0 !important;
      right: 0 !important;
      bottom: 0 !important;
      width: 100% !important;
      height: 100% !important;
      min-width: 100% !important;
      min-height: 100% !important;
      background: rgba(5, 2, 14, 0.88) !important;
      backdrop-filter: blur(14px) !important;
      -webkit-backdrop-filter: blur(14px) !important;
      z-index: 9999999 !important;
      display: none;
      justify-content: center;
      align-items: center;
      padding: 16px !important;
      box-sizing: border-box !important;
    }

    .modal-card {
      background: #110922 !important;
      border: 1.5px solid var(--border-color) !important;
      border-radius: 20px !important;
      width: 95% !important;
      max-width: 540px;
      max-height: 88vh;
      display: flex !important;
      flex-direction: column !important;
      box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9) !important;
      overflow: hidden !important;
      position: relative !important;
      margin: auto !important;
    }

    #editor-modal .modal-card {
      max-width: 1400px !important;
      width: 96% !important;
      max-height: 96vh !important;
    }

    /* =========================================================
       ADMIN MOBILE APP CONTENT UPLOAD MODAL OPTIMIZATIONS
       (Applies strictly in Admin Mobile App / Mobile Landscape)
       ========================================================= */
    body.is-mobile-app #editor-modal.modal-overlay,
    @media screen and (max-height: 580px) {
      #editor-modal.modal-overlay {
        padding: 4px 6px !important;
        align-items: center !important;
        justify-content: center !important;
      }

      #editor-modal .modal-card {
        width: 99.2% !important;
        max-width: 100% !important;
        height: calc(100vh - 8px) !important;
        max-height: calc(100vh - 8px) !important;
        margin: auto !important;
        border-radius: 12px !important;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.95) !important;
      }

      #editor-modal .modal-header {
        padding: 6px 14px !important;
        flex-shrink: 0 !important;
      }

      #editor-modal .modal-header h2 {
        font-size: 0.95rem !important;
      }

      #editor-modal .modal-header span {
        font-size: 0.65rem !important;
      }

      #editor-modal .modal-footer {
        padding: 6px 14px !important;
        flex-shrink: 0 !important;
      }

      #editor-modal .modal-footer span {
        font-size: 0.65rem !important;
      }

      #editor-modal .modal-footer .btn {
        padding: 5px 12px !important;
        font-size: 0.75rem !important;
      }

      #editor-modal .modal-body {
        flex: 1 1 auto !important;
        max-height: none !important;
        padding: 8px 12px !important;
        gap: 10px !important;
        overflow-y: auto !important;
        scrollbar-width: thin !important;
      }

      #editor-modal .form-control,
      #editor-modal select.filter-select {
        padding: 4px 8px !important;
        font-size: 0.76rem !important;
      }

      /* Compact Cover Image & Audio File selection boxes for Mobile App */
      #editor-modal .upload-file-box {
        padding: 8px 10px !important;
        margin: 0 !important;
        height: auto !important;
        min-height: auto !important;
        flex: none !important;
        border-radius: 8px !important;
        background: rgba(255, 255, 255, 0.03) !important;
      }

      #editor-modal #cover-upload-box {
        border: 1.5px dashed rgba(255, 215, 0, 0.4) !important;
      }

      #editor-modal #audio-upload-box {
        border: 1.5px dashed rgba(139, 92, 246, 0.45) !important;
      }
    }

    .modal-header {
      padding: 16px 20px !important;
      border-bottom: 1.5px solid var(--border-color) !important;
      display: flex !important;
      justify-content: space-between !important;
      align-items: center !important;
      flex-shrink: 0 !important;
      background: #110922 !important;
    }

    .modal-body {
      padding: 16px 20px !important;
      overflow-y: auto !important;
      overflow-x: hidden !important;
      flex: 1 1 auto !important;
      max-height: calc(88vh - 110px) !important;
      scrollbar-width: thin !important;
    }

    .modal-footer,
    .modal-actions {
      padding: 12px 20px !important;
      border-top: 1.5px solid var(--border-color) !important;
      display: flex !important;
      justify-content: flex-end !important;
      align-items: center !important;
      gap: 10px !important;
      flex-shrink: 0 !important;
      background: #110922 !important;
    }

    .custom-select-list {
      display: none;
      position: absolute;
      top: calc(100% + 4px);
      left: 0;
      background: #0d061c !important;
      background-color: #0d061c !important;
      border: 1.5px solid var(--accent-gold) !important;
      border-radius: 12px !important;
      z-index: 99999999 !important;
      min-width: 100%;
      width: max-content;
      max-width: 320px;
      max-height: none !important;
      overflow: visible !important;
      box-shadow: 0 14px 40px rgba(0, 0, 0, 0.98) !important;
      padding: 0 !important;
    }

  
    /* STACKING HIERARCHY & DROPDOWN FLOATING RULES (ZERO CROPPING) */
    .actions-bar {
      position: relative !important;
      z-index: 50 !important;
      overflow: visible !important;
    }

    .actions-bar > div:first-child {
      position: relative !important;
      z-index: 40 !important;
    }

    .yellow-filter-box {
      position: relative !important;
      z-index: 30 !important;
      overflow: visible !important;
    }

    .table-container {
      position: relative !important;
      z-index: 1 !important;
      overflow-x: auto !important;
      overflow-y: visible !important;
    }

    .custom-select-container {
      position: relative !important;
      overflow: visible !important;
    }

    .custom-select-container.open,
    .custom-select-container:focus-within {
      z-index: 9999999 !important;
    }

    .custom-select-list.open {
      display: block !important;
    }

    .custom-select-container.drop-up .custom-select-list,
    .drop-up .custom-select-list {
      top: auto !important;
      bottom: calc(100% + 6px) !important;
      box-shadow: 0 -15px 40px rgba(0, 0, 0, 0.98) !important;
    }
