/* =========================================
   RESET & VARIABLES
   ========================================= */
   :root {
    /* Color Palette - Discord/Modern Dark Theme */
    --app-bg: #202225;
    --sidebar-bg: #2f3136;
    --main-bg: #36393f;
    --element-bg: #40444b;
    --hover-bg: #393c43;
    --active-bg: #42464d;
    
    --primary-color: #5865F2;
    --primary-hover: #4752C4;
    --success-color: #3BA55D;
    --danger-color: #ED4245;
    --warning-color: #FAA61A;
    --info-color: #00B0F4;
  
    --text-normal: #dcddde;
    --text-muted: #72767d;
    --text-header: #ffffff;
    
    --border-color: #202225;
    --border-light: #4f545c;
    
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 16px;
    
    --shadow-sm: 0 1px 0 rgba(4,4,5,0.2),0 1.5px 0 rgba(6,6,7,0.05),0 2px 0 rgba(4,4,5,0.05);
    --shadow-md: 0 4px 8px rgba(0,0,0,0.2);
    --shadow-lg: 0 8px 16px rgba(0,0,0,0.24);
  }
  
  * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }
  
  body {
    font-family: 'Whitney', 'Helvetica Neue', Helvetica, Arial, sans-serif; /* Discord-like font stack */
    background-color: var(--app-bg);
    color: var(--text-normal);
    height: 100vh;
    overflow: hidden; /* App-like feel, no body scroll */
    display: flex;
    flex-direction: column;
    font-size: 16px;
    line-height: 1.5;
  }
  
  a { text-decoration: none; color: inherit; }
  ul { list-style: none; }
  button { font-family: inherit; }
  
  /* =========================================
     SCROLLBARS
     ========================================= */
  ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
    background-color: var(--sidebar-bg);
  }
  
  ::-webkit-scrollbar-thumb {
    background-color: var(--app-bg);
    border-radius: 4px;
  }
  
  ::-webkit-scrollbar-track {
    background-color: transparent;
  }
  
  /* =========================================
     NAVBAR
     ========================================= */
  .navbar {
    height: 60px;
    background-color: var(--app-bg);
    border-bottom: 1px solid var(--app-bg);
    display: flex;
    align-items: center;
    padding: 0 24px;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
    z-index: 100;
  }
  
  .nav-container {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  
  .navbar h2 {
    color: var(--text-header);
    font-size: 20px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
  }
  
  .nav-right {
    display: flex;
    align-items: center;
    gap: 16px;
  }
  
  .user-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 12px 4px 4px;
    background: var(--sidebar-bg);
    border-radius: 20px;
    transition: background 0.2s;
  }
  
  .user-badge:hover {
    background: var(--element-bg);
  }
  
  .user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--primary-color);
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
    font-size: 14px;
  }
  
  .username {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-header);
  }
  
  /* =========================================
     LAYOUT & CONTAINERS
     ========================================= */
  .container {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px;
    height: calc(100vh - 60px); /* Fill remaining height */
  }
  
  .full-height {
    display: flex;
    flex-direction: column;
  }
  
  .split-view {
    display: flex;
    height: 100%;
    background-color: var(--main-bg);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
  }
  
  /* =========================================
     SIDEBAR (LIST VIEW)
     ========================================= */
  .sidebar-list {
    width: 360px;
    background-color: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-color);
    flex-shrink: 0;
  }
  
  .sidebar-header {
    padding: 16px;
    background-color: var(--sidebar-bg);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    z-index: 10;
  }
  
  .search-box {
    position: relative;
    margin-top: 12px;
  }
  
  .search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 14px;
  }
  
  .search-box input {
    width: 100%;
    background-color: var(--app-bg);
    border: none;
    border-radius: 4px;
    padding: 10px 12px 10px 36px;
    color: var(--text-normal);
    font-size: 14px;
    transition: background 0.2s;
  }
  
  .search-box input:focus {
    outline: none;
    background-color: #000000;
    color: var(--text-header);
  }
  
  /* Mini Filter Tabs in Sidebar */
  .filter-tabs-mini {
    display: flex;
    padding: 8px 16px;
    gap: 8px;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--sidebar-bg);
  }
  
  .filter-tab-mini {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
  }
  
  .filter-tab-mini:hover {
    color: var(--text-normal);
    background-color: rgba(255,255,255,0.05);
  }
  
  .filter-tab-mini.active {
    background-color: rgba(88, 101, 242, 0.2);
    color: var(--primary-color);
  }
  
  /* List Items */
  .email-list {
    flex: 1;
    overflow-y: auto;
  }
  
  .email-list-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.1s;
    position: relative;
  }
  
  .email-list-item:hover {
    background-color: var(--hover-bg);
  }
  
  .email-list-item.selected {
    background-color: rgba(88, 101, 242, 0.1);
  }
  
  .email-list-item.selected::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background-color: var(--primary-color);
  }
  
  .item-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 4px;
  }
  
  .item-subject {
    font-weight: 600;
    color: var(--text-header);
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 220px;
  }
  
  .item-date {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
  }
  
  .item-preview {
    font-size: 13px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
  }
  
  /* =========================================
     MAIN CONTENT AREA
     ========================================= */
  .content-area {
    flex: 1;
    background-color: var(--main-bg);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    position: relative;
  }
  
  /* Empty State */
  .empty-state-large {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    user-select: none;
  }
  
  .empty-state-large i {
    font-size: 64px;
    margin-bottom: 24px;
    background: var(--app-bg);
    padding: 40px;
    border-radius: 50%;
    color: var(--element-bg);
  }
  
  .empty-state-large h3 {
    font-size: 18px;
    color: var(--text-normal);
    margin-bottom: 8px;
  }
  
  /* Detail View */
  .detail-view {
    padding: 40px;
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
  }
  
  .detail-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-light);
  }
  
  .detail-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 12px;
  }
  
  .detail-title-row h2 {
    font-size: 24px;
    color: var(--text-header);
    line-height: 1.3;
    margin: 0;
  }
  
  .detail-meta-row {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
    font-size: 14px;
  }
  
  .id-badge {
    background-color: var(--app-bg);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 12px;
  }
  
  /* Detail Content Blocks */
  .detail-section {
    margin-bottom: 32px;
  }
  
  .detail-section h4 {
    color: var(--text-muted);
    font-size: 12px;
    text-transform: uppercase;
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: 0.5px;
  }
  
  .text-content {
    color: var(--text-normal);
    line-height: 1.6;
    white-space: pre-wrap;
    font-size: 15px;
  }
  
  /* Attachments Grid */
  .attachments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
  }
  
  .attachment-card {
    background-color: var(--sidebar-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s;
  }
  
  .attachment-card:hover {
    background-color: var(--app-bg);
    border-color: var(--primary-color);
  }
  
  .attachment-card i {
    font-size: 24px;
    color: var(--primary-color);
  }
  
  .attachment-card span {
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
  }
  
  /* Admin Response */
  .admin-response-section {
    background-color: rgba(88, 101, 242, 0.05);
    border: 1px solid rgba(88, 101, 242, 0.2);
    border-radius: var(--radius-md);
    padding: 20px;
  }
  
  /* =========================================
     COMPOSE / FORMS
     ========================================= */
  .compose-view {
    padding: 40px;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
  }
  
  .content-header {
    margin-bottom: 24px;
  }
  
  .content-header h2 {
    color: var(--text-header);
    font-size: 22px;
  }
  
  .form-group {
    margin-bottom: 20px;
  }
  
  .form-group label {
    display: block;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 8px;
  }
  
  .form-group input,
  .form-group textarea,
  .form-group select {
    width: 100%;
    padding: 10px;
    background-color: var(--app-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-normal);
    font-size: 15px;
    transition: border-color 0.2s;
    font-family: inherit;
  }
  
  .form-group input:focus,
  .form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
  }
  
  /* File Upload Area */
  .file-upload-wrapper {
    border: 2px dashed var(--border-light);
    background-color: var(--app-bg);
    border-radius: var(--radius-md);
    padding: 30px;
    text-align: center;
    position: relative;
    cursor: pointer;
    transition: all 0.2s;
  }
  
  .file-upload-wrapper:hover {
    border-color: var(--primary-color);
    background-color: rgba(88, 101, 242, 0.05);
  }
  
  .file-upload-wrapper input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
  }
  
  .file-upload-display i {
    font-size: 32px;
    color: var(--text-muted);
    margin-bottom: 10px;
  }
  
  .file-list {
    margin-top: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
  
  .file-chip {
    background-color: var(--element-bg);
    color: var(--text-normal);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
  }
  
  /* Buttons */
  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    gap: 8px;
    line-height: 1.5;
  }
  
  .btn-primary {
    background-color: var(--primary-color);
    color: white;
  }
  
  .btn-primary:hover {
    background-color: var(--primary-hover);
  }
  
  .btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
  }
  
  .btn-secondary {
    background-color: transparent;
    color: var(--text-normal);
  }
  
  .btn-secondary:hover {
    text-decoration: underline;
  }
  
  .btn-logout {
    background-color: transparent;
    border: 1px solid var(--danger-color);
    color: var(--danger-color);
  }
  
  .btn-logout:hover {
    background-color: var(--danger-color);
    color: white;
  }
  
  .btn-block {
    width: 100%;
  }
  
  .btn-small {
    padding: 4px 12px;
    font-size: 12px;
  }
  
  .form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-light);
  }
  
  /* =========================================
     STATUS BADGES
     ========================================= */
  .status-badge {
    text-transform: uppercase;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 12px;
    letter-spacing: 0.5px;
  }
  
  .status-pending {
    background-color: rgba(250, 166, 26, 0.1);
    color: var(--warning-color);
  }
  
  .status-reviewed {
    background-color: rgba(88, 101, 242, 0.1);
    color: var(--primary-color);
  }
  
  .status-resolved {
    background-color: rgba(59, 165, 93, 0.1);
    color: var(--success-color);
  }
  
  .status-rejected {
    background-color: rgba(237, 66, 69, 0.1);
    color: var(--danger-color);
  }
  
  /* =========================================
     ADMIN PANEL EXTRAS
     ========================================= */
  .tabs {
    display: flex;
    background-color: var(--sidebar-bg);
    padding: 0 20px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
  }
  
  .tab {
    padding: 16px 20px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
  }
  
  .tab:hover {
    color: var(--text-normal);
  }
  
  .tab.active {
    color: var(--text-header);
    border-bottom-color: var(--primary-color);
  }
  
  /* Admin Filters */
  .filters {
    padding: 20px;
    background-color: var(--sidebar-bg);
    border-bottom: 1px solid var(--border-color);
  }
  
  .filters h3 {
    font-size: 14px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 12px;
  }
  
  .filter-grid {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
  }
  
  .filter-grid > * {
    flex: 1;
    min-width: 150px;
  }
  
  /* Logs List */
  .log-card {
    background-color: var(--sidebar-bg);
    border: 1px solid var(--border-color);
    padding: 16px;
    margin: 12px 20px;
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--primary-color);
  }
  
  .log-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
  }
  
  .log-action {
    font-weight: 700;
    color: var(--primary-color);
  }
  
  .log-timestamp {
    color: var(--text-muted);
    font-size: 13px;
  }
  
  .log-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    color: var(--text-normal);
    font-size: 14px;
  }
  
  .log-reason {
    margin-top: 12px;
    padding: 8px 12px;
    background-color: rgba(0,0,0,0.2);
    border-radius: 4px;
    font-size: 13px;
    color: var(--text-muted);
    font-family: monospace;
  }
  
  /* Loading & Messages */
  .loading {
    padding: 40px;
    text-align: center;
    color: var(--text-muted);
  }
  
  .message {
    padding: 12px;
    border-radius: var(--radius-sm);
    margin-top: 15px;
    font-size: 14px;
    display: none;
  }
  
  .message.success {
    background-color: rgba(59, 165, 93, 0.1);
    color: var(--success-color);
    border: 1px solid rgba(59, 165, 93, 0.2);
  }
  
  .message.error {
    background-color: rgba(237, 66, 69, 0.1);
    color: var(--danger-color);
    border: 1px solid rgba(237, 66, 69, 0.2);
  }
  
  /* =========================================
     RESPONSIVE
     ========================================= */
  @media (max-width: 768px) {
    .container { padding: 0; height: calc(100vh - 50px); }
    .navbar { height: 50px; padding: 0 16px; }
    
    .split-view {
      flex-direction: column;
      border-radius: 0;
      border: none;
    }
    
    .sidebar-list {
      width: 100%;
      height: 40%;
      min-height: 200px;
      border-right: none;
      border-bottom: 1px solid var(--border-color);
    }
    
    .content-area {
      height: 60%;
    }
    
    .detail-view { padding: 20px; }
    .compose-view { padding: 20px; }
    
    /* Admin Mobile adjustments */
    .filter-grid { flex-direction: column; }
    .filter-grid > * { width: 100%; }
  }

/* ========== TOAST NOTIFICATION ========== */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
}

.toast {
  background-color: var(--element-bg);
  color: var(--text-header);
  padding: 16px 24px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 300px;
  border-left: 4px solid var(--primary-color);
  animation: slideIn 0.3s ease forwards;
}

.toast.success { border-left-color: var(--success-color); }
.toast.error { border-left-color: var(--danger-color); }

.toast i { font-size: 20px; }
.toast-content { flex: 1; }
.toast-title { font-weight: 700; font-size: 14px; margin-bottom: 2px; }
.toast-message { font-size: 13px; color: var(--text-muted); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOut {
  to { opacity: 0; transform: translateY(10px); }
}
