    :root {
      --brand-primary: #1890ff;
      --brand-primary-hover: #40a9ff;
      --brand-danger: #ff4d4f;
      --brand-success: #52c41a;
      --sidebar-bg: #ffffff;
      --sidebar-border: #e8e8e8;
      --sidebar-text-main: #333333;
      --sidebar-text-muted: #888888;
      --content-bg: #f5f7fa;
      --page-bg: #f5f7fa;
      --text-main: #303133;
      --radius-md: 6px;
      --radius-lg: 12px;
      --sidebar-width: 280px;
      --header-height: 64px;
      --shadow-card: 0 1px 2px rgba(0, 0, 0, .06), 0 1px 6px -1px rgba(0, 0, 0, .04);
    }

    * { box-sizing: border-box; }
    
    .icon {
      width: 1em;
      height: 1em;
      display: inline-block;
      vertical-align: -0.125em;
      stroke: currentColor;
      fill: none;
      stroke-width: 2;
      stroke-linecap: round;
      stroke-linejoin: round;
      flex-shrink: 0;
    }

    
    .btn .icon { width: 16px; height: 16px; }
    .btn.small .icon { width: 15px; height: 15px; }
    .badge .icon { width: 14px; height: 14px; }

    
    .icon-btn {
      border: none;
      background: transparent;
      padding: 6px;
      border-radius: 8px;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      transition: background .15s ease, transform .1s ease, opacity .15s ease;
      line-height: 0;
    }
    .icon-btn:active { transform: scale(0.92); }

    body {
      margin: 0; padding: 0;
      font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
      background-color: var(--page-bg); color: var(--text-main);
      height: 100vh; overflow: hidden; 
    }

    
    .app-wrapper { display: flex; width: 100vw; height: 100vh; overflow: hidden; }
    .main-layout { display: flex; width: 100%; height: 100%; }
    .sidebar {
      width: var(--sidebar-width); background-color: var(--sidebar-bg);
      border-right: 1px solid var(--sidebar-border); display: flex; flex-direction: column; flex-shrink: 0; z-index: 20;
    }

    .brand-section { height: 80px; display: flex; flex-direction: column; justify-content: center; padding: 0 24px; flex-shrink: 0; position: relative;}
    .brand-section h1 { font-size: 20px; font-weight: 800; color: var(--sidebar-text-main); margin: 0; display: flex; align-items: center; gap: 10px; }
    .brand-section .sub { font-size: 12px; color: var(--sidebar-text-muted); margin-top: 4px; }
    .sidebar-menu { padding: 18px 18px 24px; display: flex; flex-direction: column; gap: 18px; overflow-y: auto; flex: 1; }
    .sidebar-section { display: flex; flex-direction: column; gap: 10px; }
    .section-title { font-size: 12px; font-weight: 800; color: #333; padding-left: 6px; letter-spacing: .02em; }
    .section-body { display: flex; flex-direction: column; gap: 12px; }

    .control-group .label { display: block; font-size: 13px; margin-bottom: 8px; color: #666; padding-left: 4px; font-weight: 700; }
    .input, .select, textarea {
      width: 100%; border: 1px solid #d9d9d9; border-radius: var(--radius-md); padding: 10px 12px; outline: none;
      background: #fff; transition: border-color .15s ease, box-shadow .15s ease; font-size: 14px;
    }
    textarea { min-height: 180px; resize: vertical; font-family: monospace; font-size: 13px; line-height: 1.5; }
    .result-textarea { min-height: 160px; }
    .input:focus, .select:focus, textarea:focus { border-color: var(--brand-primary); box-shadow: 0 0 0 3px rgba(24, 144, 255, .15); }

    
    .draggable-list { 
        list-style: none; padding: 0; margin: 0; 
        display: flex; flex-wrap: wrap; gap: 8px; 
    }
    .draggable-item {
      padding: 6px 10px; background: #fff; border: 1px solid #d9d9d9; border-radius: 4px; 
      cursor: grab; display: flex; align-items: center; gap: 6px; 
      font-size: 12px; color: #555; user-select: none; transition: all 0.2s;
    }
    .draggable-item:hover { border-color: var(--brand-primary); color: var(--brand-primary); }
    .draggable-item:active { cursor: grabbing; background: #f0f7ff; }
    .draggable-item.dragging { opacity: 0.5; border-style: dashed; }
    .draggable-item .icon { font-size: 10px; color: #aaa; }

    .draggable-item .drag-handle { display: inline-flex; align-items: center; justify-content: center; padding: 6px 8px; border-radius: 8px; }
    .draggable-item .drag-label { line-height: 1.2; }
    @media (max-width: 768px) {
      .draggable-item .drag-handle { padding: 10px 10px; }
      .draggable-item { touch-action: none; }
    }
    
    .delimiter-row { display: flex; gap: 8px; }
    .delimiter-row .input { flex: 1; }
    .delimiter-row .select { width: 100px; }

    .format-tip { font-size: 12px; color: #999; line-height: 1.5; padding: 0 2px; margin-top: 4px;}

    
    .upload-box {
      width: 100%; border: 1px dashed #d9d9d9; border-radius: var(--radius-md); background: #fafafa;
      padding: 16px 14px; text-align: center; cursor: pointer; transition: all .15s ease; position: relative;
    }
    .upload-box:hover { border-color: var(--brand-primary); background: #f5fbff; }
    .upload-box .icon { color: #999; font-size: 22px; margin-bottom: 6px; }
    .upload-box p { margin: 0; color: #666; font-size: 12px; }
    #file-input { display: none; }

    
    .btn {
      border: 1px solid transparent; border-radius: var(--radius-md); padding: 10px 12px; cursor: pointer;
      font-weight: 800; font-size: 13px; display: inline-flex; align-items: center; justify-content: center;
      gap: 8px; transition: all .15s ease; width: 100%; user-select: none;
    }
    .btn.small { width: auto; padding: 6px 12px; border-radius: 6px; font-size: 12px; }
    .btn.primary { background: var(--brand-primary); border-color: var(--brand-primary); color: #fff; }
    .btn.primary:hover { background: var(--brand-primary-hover); border-color: var(--brand-primary-hover); }
    .btn.danger { background: var(--brand-danger); border-color: var(--brand-danger); color: #fff; }
    .btn.danger:hover { filter: brightness(1.03); }
    .btn.outline-danger { background: #fff; color: var(--brand-danger); border-color: #ffb3b3; }
    .btn.outline-danger:hover { background: #fff5f5; }
    .btn.plain { background: #fff; color: var(--brand-primary); border-color: #b7dbff; }
    .btn.plain:hover { background: #f0f7ff; border-color: #84c5ff; }
    .btn:disabled { opacity: .55; cursor: not-allowed; }

    .sidebar-actions { display: flex; flex-direction: column; gap: 10px; }

    .stat-card {
      border: 1px solid #f0f0f0; border-radius: var(--radius-md); background: #fff; padding: 10px 12px;
      box-shadow: 0 1px 0 rgba(0, 0, 0, .02); display: flex; align-items: center; justify-content: space-between; gap: 16px; min-width: 180px;
    }
    .stat-label { font-size: 12px; color: #666; font-weight: 800; }
    .stat-value { font-size: 18px; font-weight: 900; color: #333; }

    
    .content-area { flex: 1; min-width: 0; display: flex; flex-direction: column; background-color: var(--content-bg); position: relative; overflow: hidden; }
    .top-toolbar {
      height: var(--header-height); background: #fff; border-bottom: 1px solid var(--sidebar-border);
      display: flex; align-items: center; justify-content: space-between; padding: 0 32px; gap: 16px; flex-shrink: 0;
    }
    .top-toolbar-top{
      flex: 1;
      min-width: 0;
      display: flex;
      align-items: center;
      gap: 16px;
    }

    .mobile-settings-wrap{ display: none; }
    .search-box { flex: 1; min-width: 220px; max-width: 560px; display: flex; align-items: center; gap: 10px; }
    .search-input-wrap { position: relative; width: 100%; }
    .search-input-wrap .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #999; font-size: 14px; pointer-events: none; }
    .search-input { padding-left: 34px; height: 42px; border-radius: 10px; font-weight: 600; }
    .toolbar-actions { display: flex; align-items: center; gap: 12px; }

    
    .table-container {
      flex: 1; min-width: 0; margin: 24px; padding: 24px; 
      display: flex; flex-direction: column;
      background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-card);
      

      overflow: auto;
      overscroll-behavior: contain;
      -webkit-overflow-scrolling: touch;
      
      padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    }

    
    table { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 800px;  }
    thead th {
      background: #f5f7fa; color: #606266; font-weight: 800; font-size: 13px; text-align: left;
      padding: 12px 12px; border-bottom: 1px solid #ebeef5;
    }
    tbody td { padding: 12px 12px; border-bottom: 1px solid #f0f0f0; font-size: 14px; color: #606266; vertical-align: middle; }
    tbody tr:nth-child(even) { background: #fcfcfd; }
    tbody tr:hover { background: #f5f7fa; }

    
    .cell-with-copy {
        display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%;
    }
    .btn-copy {
        opacity: 0.4; cursor: pointer; color: var(--brand-primary); transition: all 0.2s;
        flex-shrink: 0;
    }
    .btn-copy .icon { width: 18px; height: 18px; }
    .icon-btn.btn-copy:hover { background: #e6f4ff; }
    .cell-with-copy:hover .btn-copy { opacity: 1; }
    .btn-copy:active { transform: scale(0.92); }

    .actions { white-space: nowrap; }
    .actions button {
      border: none; background: transparent; padding: 6px 8px; cursor: pointer; border-radius: 6px;
      font-weight: 800; font-size: 12px; transition: background .15s ease, color .15s ease;
    }
    .actions button.view { color: var(--brand-primary); }
    .actions button.view:hover { background: #e6f4ff; }
    .actions button.edit { color: #faad14; }
    .actions button.edit:hover { background: #fffbe6; }
    .actions button.delete { color: var(--brand-danger); }
    .actions button.delete:hover { background: #fff1f0; }
    .actions button.refresh { color: var(--brand-success); }
    .actions button.refresh:hover { background: #f6ffed; }

    .actions button.restore { color: var(--brand-success); }
    .actions button.restore:hover { background: #f6ffed; }

    
    .actions button.plain { color: var(--brand-primary); }
    .actions button.plain:hover { background: #f0f7ff; }

    .mono { font-family: monospace; font-size: 12px; }
    .text-truncate { max-width: 260px; display: inline-block; vertical-align: bottom; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

    
    .badge {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      padding: 2px 8px;
      border-radius: 999px;
      font-size: 11px;
      font-weight: 900;
      line-height: 1.2;
      white-space: nowrap;
    }
    .badge.updated {
      background: rgba(82, 196, 26, .15);
      border: 1px solid rgba(82, 196, 26, .35);
      color: #389e0d;
    }
    .badge.failed {
      background: rgba(250, 173, 20, .15);
      border: 1px solid rgba(250, 173, 20, .35);
      color: #d48806;
    }
    .badge.abuse {
      background: rgba(255, 77, 79, .15);
      border: 1px solid rgba(255, 77, 79, .35);
      color: #cf1322;
    }
    tr.token-updated td { background: #f6ffed !important; }
    tr.token-updated:hover td { background: #f6ffed !important; }
    tr.token-failed td { background: #fffbe6 !important; }
    tr.token-failed:hover td { background: #fffbe6 !important; }
    tr.token-abuse td { background: #fff1f0 !important; }
    tr.token-abuse:hover td { background: #fff1f0 !important; }

    .no-data { display: none; text-align: center; padding: 22px 10px; color: #999; font-size: 13px; border: 1px dashed #e5e7eb; border-radius: var(--radius-md); background: #fafafa; margin-top: 12px; }

    
    .table-footer {
        display: flex;
        justify-content: flex-end;
        align-items: center;
        padding-top: 12px;
        gap: 12px;
        margin-top: auto;
        position: sticky; left: 0; 
    }
    
    .pagination { display: flex; gap: 8px; }
    .pagination button {
      border: 1px solid #d9d9d9; background: #fff; padding: 6px 10px; border-radius: 8px; cursor: pointer; font-size: 12px; transition: all .15s ease;
    }
    .pagination button:hover { border-color: var(--brand-primary); color: var(--brand-primary); }
    .pagination button.active { background: var(--brand-primary); border-color: var(--brand-primary); color: #fff; }

    .page-size-select {
        padding: 4px 8px;
        border: 1px solid #d9d9d9;
        border-radius: 6px;
        font-size: 12px;
        outline: none;
        color: #606266;
        background: #fff;
        cursor: pointer;
    }
    .page-size-select:focus { border-color: var(--brand-primary); }

    
    .toast-container {
        position: fixed; top: 20px; right: 20px; z-index: 11000;
        display: flex; flex-direction: column; gap: 10px; pointer-events: none;
    }
    .toast {
        background: #fff; padding: 12px 16px; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.15);
        display: flex; align-items: center; gap: 10px; pointer-events: auto;
        animation: slideIn 0.3s ease; font-size: 13px; font-weight: 600; border-left: 4px solid var(--brand-primary);
    }
    .toast.success { border-left-color: var(--brand-success); }
    .toast.error { border-left-color: var(--brand-danger); }
    @keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

    
    .loading-overlay { position: fixed; inset: 0; background: rgba(255, 255, 255, .75); display: none; align-items: center; justify-content: center; z-index: 9999; backdrop-filter: blur(2px); }
    .loading-overlay .spinner { width: 44px; height: 44px; border: 4px solid rgba(24, 144, 255, .25); border-top-color: var(--brand-primary); border-radius: 50%; animation: spin .8s linear infinite; }

    .loading-box { display: flex; flex-direction: column; gap: 10px; align-items: center; padding: 16px 18px; background: rgba(255, 255, 255, .92); border: 1px solid rgba(0, 0, 0, .06); border-radius: 16px; box-shadow: 0 10px 30px rgba(0, 0, 0, .08); min-width: 260px; max-width: min(560px, 90vw); }
    .loading-text { font-size: 14px; color: #333; text-align: center; }
    .loading-progress { width: 100%; }
    .loading-progress-bar { height: 10px; background: rgba(0, 0, 0, .06); border-radius: 999px; overflow: hidden; }
    .loading-progress-fill { height: 100%; width: 0%; background: var(--brand-primary); transition: width .2s ease; }
    .loading-progress-text { margin-top: 6px; font-size: 12px; color: #666; text-align: center; word-break: break-all; }
    .loading-actions { width: 100%; display: flex; justify-content: center; }
    .loading-actions .btn { width: auto; justify-content: center; gap: 8px; }

    .token-refresh-options { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
    .radio-row { display: flex; gap: 12px; align-items: center; padding: 12px 12px; border: 1px solid #e8e8e8; border-radius: 12px; cursor: pointer; user-select: none; }
    .radio-row:hover { background: #fafafa; }
    .radio-row.disabled { opacity: .5; cursor: not-allowed; }
    .radio-row input { margin: 0; }
    .radio-title { font-weight: 900; font-size: 13px; color: #222; }
    .radio-sub { font-size: 12px; color: #666; font-weight: 700; margin-top: 2px; }

    @keyframes spin { to { transform: rotate(360deg) } }

    
    .sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 39; }
    .sidebar-backdrop.show { display: block; }

    
    .mobile-only { display: none !important; }
    .mobile-settings-btn { display: none; } 
    .sidebar-close-btn {
      display: none;
      position: absolute;
      top: 12px;
      right: 12px;
      width: 40px;
      height: 40px;
      border: 1px solid #d9d9d9;
      background: #fff;
      border-radius: 10px;
      cursor: pointer;
      z-index: 1;
    }
    .sidebar-close-btn:hover { background: #f5f7fa; }

    .mobile-stats {
      display: none;
      font-size: 12px;
      color: #666;
      font-weight: 800;
      padding: 6px 2px 0;
    }

    .modal { display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, .5); align-items: center; justify-content: center; z-index: 10000; padding: 16px; }
    .modal-content { width: min(760px, 100%); background: #fff; border-radius: 14px; box-shadow: 0 20px 40px rgba(0, 0, 0, .18); padding: 18px 18px 14px; max-height: 80vh; overflow: auto; }
    .modal-content h3 { margin: 0 0 8px 0; font-size: 16px; }

    
    .edit-modal-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
    .edit-modal-header h3 { margin: 0; }
    .edit-modal-delete-btn { display: none; color: var(--brand-danger); border: 1px solid #ffb3b3; background: #fff; }
    .edit-modal-delete-btn:hover { background: #fff1f0; }
    .edit-modal-delete-btn .icon { width: 18px; height: 18px; }

    .modal-actions { margin-top: 12px; display: flex; justify-content: flex-end; gap: 10px; }
    .modal-actions .btn { width: auto; padding: 10px 14px; border-radius: 10px; }

    
    
    #mail-list-modal .modal-content {
      width: min(1500px, 98vw);
      max-height: 90vh;
    }

    
    #mail-list-subtitle {
      font-size: 16px;
      color: #606266;
      margin: 6px 0 0;
      font-weight: 700;
    }

    
    #mail-table {
      table-layout: fixed;
      width: 100%;
      min-width: 1300px;
    }
    #mail-table th, #mail-table td {
      vertical-align: top;
    }
    #mail-table td.col-wrap {
      white-space: normal;
      overflow-wrap: anywhere;
      word-break: break-word;
    }
    #mail-table td.col-preview {
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    #mail-table td.col-preview .preview-text {
      display: block;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    
    #mail-table td.actions {
      white-space: normal;
    }
    #mail-table td.actions button {
      margin: 2px 4px;
    }

    
    #mail-modal .modal-content {
      width: min(1140px, 96vw);
      max-height: 90vh;
    }

    
    #mail-modal .modal-content {
      display: flex;
      flex-direction: column;
      padding: 0;
      overflow: hidden;
      height: min(90vh, 900px);
    }
    #mail-modal .mail-modal-head {
      flex: 0 0 auto;
      padding: 16px 18px 12px;
      border-bottom: 1px solid #ebeef5;
      background: #fff;
    }
    #mail-modal .mail-modal-title-row {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 12px;
    }
    #mail-modal .mail-modal-title-row h3 {
      margin: 0;
      font-size: 16px;
      flex: 1;
      min-width: 0;
    }
    #mail-modal .mail-modal-close {
      border: 1px solid #d9d9d9;
      background: #fff;
      width: 40px;
      height: 40px;
      border-radius: 10px;
      cursor: pointer;
      flex: 0 0 auto;
      display: inline-flex;
      align-items: center;
      justify-content: center;
    }
    #mail-modal .mail-modal-close:hover {
      background: #f5f7fa;
    }
    #mail-modal .mail-modal-meta {
      margin-top: 8px;
      display: flex;
      flex-direction: column;
      gap: 4px;
      font-size: 13px;
      color: #606266;
      font-weight: 700;
    }
    #mail-modal .mail-modal-body {
      flex: 1 1 auto;
      min-height: 0;
      overflow: auto;
      padding: 0 18px 18px;
      background: #fff;
    }

    .mail-actions {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      align-items: center;
      margin: 8px 0 10px;
      padding: 10px 0;
      border-top: 1px solid #ebeef5;
      border-bottom: 1px solid #ebeef5;
    }

    .mail-footer {
        display: grid; 
        grid-template-columns: 1fr auto 1fr;
        align-items: center;
        margin-top: 20px;
        width: 100%;
    }
    .mail-footer-left { grid-column: 1; display: flex; align-items: center; gap: 10px; justify-self: start; }
    .mail-footer-left .btn { width: auto; }
    .mail-footer .pagination { grid-column: 2; justify-self: center; margin: 0; }
    .mail-footer .btn-close { grid-column: 3; justify-self: end; width: 80px; }

    
    @media (max-width: 768px) {
      
      body { overflow: auto; height: auto; }
      
      .app-wrapper { flex-direction: column; height: auto; overflow: visible; }
      .main-layout { flex-direction: column; height: auto; }
      
      .sidebar { 
        width: 100%; 
        border-right: none; 
        border-bottom: 1px solid var(--sidebar-border);
        height: auto;
        flex: none;
      }
      
      .sidebar-menu { 
          overflow-y: visible; 
          height: auto; 
      }
      
      .content-area { 
          height: auto; 
          overflow: visible; 
          min-height: 500px;
          
          flex: none;
          display: block;
      }

      .top-toolbar { height: auto; padding: 16px; flex-direction: column; align-items: stretch }
      .search-box { max-width: 100%; }
      .toolbar-actions { justify-content: space-between; }

      
      .toolbar-actions { width: 100%; flex-wrap: wrap; }
      .stat-card { width: 100%; min-width: 0; }
      .btn.small { flex: 1 1 auto; }

      
      table { min-width: 0 !important; }
      #account-table thead { display: none; }
      #account-table, #account-table tbody, #account-table tr, #account-table td { display: block; width: 100%; }
      #account-table tbody tr { background: #fff; border: 1px solid #f0f0f0; border-radius: 14px; overflow: hidden; margin-bottom: 12px; box-shadow: var(--shadow-card); }
      #account-table tbody td { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px; border-bottom: 1px solid #f0f0f0; }
      #account-table tbody td:last-child { border-bottom: none; }
      #account-table tbody td::before { content: attr(data-label); font-weight: 900; color: #606266; flex: 0 0 auto; }
      #account-table tbody td .cell-with-copy { flex: 1; min-width: 0; }
      #account-table tbody td.actions { text-align: left !important; align-items: flex-start; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
      #account-table tbody td.actions::before { margin-right: auto; padding-top: 6px; }
      #account-table tbody td.actions button { background: #f5f7fa; border: 1px solid #e5e7eb; padding: 8px 10px; }
      #account-table tbody td.actions button:hover { background: #fff; }

      
      #mail-table thead { display: none; }
      #mail-table, #mail-table tbody, #mail-table tr, #mail-table td { display: block; width: 100%; }
      #mail-table tbody tr { background: #f5f7fa; border: 1px solid #e5e7eb; border-radius: 14px; overflow: hidden; margin-bottom: 10px; }
      #mail-table tbody td { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px; border-bottom: 1px solid #f0f0f0; }
      #mail-table tbody td:last-child { border-bottom: none; }
      #mail-table tbody td::before { content: attr(data-label); font-weight: 900; color: #606266; flex: 0 0 auto; }
      #mail-table tbody td.actions { justify-content: flex-end; }
      #mail-table tbody td.actions::before { margin-right: auto; padding-top: 4px; }
      #mail-table tbody td.actions button { background: #f5f7fa; border: 1px solid #e5e7eb; padding: 8px 12px; }

      .modal-content { max-height: 90vh; padding: 14px 14px 12px; }

      
      .table-container {
        margin: 12px;
        padding: 12px;
        
        flex: none;
        overflow: visible;
        padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
      }
      .text-truncate { max-width: 160px; }
      
      .mail-footer { display: flex; flex-direction: column; gap: 12px; }
      .mail-footer .btn-close { width: 100%; }
      .mail-footer-left { width: 100%; }
      .mail-footer-left .btn { width: 100%; }
      .table-footer { flex-direction: column; gap: 12px; align-items: flex-end; }

body.sidebar-open { overflow: hidden; height: 100vh; }

.top-toolbar { position: sticky; top: 0; z-index: 30; }
.top-toolbar { padding-right: 74px; }
.mobile-settings-btn { display: inline-flex; position: absolute; top: 12px; right: 12px; }

.sidebar { 
  position: fixed; top: 0; right: 0;
  height: 100vh; width: min(92vw, 360px);
  border-right: none; border-bottom: none; border-left: 1px solid var(--sidebar-border);
  transform: translateX(110%);
  transition: transform .22s ease;
  box-shadow: 0 20px 40px rgba(0,0,0,.18);
  z-index: 20;
}
.sidebar.open { transform: translateX(0); }
.sidebar-close-btn { display: inline-flex; align-items: center; justify-content: center; }
.sidebar-menu { overflow-y: auto; height: calc(100vh - 80px); padding-bottom: 24px; }

#account-table tbody { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
#account-table tbody tr { margin-bottom: 0; width: auto; }

#account-table tbody td.mobile-hide { display: none !important; }
#account-table tbody td.mobile-top { justify-content: flex-start; }
#account-table tbody td.mobile-top::before { display: none; content: ''; }
#account-table tbody td.mobile-top .mobile-top-inner { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
#account-table tbody td.mobile-top .mobile-top-inner .idx { font-weight: 900; color: #333; }

#account-table tbody td .cell-with-copy { align-items: flex-start; }
#account-table .email-text { white-space: normal; overflow: visible; text-overflow: clip; max-width: none; word-break: break-all; overflow-wrap: anywhere; }

#account-table tbody td.actions button { flex: 0 0 auto; }

.mobile-only { display: inline-flex !important; }
.mobile-settings-btn { display: inline-flex; position: absolute; top: 12px; right: 12px; z-index: 45; }
.sidebar-close-btn { display: inline-flex; align-items: center; justify-content: center; }
.stat-card { display: none !important; }
.mobile-stats { display: block; }

.search-box { padding-right: 58px; }
.search-input { height: 38px; font-size: 13px; padding-left: 32px; }
.search-input-wrap .icon { left: 10px; font-size: 13px; }
.top-toolbar { padding-top: 14px; padding-bottom: 14px; }

#account-table tbody td.actions::before { display: none !important; }
#account-table tbody td.actions { justify-content: flex-start !important; }

.sidebar-backdrop { z-index: 39; }
.sidebar { z-index: 40; }

    }
  

@media (max-width: 768px) {
  
  .top-toolbar {
    position: sticky;
    top: 0;
    z-index: 60;
    padding: calc(12px + env(safe-area-inset-top, 0px)) 12px 12px;
    background: #fff;
  }

  .top-toolbar { flex-direction: column; align-items: stretch; gap: 12px; }
  .top-toolbar-top { width: 100%; display: flex; align-items: stretch; gap: 10px; }

  
  .search-box { max-width: none; min-width: 0; flex: 1; padding-right: 0 !important; }
  .search-input { height: 38px; }

  
  .mobile-settings-wrap {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 38px;
    flex: 0 0 auto;
    min-width: 92px;
    align-items: flex-end;
  }
  .mobile-settings-btn {
    display: inline-flex;
    position: static !important;
    width: auto;
    padding: 2px 10px;
    height: 20px;
    line-height: 1;
    border-radius: 10px;
  }
  .mobile-stats {
    display: block;
    padding: 0;
    margin: 0;
    font-size: 11px;
    line-height: 1;
    font-weight: 800;
    color: #666;
    text-align: right;
  }

  
  .toolbar-actions { width: 100%; flex-wrap: wrap; }

  
  body.sidebar-open { overflow: hidden; height: 100vh; }
  .sidebar-backdrop { background: rgba(0, 0, 0, .5); z-index: 65; }
  .sidebar {
    position: fixed;
    left: 50%;
    top: 50%;
    right: auto;
    width: min(92vw, 720px);
    height: auto;
    max-height: 92vh;
    border-right: none;
    border-bottom: none;
    border-left: none;
    border-radius: 14px;
    border: 1px solid var(--sidebar-border);
    transform: translate(-50%, -50%) scale(0.98);
    opacity: 0;
    pointer-events: none;
    transition: transform .18s ease, opacity .18s ease;
    box-shadow: 0 20px 40px rgba(0,0,0,.18);
    z-index: 66;
  }
  .sidebar.open {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    pointer-events: auto;
  }
  .sidebar-menu { overflow-y: auto; height: calc(92vh - 80px); }
  .sidebar-close-btn { display: inline-flex; align-items: center; justify-content: center; }

      
      .edit-modal-delete-btn { display: inline-flex; }
}

