/* ==================== GLOBAL SETTINGS & DESIGN SYSTEM ==================== */
:root {
  --font-main: 'Outfit', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Colors */
  --bg-dark: #07080d;
  --bg-card: rgba(19, 21, 34, 0.7);
  --bg-card-hover: rgba(26, 29, 46, 0.85);
  --border-glass: rgba(255, 255, 255, 0.07);
  --border-focus: rgba(99, 102, 241, 0.5);
  
  --primary: #6366f1; /* Indigo */
  --primary-glow: rgba(99, 102, 241, 0.35);
  --secondary: #a855f7; /* Purple */
  --secondary-glow: rgba(168, 85, 247, 0.3);
  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;
  --accent-warning: #f59e0b;
  --accent-danger: #ef4444;

  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dark: #475569;
  
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 80%, rgba(168, 85, 247, 0.08) 0%, transparent 40%);
  background-attachment: fixed;
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.15);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Helpers */
.hidden {
  display: none !important;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: var(--accent-cyan);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-cyan);
  animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(6, 182, 212, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(6, 182, 212, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(6, 182, 212, 0); }
}

/* ==================== LOGIN GATE STYLE ==================== */
.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.login-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  width: 100%;
  max-width: 440px;
  padding: 40px 30px;
  box-shadow: var(--glass-shadow);
  transform: translateY(0);
  transition: var(--transition-smooth);
}

.login-card:hover {
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 12px 40px 0 rgba(99, 102, 241, 0.1);
}

.login-brand {
  text-align: center;
  margin-bottom: 30px;
}

.login-brand i {
  font-size: 3rem;
  color: var(--primary);
  text-shadow: 0 0 15px var(--primary-glow);
  margin-bottom: 12px;
}

.neon-pulse {
  animation: neon-heartbeat 3s infinite alternate;
}

@keyframes neon-heartbeat {
  0% { transform: scale(1); filter: drop-shadow(0 0 2px var(--primary)); }
  100% { transform: scale(1.05); filter: drop-shadow(0 0 10px var(--primary)); }
}

.login-brand h1 {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: 1px;
}

.login-brand h1 span {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.login-brand p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 5px;
}

.login-tabs {
  display: flex;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 25px;
}

.login-tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-main);
  font-weight: 600;
  padding: 10px;
  font-size: 0.85rem;
  cursor: pointer;
  border-radius: 7px;
  transition: var(--transition-smooth);
}

.login-tab-btn:hover {
  color: var(--text-main);
}

.login-tab-btn.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 10px var(--primary-glow);
}

.login-form {
  display: none;
  flex-direction: column;
  gap: 20px;
}

.login-form.active {
  display: flex;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.input-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrapper i {
  position: absolute;
  left: 15px;
  color: var(--text-muted);
  font-size: 1rem;
}

.input-wrapper input {
  width: 100%;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-glass);
  border-radius: 10px;
  padding: 12px 15px 12px 42px;
  color: #fff;
  font-family: var(--font-main);
  font-size: 0.95rem;
  transition: var(--transition-smooth);
}

.input-wrapper input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--border-focus);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border: none;
  border-radius: 10px;
  color: #fff;
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 14px;
  cursor: pointer;
  transition: var(--transition-smooth);
  box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--primary-glow);
  filter: brightness(1.1);
}

.btn-primary:active {
  transform: translateY(0);
}

.oauth-tab {
  text-align: center;
  gap: 15px;
}

.oauth-tab p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.btn-oauth {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #fff;
  color: #111;
  border: none;
  border-radius: 10px;
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 14px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-oauth:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(255, 255, 255, 0.15);
}

.btn-oauth i {
  font-size: 1.1rem;
}

.login-error-msg {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 10px;
  padding: 12px;
  color: var(--accent-danger);
  font-size: 0.85rem;
  margin-top: 20px;
}

/* ==================== DASHBOARD LAYOUT & WRAPPER ==================== */
.dashboard-wrapper {
  display: flex;
  min-height: 100vh;
}

/* Sidebar Styling */
.sidebar {
  width: 260px;
  background: rgba(10, 11, 20, 0.85);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--border-glass);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
}

.sidebar-brand {
  padding: 25px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border-glass);
}

.sidebar-brand i {
  font-size: 1.5rem;
  color: var(--primary);
}

.sidebar-brand h2 {
  font-size: 1.25rem;
  font-weight: 800;
}

.sidebar-brand h2 span {
  color: var(--primary);
}

.sidebar-nav {
  flex: 1;
  padding: 25px 15px;
}

.sidebar-nav ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-item {
  width: 100%;
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 12px 15px;
  color: var(--text-muted);
  font-family: var(--font-main);
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  transition: var(--transition-smooth);
  position: relative;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-main);
}

.nav-item.active {
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary);
  box-shadow: inset 3px 0 0 var(--primary);
}

.nav-item.active i {
  color: var(--primary);
}

.sidebar-footer {
  padding: 20px 15px;
  border-top: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-profile i {
  font-size: 2.2rem;
  color: var(--text-muted);
}

.user-info {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-weight: 700;
  font-size: 0.85rem;
}

.user-status {
  font-size: 0.7rem;
  color: var(--accent-emerald);
  display: flex;
  align-items: center;
  gap: 4px;
}

.user-status i {
  font-size: 0.5rem;
  color: var(--accent-emerald);
}

.btn-logout {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 8px;
  border-radius: 8px;
  transition: var(--transition-smooth);
}

.btn-logout:hover {
  background: rgba(239, 68, 68, 0.1);
  color: var(--accent-danger);
}

/* Main Content Styling */
.main-content {
  margin-left: 260px;
  flex: 1;
  padding: 40px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 30px;
}

.page-title h1 {
  font-size: 1.75rem;
  font-weight: 800;
}

.page-title p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 4px;
}

.server-status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

.pulse-indicator {
  width: 8px;
  height: 8px;
  background-color: var(--accent-emerald);
  border-radius: 50%;
  animation: pulse-glow 2s infinite;
}

/* ==================== CONTENT PANELS COMMON ==================== */
.content-panel {
  display: none;
  animation: fadeIn 0.4s ease-out;
  flex: 1;
}

.content-panel.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==================== MODULE: DASHBOARD ==================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 25px;
  margin-bottom: 30px;
}

.stat-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--glass-shadow);
  display: flex;
  flex-direction: column;
  gap: 15px;
  transition: var(--transition-smooth);
}

.stat-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

.stat-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stat-card-header h3 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
}

.stat-card-header i {
  color: var(--primary);
  font-size: 1.1rem;
}

.stat-value-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px 0;
}

/* Circular Progress Ring */
.progress-ring-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.progress-ring-fill {
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
  transition: stroke-dashoffset 0.8s ease-in-out;
}

.cpu-color { stroke: var(--primary); filter: drop-shadow(0 0 4px var(--primary-glow)); }
.ram-color { stroke: var(--secondary); filter: drop-shadow(0 0 4px var(--secondary-glow)); }
.disk-color { stroke: var(--accent-cyan); filter: drop-shadow(0 0 4px rgba(6,182,212,0.3)); }

.progress-ring-text {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.progress-ring-text span:first-child {
  font-size: 1.25rem;
  font-weight: 800;
}

.progress-ring-text span.label {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.stat-card-footer {
  font-size: 0.75rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-glass);
  padding-top: 10px;
}

.network-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  justify-content: center;
}

.net-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
}

.net-row.divider {
  border-top: 1px solid var(--border-glass);
  margin: 4px 0;
}

.net-row .label {
  color: var(--text-muted);
}

.net-row .label i {
  font-size: 0.75rem;
}

.net-row .value {
  font-weight: 700;
}

/* Dashboard Details Card Layout */
.dashboard-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 25px;
}

.details-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--glass-shadow);
}

.details-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-glass);
  padding-bottom: 10px;
}

.services-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.services-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
}

.service-name {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  font-weight: 600;
}

.service-name i {
  font-size: 0.5rem;
}

.service-active {
  color: var(--accent-emerald);
  text-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
}

.badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
  text-transform: uppercase;
}

.badge-success {
  background: rgba(16, 185, 129, 0.1);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.syslog-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 220px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding-right: 5px;
}

.log-entry {
  display: flex;
  gap: 10px;
  line-height: 1.4;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(255,255,255,0.02);
}

.log-entry.warning {
  color: var(--accent-warning);
}

.log-time {
  color: var(--accent-cyan);
  flex-shrink: 0;
}

.log-user {
  color: var(--secondary);
  flex-shrink: 0;
}

.log-msg {
  color: var(--text-main);
}

.log-entry.warning .log-msg {
  color: var(--accent-warning);
}

/* ==================== MODULE: FILES ==================== */
.files-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.95rem;
}

.breadcrumbs .crumb {
  cursor: pointer;
  transition: var(--transition-smooth);
}

.breadcrumbs .crumb:hover {
  color: var(--primary);
}

.breadcrumbs .crumb.active {
  color: var(--text-muted);
  cursor: default;
}

.breadcrumbs .crumb.active:hover {
  color: var(--text-muted);
}

.breadcrumbs .divider {
  color: var(--text-muted);
}

.files-actions {
  display: flex;
  gap: 12px;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  border-radius: 8px;
  color: var(--text-main);
  font-family: var(--font-main);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 8px 16px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
}

.btn-primary.btn-sm {
  padding: 8px 16px;
  font-size: 0.8rem;
  border-radius: 6px;
}

.files-browser-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  box-shadow: var(--glass-shadow);
  overflow: hidden;
}

.files-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.files-table th {
  background: rgba(0, 0, 0, 0.2);
  padding: 14px 20px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-glass);
}

.files-table td {
  padding: 12px 20px;
  font-size: 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.files-table tbody tr {
  transition: var(--transition-smooth);
}

.files-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.col-name {
  width: 50%;
}

.file-item-name {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  cursor: pointer;
}

.file-item-name i {
  font-size: 1.1rem;
}

.folder-icon {
  color: var(--accent-cyan);
}

.file-icon {
  color: var(--text-muted);
}

.col-size {
  width: 15%;
  color: var(--text-muted);
}

.col-date {
  width: 20%;
  color: var(--text-muted);
}

.col-actions {
  width: 15%;
  text-align: right;
}

.btn-icon-sm {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.9rem;
  padding: 6px;
  border-radius: 5px;
  transition: var(--transition-smooth);
  margin-left: 4px;
}

.btn-icon-sm:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}

.btn-icon-sm.delete:hover {
  background: rgba(239, 68, 68, 0.1);
  color: var(--accent-danger);
}

/* ==================== MODULE: MARIADB ==================== */
.db-grid {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 25px;
  height: calc(100vh - 180px);
}

.db-sidebar {
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.db-select-wrapper {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.db-select-wrapper label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.db-select-wrapper select {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  border-radius: 8px;
  padding: 8px 12px;
  font-family: var(--font-main);
  font-size: 0.85rem;
  outline: none;
  cursor: pointer;
}

.db-tables-list-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.db-tables-list-container h4 {
  font-size: 0.8rem;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.db-tables-list {
  list-style: none;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.db-tables-list li {
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition-smooth);
}

.db-tables-list li:hover {
  background: rgba(255, 255, 255, 0.03);
}

.db-tables-list li.active {
  background: rgba(99, 102, 241, 0.08);
  color: var(--primary);
}

.db-tables-list li i {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.db-workspace {
  display: flex;
  flex-direction: column;
  gap: 25px;
  height: 100%;
}

.sql-console-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sql-console-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sql-console-header h3 {
  font-size: 0.95rem;
  font-weight: 700;
}

#sql-editor {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-glass);
  border-radius: 10px;
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.5;
  padding: 15px;
  resize: vertical;
  min-height: 100px;
  max-height: 200px;
  outline: none;
  transition: var(--transition-smooth);
}

#sql-editor:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--border-focus);
}

.sql-results-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sql-results-card h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.sql-results-wrapper {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-glass);
  border-radius: 10px;
  flex: 1;
  overflow: auto;
  display: flex;
  flex-direction: column;
}

.results-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 20px;
  text-align: center;
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.8rem;
}

.results-table th {
  background: rgba(0,0,0,0.3);
  padding: 10px 15px;
  font-weight: 700;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-glass);
}

.results-table td {
  padding: 10px 15px;
  border-bottom: 1px solid rgba(255,255,255,0.02);
}

/* ==================== MODULE: MAIL ==================== */
.mail-header-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 25px;
}

.mail-domain-select {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 0.9rem;
}

.mail-domain-select select {
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--border-glass);
  border-radius: 6px;
  color: var(--text-main);
  padding: 6px 12px;
  font-family: var(--font-main);
  font-size: 0.85rem;
  cursor: pointer;
}

.mailboxes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 25px;
}

.mailbox-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  box-shadow: var(--glass-shadow);
  transition: var(--transition-smooth);
}

.mailbox-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

.mailbox-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mailbox-email {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mailbox-email i {
  color: var(--primary);
  font-size: 1.1rem;
}

.mailbox-email span {
  font-weight: 700;
  font-size: 0.95rem;
}

.mailbox-quota {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mailbox-quota-text {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.mailbox-quota-bar-wrapper {
  background: rgba(255,255,255,0.05);
  border-radius: 4px;
  height: 6px;
  overflow: hidden;
}

.mailbox-quota-bar {
  background: linear-gradient(90deg, var(--accent-cyan), var(--primary));
  height: 100%;
  border-radius: 4px;
  width: 0%;
  transition: width 0.6s ease;
}

.mailbox-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid var(--border-glass);
  padding-top: 12px;
}

/* ==================== MODULE: AI CHAT & TERMINAL ==================== */
.chat-terminal-split {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 25px;
  height: calc(100vh - 180px);
}

/* AI Chat Window */
.chat-section {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--glass-shadow);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.message {
  display: flex;
  gap: 15px;
  align-items: flex-start;
  max-width: 85%;
  animation: messageAppear 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes messageAppear {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.message.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.message .avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.message.system .avatar {
  background: rgba(99, 102, 241, 0.15);
  color: var(--primary);
  border: 1px solid rgba(99, 102, 241, 0.25);
  box-shadow: 0 0 8px var(--primary-glow);
}

.message.user .avatar {
  background: rgba(168, 85, 247, 0.15);
  color: var(--secondary);
  border: 1px solid rgba(168, 85, 247, 0.25);
}

.msg-content {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 12px 16px;
  line-height: 1.5;
  font-size: 0.9rem;
}

.message.system .msg-content {
  border-top-left-radius: 2px;
}

.message.user .msg-content {
  background: rgba(168, 85, 247, 0.08);
  border-color: rgba(168, 85, 247, 0.2);
  border-top-right-radius: 2px;
}

.msg-content p {
  margin-bottom: 8px;
}
.msg-content p:last-child {
  margin-bottom: 0;
}

.suggestion-tag {
  display: inline-block;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  color: var(--accent-cyan);
  cursor: pointer;
  transition: var(--transition-smooth);
  margin-top: 5px;
}

.suggestion-tag:hover {
  background: rgba(6, 182, 212, 0.1);
  border-color: rgba(6, 182, 212, 0.3);
}

.typing-indicator {
  display: flex;
  gap: 4px;
  align-items: center;
  height: 18px;
  padding: 0 4px;
}

.typing-dot {
  width: 6px;
  height: 6px;
  background-color: var(--text-muted);
  border-radius: 50%;
  animation: typing-bounce 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing-bounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

.chat-input-area {
  padding: 16px 20px;
  background: rgba(0, 0, 0, 0.25);
  border-top: 1px solid var(--border-glass);
  display: flex;
  gap: 12px;
}

#chat-input-box {
  flex: 1;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-glass);
  border-radius: 10px;
  padding: 12px 15px;
  color: #fff;
  font-family: var(--font-main);
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition-smooth);
}

#chat-input-box:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--border-focus);
}

.btn-send {
  background: var(--primary);
  border: none;
  border-radius: 10px;
  color: #fff;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-smooth);
  box-shadow: 0 4px 10px var(--primary-glow);
}

.btn-send:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 15px var(--primary-glow);
}

/* Shell Logger Terminal */
.terminal-section {
  background: #05060a;
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--glass-shadow);
}

.terminal-header {
  background: #0c0d15;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-glass);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.terminal-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.terminal-status {
  font-size: 0.65rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
}

.terminal-status::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  background-color: var(--text-dark);
  border-radius: 50%;
}

.terminal-status.active {
  color: var(--accent-emerald);
}

.terminal-status.active::before {
  background-color: var(--accent-emerald);
  box-shadow: 0 0 6px var(--accent-emerald);
}

.terminal-body {
  flex: 1;
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: #38bdf8; /* sky-400 */
  overflow-y: auto;
  line-height: 1.5;
}

.terminal-line {
  display: flex;
  gap: 8px;
  margin-bottom: 4px;
}

.t-path {
  color: #10b981; /* emerald-500 */
}

.t-cmd {
  color: #f1f5f9;
}

.terminal-output {
  color: #94a3b8; /* slate-400 */
  white-space: pre-wrap;
  margin-bottom: 6px;
}

.cursor-blink {
  animation: blink 1s step-end infinite;
  color: #fff;
}

@keyframes blink {
  from, to { opacity: 1; }
  50% { opacity: 0; }
}

/* ==================== MODALS LAYOUT ==================== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 1;
  transition: var(--transition-smooth);
}

.modal-content {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  box-shadow: var(--glass-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalZoom 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes modalZoom {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.file-editor-modal {
  width: 90%;
  max-width: 800px;
  height: 80%;
}

.standard-modal {
  width: 100%;
  max-width: 460px;
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
}

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

.btn-close-modal:hover {
  color: #fff;
}

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

.modal-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border-glass);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

#file-content-editor {
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-glass);
  border-radius: 8px;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: 15px;
  outline: none;
  resize: none;
}

#file-content-editor:focus {
  border-color: var(--primary);
}

.mail-input-split {
  display: flex;
  align-items: center;
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--border-glass);
  border-radius: 8px;
  overflow: hidden;
}

.mail-input-split input {
  flex: 1;
  background: transparent;
  border: none;
  color: #fff;
  padding: 10px 12px;
  font-family: var(--font-main);
  outline: none;
}

.mail-input-split span {
  padding: 0 12px;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  background: rgba(255,255,255,0.02);
  border-left: 1px solid var(--border-glass);
  height: 100%;
  display: flex;
  align-items: center;
}

.modal-body input[type="text"],
.modal-body input[type="password"],
.modal-body input[type="number"] {
  width: 100%;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-glass);
  border-radius: 8px;
  color: #fff;
  padding: 10px 12px;
  font-family: var(--font-main);
  outline: none;
  transition: var(--transition-smooth);
}

.modal-body input[type="text"]:focus,
.modal-body input[type="password"]:focus,
.modal-body input[type="number"]:focus {
  border-color: var(--primary);
}

/* AI Agent Working Indicator & Timer Styles */
.ai-agent-working {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(6, 182, 212, 0.4);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  color: #38bdf8;
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.15);
}
.ai-agent-pulse {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #38bdf8;
  box-shadow: 0 0 0 rgba(56, 189, 248, 0.4);
  animation: pulse-ring 1.5s infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(56, 189, 248, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(56, 189, 248, 0); }
}

.ai-timer-badge {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  background: rgba(6, 182, 212, 0.15);
  border: 1px solid rgba(6, 182, 212, 0.3);
  color: #22d3ee;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-left: auto;
}

.msg-meta-badge {
  font-size: 0.72rem;
  color: #06b6d4;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 5px;
  opacity: 0.85;
  font-weight: 500;
}
