:root {
      --primary-color: #4285F4;
      --primary-dark: #FFFFFF;
      --background: #F8F9FA;
      --secondary: #E9ECEF;
      --text-color: #202124;
      --danger: #EA4335;
      --success: #34A853;
      --warning: #FBBC05;
    }

    * {
      box-sizing: border-box;
    }

    body {
      margin: 0;
      padding: 0;
      font-family: 'Roboto', sans-serif;
      background: var(--background);
      color: var(--text-color);
      font-size: 16px;
      line-height: 1.5;
    }

    header {
      background: var(--primary-dark);
      padding: 15px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      box-shadow: 0 2px 4px rgba(0,0,0,0.1);
      position: sticky;
      top: 0;
      z-index: 100;
    }

    header .logo-container {
      display: flex;
      align-items: center;
    }

    header .logo {
      font-size: 1.2rem;
      font-weight: bold;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      margin-right: 15px;
      color: var(--primary-color);
    }

    .datetime {
      font-size: 0.8rem;
      color: #5f6368;
    }

    .logout-btn {
      padding: 5px 10px;
      background: var(--primary-color);
      color: white;
      border: none;
      border-radius: 6px;
      cursor: pointer;
      font-weight: bold;
      font-size: 0.8rem;
      margin-left: 10px;
      width: auto;
      height: 30px;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .user-info {
      display: flex;
      align-items: center;
    }
    
    .user-level {
        font-size: 0.7rem;
        font-weight: bold;
        padding: 3px 8px;
        border-radius: 10px;
        margin-left: 8px;
        background-color: var(--warning);
        color: var(--primary-dark);
        text-transform: uppercase;
        animation: level-glow 2.5s infinite ease-in-out;
        transition: transform 0.3s ease;
    }

    .username {
      margin-right: 10px;
      font-size: 0.9rem;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      max-width: 150px;
    }

    .tabs {
      display: flex;
      justify-content: center;
      background: var(--primary-dark);
      overflow-x: auto;
      white-space: nowrap;
      -webkit-overflow-scrolling: touch;
      border-bottom: 1px solid var(--secondary);
    }

    .tab {
      padding: 10px 15px;
      cursor: pointer;
      font-weight: bold;
      font-size: 0.9rem;
      min-width: 100px;
      color: #5f6368;
      border-bottom: 2px solid transparent;
      text-transform: uppercase;
      position: relative;
      /* MODIFICATION: Flex properties for alignment */
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
    }

    .tab.active {
      color: var(--primary-color);
      border-bottom: 2px solid var(--primary-color);
    }

    .container {
      width: 95%;
      max-width: 1200px;
      margin: 15px auto;
      background: var(--primary-dark);
      padding: 15px;
      border-radius: 10px;
      box-shadow: 0 0 15px rgba(0,0,0,0.05);
    }

    input, button, select {
      padding: 10px;
      border-radius: 6px;
      border: 1px solid #ddd;
      margin: 8px 0;
      font-size: 1rem;
      width: 100%;
      font-family: 'Roboto', sans-serif;
    }
    
    .form-group {
        margin-bottom: 12px;
    }
    .form-group label {
        display: block;
        margin-bottom: 4px;
        font-size: 0.9rem;
        color: #5f6368;
    }

    button {
      background: var(--primary-color);
      color: white;
      font-weight: bold;
      cursor: pointer;
      transition: all 0.3s ease;
      border: none;
    }

    button:hover {
      opacity: 0.9;
      transform: translateY(-2px);
    }
    
    .cancel-edit-btn {
        background-color: #6c757d;
        color: white;
        margin-top: 10px;
    }
    .cancel-edit-btn:hover {
        background-color: #5a6268;
        box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    }

    table {
      width: 100%;
      margin-top: 15px;
      border-collapse: collapse;
      font-size: 0.75rem;
      table-layout: fixed;
    }

    th, td {
      border: 1px solid var(--secondary);
      padding: 3px 5px;
      text-align: center;
      word-break: break-word;
      line-height: 1.2;
    }
    
    #siteLabelList tr, #sosmedManagementContainer tbody tr {
        cursor: grab;
    }
    #siteLabelList tr:active, #sosmedManagementContainer tbody tr:active {
        cursor: grabbing;
        background: #f1f1f1;
    }
    
    .domain-urls {
        text-align: left;
        padding: 8px 10px !important;
        font-size: 0.7rem;
    }
    .domain-urls div {
        margin-bottom: 5px;
        display: flex;
        align-items: center;
    }
    .domain-urls span {
        font-weight: bold;
        color: var(--primary-color);
        margin-right: 8px;
        display: inline-block;
        min-width: 50px;
    }
    .domain-urls a {
        color: #1a73e8;
        text-decoration: none;
        word-break: break-all;
    }
    .domain-urls a:hover {
        text-decoration: underline;
    }


    th {
      background: var(--secondary);
      font-size: 0.75rem;
      padding: 5px;
      font-weight: 700;
    }

    tr:hover {
      background-color: #f1f1f1;
    }

    .hidden { 
      display: none !important; 
    }

    .status {
      display: inline-block;
      padding: 2px 6px;
      border-radius: 12px;
      animation: pulse 2s infinite;
      font-size: 0.7rem;
      white-space: nowrap;
    }

    .used-yes {
      background: var(--danger);
      color: white;
    }

    .used-no {
      background: var(--success);
      color: white;
    }

    .used-suspend {
      background: var(--warning);
      color: white;
    }
    
    .status-suspended {
      background: var(--warning);
      color: white;
      animation: none;
    }

    .status-active {
      background: var(--success);
      color: white;
      animation: none;
    }
    
    .collapsible-header {
        background: var(--secondary);
        padding: 10px 15px;
        cursor: pointer;
        border-radius: 6px;
        margin-bottom: 5px; /* Adjusted */
        user-select: none;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    .collapsible-header h2, .collapsible-header h4 {
        margin: 0;
        font-size: 1.1rem;
    }
    .collapsible-content {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease-out;
        background-color: #f8f9fa;
        border-radius: 0 0 6px 6px;
        padding: 0 15px; /* Padding will be applied when open */
    }
     .collapsible-header.active + .collapsible-content {
        max-height: 5000px; /* Large enough value */
        padding: 15px; /* Add padding when content is visible */
    }
    .collapsible-header.active {
       border-bottom-left-radius: 0;
       border-bottom-right-radius: 0;
       margin-bottom: 0;
    }

    .collapsible-icon::after {
        content: '▼';
        font-size: 0.8em;
        transition: transform 0.3s ease;
    }
    .collapsible-header.active .collapsible-icon::after {
        transform: rotate(180deg);
    }


    @keyframes pulse {
      0% { transform: scale(1); }
      50% { transform: scale(1.05); }
      100% { transform: scale(1); }
    }
    
    @keyframes level-glow {
      0% {
        box-shadow: 0 0 4px rgba(251, 188, 5, 0.6);
      }
      50% {
        box-shadow: 0 0 12px rgba(251, 188, 5, 1);
        transform: scale(1.05);
      }
      100% {
        box-shadow: 0 0 4px rgba(251, 188, 5, 0.6);
      }
    }

    #toast {
      visibility: hidden;
      min-width: 250px;
      max-width: 90%;
      background-color: #333;
      color: white;
      text-align: center;
      border-radius: 8px;
      padding: 12px 20px;
      position: fixed;
      z-index: 9999;
      bottom: 20px;
      right: 20px;
      left: 20px;
      font-weight: bold;
      box-shadow: 0 0 12px rgba(0,0,0,0.2);
      transition: all 0.5s ease;
      margin: 0 auto;
      word-wrap: break-word;
      white-space: pre-wrap;
      overflow-wrap: break-word;
      max-height: 80vh;
      overflow-y: auto;
    }

    #toast.show {
      visibility: visible;
      bottom: 30px;
      opacity: 1;
    }

    #toast.danger {
      color: white;
      background-color: var(--danger);
    }

    select {
      background: #fff;
      color: #111;
    }

    .dropbtn {
      background-color: var(--primary-color);
      color: white;
      padding: 3px 6px;
      font-size: 0.7rem;
      border: none;
      cursor: pointer;
      border-radius: 4px;
      font-weight: bold;
      font-family: 'Roboto', sans-serif;
    }

    .dropbtn:hover, .dropbtn:focus {
      opacity: 0.9;
      transform: translateY(-2px);
    }

    .dropdown {
      position: relative;
      display: inline-block;
    }

    .dropdown-content {
      display: none;
      position: absolute;
      background-color: var(--primary-dark);
      min-width: 110px;
      box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
      z-index: 1;
      border-radius: 4px;
      right: 0;
      border: 1px solid var(--secondary);
    }

    .dropdown-content button {
      color: var(--text-color);
      padding: 3px 6px;
      text-decoration: none;
      display: block;
      text-align: left;
      background: transparent;
      border: none;
      width: 100%;
      border-radius: 0;
      margin: 0;
      font-size: 0.7rem;
    }

    .dropdown-content button:hover {
      background-color: var(--secondary);
    }

    .show-dropdown {
      display: block;
    }

    .pagination-wrapper {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin: 15px 0;
      flex-wrap: wrap;
    }

    .pagination-info {
      font-size: 0.8rem;
      color: #5f6368;
    }

    .pagination-controls {
      display: flex;
      gap: 5px;
    }

    .pagination-btn {
      background: var(--secondary);
      color: var(--text-color);
      border: none;
      border-radius: 4px;
      padding: 5px 10px;
      cursor: pointer;
      font-size: 0.8rem;
      min-width: 30px;
      text-align: center;
    }

    .pagination-btn.active {
      background: var(--primary-color);
      color: white;
      font-weight: bold;
    }

    .pagination-btn:disabled {
      opacity: 0.5;
      cursor: not-allowed;
    }

    .pagination-btn:hover:not(:disabled) {
      background: #ddd;
    }

    .status-toggle {
        display: inline-block;
        border-radius: 20px;
        border: none;
        outline: none;
        cursor: pointer;
        min-width: 65px;
        padding: 5px 14px;
        font-size: 0.85em;
        font-weight: bold;
        background: #ccc;
        color: #fff;
        transition: all 0.18s cubic-bezier(.25,.8,.25,1);
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        letter-spacing: 1px;
        position: relative;
    }

    .status-toggle.on {
      background: var(--success);
      color: #fff;
      box-shadow: 0 0 12px rgba(52, 168, 83, 0.3);
    }

    .status-toggle.off {
      background: var(--danger);
      color: #fff;
      box-shadow: 0 0 12px rgba(234, 67, 53, 0.3);
    }

    .status-toggle:active {
      transform: scale(0.98);
    }
    .checkbox-container {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
      margin-top: 5px;
      margin-bottom: 15px;
      padding: 10px;
      background-color: #f8f9fa;
      border-radius: 6px;
    }
    .checkbox-item {
      display: flex;
      align-items: center;
      gap: 5px;
    }
    .checkbox-item input[type="checkbox"] {
      width: 15px;
      height: 15px;
      cursor: pointer;
    }
    .checkbox-item label {
      font-size: 0.85rem;
      cursor: pointer;
    }
    
    [data-feature] {
        display: block;
    }
    
    [data-feature].hidden-feature {
        display: none !important;
    }

    /* Custom style for compact voucher table */
    #luckywheelContentVoucher table th, #luckywheelContentVoucher table td {
        padding: 2px 4px;
        font-size: 0.7rem;
        white-space: nowrap;
        line-height: 1.1;
    }
    #luckywheelContentVoucher table td:nth-child(7), /* Dibuat Oleh */
    #luckywheelContentVoucher table td:nth-child(8) { /* Waktu Dibuat */
        white-space: normal; /* Allow wrapping for longer content */
    }
    
    /* Styles for new Charts Tab */
    #chartsTab {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
      gap: 20px;
    }
    .chart-card {
        background-color: var(--primary-dark);
        padding: 15px;
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    }
    .chart-card h3 {
        margin-top: 0;
        border-bottom: 2px solid var(--primary-color);
        padding-bottom: 10px;
        font-size: 1.1rem;
    }
    .stats-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 15px;
        margin-top: 15px;
    }
    .stat-item {
        background-color: #f8f9fa;
        padding: 15px;
        border-radius: 6px;
        text-align: center;
    }
    .stat-item .stat-value {
        font-size: 1.8rem;
        font-weight: 700;
        display: block;
        color: var(--primary-color);
    }
    .stat-item .stat-label {
        font-size: 0.8rem;
        color: #5f6368;
        margin-top: 5px;
        display: block;
    }
    .online-admins-list {
        list-style: none;
        padding: 0;
        margin-top: 10px;
        max-height: 150px;
        overflow-y: auto;
    }
    .online-admins-list li {
        background-color: #f8f9fa;
        padding: 8px 12px;
        border-radius: 4px;
        margin-bottom: 5px;
        font-size: 0.9rem;
        display: flex;
        align-items: center;
    }
    .online-indicator {
        width: 10px;
        height: 10px;
        background-color: var(--success);
        border-radius: 50%;
        margin-right: 10px;
        animation: pulse 1.5s infinite;
    }
    #chart-container {
        grid-column: 1 / -1; /* Span full width on larger screens */
        min-height: 350px;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    
    /* Minimalist Login Style */
    #loginContainer {
      max-width: 380px;
      margin: 80px auto 20px;
      padding: 40px;
      text-align: center;
      box-shadow: 0 4px 20px rgba(0,0,0,0.1);
      border-radius: 12px;
    }

    #loginContainer h2 {
      margin: 0 0 30px 0;
      font-size: 1.8rem;
      font-weight: 500;
      color: var(--primary-color);
    }
    
    #loginContainer input {
        margin-bottom: 15px;
    }

    #loginContainer button {
        margin-top: 15px;
        padding: 12px;
        font-size: 1.1rem;
    }
    
    /* Style for file inputs */
    input[type="file"] {
        padding: 8px;
        background-color: #f0f0f0;
        border: 1px dashed #ccc;
        font-size: 0.85rem;
    }

    /* MODAL STYLES */
    .modal-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.6);
        z-index: 1001;
        display: flex;
        justify-content: center;
        align-items: center;
        backdrop-filter: blur(4px);
    }
    .modal-content {
        background-color: var(--primary-dark);
        padding: 25px;
        border-radius: 12px;
        box-shadow: 0 5px 25px rgba(0,0,0,0.2);
        width: 90%;
        max-width: 500px;
        position: relative;
        animation: modal-fade-in 0.3s ease;
    }
    .modal-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 1px solid var(--secondary);
        padding-bottom: 15px;
        margin-bottom: 15px;
    }
    .modal-header h2 {
        margin: 0;
        font-size: 1.2rem;
    }
    .modal-body ul {
        list-style: none;
        padding: 0;
        margin: 0;
        font-size: 0.9rem;
    }
    .modal-body li {
        padding: 8px 0;
        border-bottom: 1px solid #f0f0f0;
        display: flex;
    }
     .modal-body li:last-child { border-bottom: none; }
    .modal-body li strong {
        color: var(--primary-color);
        min-width: 120px;
        display: inline-block;
    }
    @keyframes modal-fade-in {
        from { transform: translateY(-30px); opacity: 0; }
        to { transform: translateY(0); opacity: 1; }
    }

    /* SHIPPING STATUS BUTTON STYLES */
    .shipping-status-btn {
        border-radius: 15px;
        border: none;
        padding: 4px 10px;
        font-size: 0.7rem;
        font-weight: bold;
        color: white;
        cursor: pointer;
        transition: all 0.2s ease;
        min-width: 80px;
    }
    .shipping-status-btn.pending {
        background-color: var(--warning);
    }
    .shipping-status-btn.paid {
        background-color: var(--primary-color);
    }
    .shipping-status-btn.shipped {
        background-color: var(--success);
    }
    .shipping-status-btn:hover {
        transform: scale(1.05);
    }
    
    /* Navigation/Filter buttons for Parcel Tab */
    .nav-filter-controls {
        display: flex;
        gap: 10px;
        margin-bottom: 15px;
        flex-wrap: wrap;
    }
    .nav-filter-btn {
        background: var(--secondary);
        color: var(--text-color);
        border: none;
        border-radius: 6px;
        padding: 8px 15px;
        cursor: pointer;
        font-size: 0.9rem;
        font-weight: 500;
        width: auto;
        margin: 0;
        position: relative;
        /* MODIFICATION: Flex properties for alignment */
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
    }
    .nav-filter-btn.active {
        background: var(--primary-color);
        color: white;
        font-weight: bold;
        box-shadow: 0 2px 8px rgba(66, 133, 244, 0.4);
    }

    /* MODIFICATION: BADGE STYLES */
    .tab-badge, .filter-badge {
        background-color: var(--danger);
        color: white;
        border-radius: 10px;    /* Pill shape */
        padding: 2px 6px;       /* Vertical and horizontal padding for flexibility */
        min-width: 20px;        /* Minimum width to maintain shape for single digits */
        font-size: 0.75rem;     /* Slightly more readable font size */
        font-weight: bold;
        line-height: 1;         /* Control height */
        display: none;          /* Hidden by default */
        flex-shrink: 0;
        align-items: center;
        justify-content: center;
        /* No longer has a fixed width/height, allowing it to grow */
    }


    .tab-badge.visible, .filter-badge.visible {
        display: inline-flex; /* Show when they have content, use flex */
    }

    /* ========== NOTIFICATION STYLES START ========== */
    .notification-container {
        position: relative;
        display: flex;
        align-items: center;
        margin-left: 15px;
        margin-right: 15px;
    }
    .notification-icon {
        cursor: pointer;
        font-size: 1.5rem;
        position: relative;
        color: #6c757d;
    }
    .notification-badge {
        position: absolute;
        top: -5px;
        right: -10px;
        background-color: var(--danger);
        color: white;
        border-radius: 50%;
        width: 20px;
        height: 20px;
        font-size: 0.75rem;
        font-weight: bold;
        display: flex;
        align-items: center;
        justify-content: center;
        border: 2px solid var(--primary-dark);
    }
    .notification-dropdown {
        display: none;
        position: absolute;
        top: calc(100% + 15px);
        left: 50%;
        transform: translateX(-50%);
        width: 350px;
        background-color: white;
        box-shadow: 0 4px 15px rgba(0,0,0,0.15);
        border-radius: 8px;
        z-index: 101;
        border: 1px solid var(--secondary);
        max-height: 400px;
        flex-direction: column;
    }
    .notification-dropdown.show { display: flex; }
    .notification-header {
        padding: 10px 15px;
        font-weight: bold;
        border-bottom: 1px solid var(--secondary);
        color: var(--primary-color);
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    #notificationList { overflow-y: auto; }
    .notification-item {
        padding: 12px 15px;
        border-bottom: 1px solid #f0f0f0;
        font-size: 0.85rem;
        line-height: 1.4;
        cursor: default;
    }
    .notification-item:last-child { border-bottom: none; }
    .notification-item.unread { background-color: #eaf2ff; }
    .notification-item .timestamp {
        font-size: 0.75rem;
        color: #6c757d;
        display: block;
        margin-top: 4px;
    }
    .notification-empty {
        text-align: center;
        padding: 20px;
        color: #6c757d;
        font-size: 0.9rem;
    }
    /* ========== NOTIFICATION STYLES END ========== */
    
    /* NEW: Admin Level UI Enhancement Styles */
    #adminTabAccess .tab-access-item {
        width: 100%;
        margin-bottom: 10px;
        padding-bottom: 10px;
        border-bottom: 1px solid #eee;
    }
    #adminTabAccess .tab-access-item:last-child {
        border-bottom: none;
    }
    .feature-checklist {
        padding: 10px;
        margin-top: 8px;
        margin-left: 20px;
        background-color: #f1f3f5;
        border-radius: 4px;
        border: 1px solid #e9ecef;
    }
    .feature-checklist h5 {
        margin: 0 0 8px 0;
        font-size: 0.9rem;
        color: var(--primary-color);
    }
     .feature-checklist .checkbox-container {
        background-color: transparent;
        padding: 0;
        margin: 0;
     }


    @media (min-width: 768px) {
      header .logo { font-size: 1.5rem; }
      .datetime { font-size: 0.9rem; }
      .logout-btn { padding: 6px 12px; font-size: 0.9rem; }
      .tab { padding: 12px 24px; font-size: 1rem; }
      .container { padding: 20px; margin: 20px auto; }
      table { font-size: 0.8rem; }
      th, td { padding: 4px 6px; }
      #toast { left: auto; right: 30px; max-width: 300px; }
      .username { max-width: 200px; font-size: 1rem; }
      .dropbtn { padding: 4px 8px; font-size: 0.75rem; }
      .dropdown-content { min-width: 120px; }
      .pagination-btn { padding: 6px 12px; font-size: 0.9rem; }
      .domain-urls { font-size: 0.8rem; }
    }

    @media (max-width: 480px) {
      .tab { min-width: auto; padding: 8px 12px; font-size: 0.8rem; }
      input, button, select { padding: 8px; font-size: 0.9rem; }
      table { font-size: 0.65rem; }
      th, td { padding: 2px 4px; }
      .status { padding: 1px 4px; font-size: 0.6rem; }
      .username { max-width: 100px; font-size: 0.8rem; }
      header .logo-container { flex-direction: column; align-items: flex-start; }
      .datetime { font-size: 0.7rem; margin-top: 3px; }
      #toast { padding: 10px 15px; font-size: 0.9rem; max-width: calc(100% - 40px); }
      .dropdown-content { min-width: 100px; }
      .pagination-wrapper { flex-direction: column; gap: 10px; }
      .pagination-controls { width: 100%; justify-content: center; }
      
      #loginContainer {
          margin-top: 40px;
          padding: 25px;
          width: 90%;
      }
      #loginContainer h2 {
          font-size: 1.5rem;
      }
    }

    ::-webkit-scrollbar { width: 8px; height: 8px; }
    ::-webkit-scrollbar-track { background: #f1f1f1; }
    ::-webkit-scrollbar-thumb { background: var(--primary-color); border-radius: 4px; }
    ::-webkit-scrollbar-thumb:hover { background: #1a73e8; }