/* css/style.css */
/* AI Account Vault - Core Theme & Styles */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600&family=Outfit:wght@400;500;600;700&display=swap');

:root {
  /* PRD Palette */
  --bg-dark: #0B0F14;
  --bg-card: #131922;
  --bg-card-hover: #1A222F;
  --border-color: #263041;
  --border-glow: rgba(16, 163, 127, 0.3);
  
  --primary: #10A37F;
  --primary-hover: #0D8C6D;
  --primary-light: rgba(16, 163, 127, 0.12);
  
  --text-main: #F4F7FA;
  --text-muted: #94A3B8;
  --text-dim: #64748B;
  
  --warning: #F59E0B;
  --warning-bg: rgba(245, 158, 11, 0.12);
  --danger: #EF4444;
  --danger-bg: rgba(239, 68, 68, 0.12);
  --success: #10B981;
  
  /* Fonts */
  --font-main: 'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Outfit', var(--font-main);
  --font-mono: 'JetBrains Mono', monospace;
  
  /* Shadows & Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-card: 0 4px 20px -2px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px rgba(16, 163, 127, 0.15);
}

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

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-main);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* App Container Layout */
#app-container {
  display: flex;
  width: 100vw;
  min-height: 100vh;
}

/* Sidebar Desktop */
.sidebar {
  width: 260px;
  background: #0E131A;
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1rem;
  flex-shrink: 0;
  z-index: 50;
  transition: transform 0.3s ease;
}

.brand-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1.5rem;
}

.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), #059669);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 0 15px rgba(16, 163, 127, 0.4);
}

.brand-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.brand-badge {
  font-size: 0.65rem;
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid rgba(16, 163, 127, 0.3);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
}

.nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.nav-item button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.nav-item button:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
}

.nav-item button.active {
  background: var(--primary-light);
  color: var(--primary);
  border-left: 3px solid var(--primary);
  font-weight: 600;
}

/* Storage Status Pill in Sidebar */
.storage-indicator {
  margin-top: auto;
  padding: 0.85rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.75rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 8px var(--primary);
}

.status-dot.local {
  background: var(--warning);
  box-shadow: 0 0 8px var(--warning);
}

/* Main Content Area */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
  padding: 2rem;
}

/* Page Header */
.top-header {
  position: sticky;
  top: -2rem;
  z-index: 40;
  background: rgba(11, 15, 20, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 1rem 0;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid rgba(38, 48, 65, 0.5);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.header-title-area h1 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.header-title-area p {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-top: 2px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* css/components.css */
/* UI Components & Interactive Elements */

/* Account list pagination */
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.pagination-summary,
.pagination-current,
.pagination-page-size {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.pagination-controls button:disabled {
  cursor: not-allowed;
  opacity: 0.35;
}

.pagination-page-size {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-left: 0.5rem;
}

.pagination-page-size .form-select {
  min-width: 4.5rem;
  padding: 0.3rem 0.5rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  user-select: none;
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 12px rgba(16, 163, 127, 0.25);
}
.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 6px 16px rgba(16, 163, 127, 0.35);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-card);
  border-color: var(--border-color);
  color: var(--text-main);
}
.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--text-dim);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}
.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
}

.btn-danger {
  background: var(--danger);
  color: white;
}
.btn-danger:hover {
  background: #DC2626;
}

.btn-icon-only {
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  aspect-ratio: 1;
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
}

/* Plus Badge Toggle Button */
.btn-plus-toggle {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-dim);
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: all 0.2s ease;
  user-select: none;
}
.btn-plus-toggle:hover {
  border-color: var(--primary);
}
.btn-plus-toggle.active {
  background: linear-gradient(135deg, rgba(16, 163, 127, 0.25), rgba(5, 150, 105, 0.35));
  border-color: var(--primary);
  color: #10B981;
  box-shadow: 0 0 10px rgba(16, 163, 127, 0.25);
}

/* Codex Badge Toggle Button */
.btn-codex-toggle {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-dim);
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: all 0.2s ease;
  user-select: none;
}
.btn-codex-toggle:hover {
  border-color: #0EA5E9;
}
.btn-codex-toggle.active {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.25), rgba(99, 102, 241, 0.35));
  border-color: #0EA5E9;
  color: #38BDF8;
  box-shadow: 0 0 10px rgba(14, 165, 233, 0.3);
}

/* GCash Badge Toggle Button */
.btn-gcash-toggle {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-dim);
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: all 0.2s ease;
  user-select: none;
}
.btn-gcash-toggle:hover {
  border-color: #10B981;
}
.btn-gcash-toggle.active {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.25), rgba(5, 150, 105, 0.35));
  border-color: #10B981;
  color: #10B981;
}

/* Trial Offer Badge Toggle Button */
.btn-trial-toggle {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-dim);
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: all 0.2s ease;
  user-select: none;
}
.btn-trial-toggle:hover {
  border-color: #F59E0B;
}
.btn-trial-toggle.active {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(217, 119, 6, 0.35));
  border-color: #F59E0B;
  color: #FBBF24;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
}

/* Netflix Badge Toggle Button */
.btn-netflix-toggle {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-dim);
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: all 0.2s ease;
  user-select: none;
}
.btn-netflix-toggle:hover {
  border-color: #E50914;
}
.btn-netflix-toggle.active {
  background: linear-gradient(135deg, rgba(229, 9, 20, 0.25), rgba(184, 29, 36, 0.35));
  border-color: #E50914;
  color: #FF4D4D;
  box-shadow: 0 0 10px rgba(229, 9, 20, 0.3);
}

/* Page Tab Switcher (Daftar Utama vs Free Offer Trial vs Vault Netflix) */
.main-page-tabs {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.75rem;
  flex-wrap: wrap;
}

.page-tab-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.page-tab-btn:hover {
  border-color: var(--primary);
  color: var(--text-main);
}

.page-tab-btn.active {
  background: linear-gradient(135deg, rgba(16, 163, 127, 0.15), rgba(16, 185, 129, 0.25));
  border-color: var(--primary);
  color: #10B981;
  box-shadow: 0 0 12px rgba(16, 163, 127, 0.2);
}

.page-tab-btn#tab-btn-trial.active {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(217, 119, 6, 0.25));
  border-color: #F59E0B;
  color: #FBBF24;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.2);
}

.page-tab-btn#tab-btn-netflix.active {
  background: linear-gradient(135deg, rgba(229, 9, 20, 0.15), rgba(184, 29, 36, 0.25));
  border-color: #E50914;
  color: #FF4D4D;
  box-shadow: 0 0 12px rgba(229, 9, 20, 0.2);
}

/* Stats Bento Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(16, 163, 127, 0.4);
}

.stat-info h4 {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-number {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  margin-top: 0.25rem;
  color: var(--text-main);
}

.stat-icon-wrapper {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-light);
  color: var(--primary);
}

/* Filter & Search Bar Controls */
.controls-bar {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 240px;
}

.search-box svg {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
}

.search-input {
  width: 100%;
  padding: 0.65rem 0.9rem 0.65rem 2.6rem;
  background: var(--bg-dark);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.2s ease;
}
.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-light);
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.select-input {
  padding: 0.65rem 0.9rem;
  background: var(--bg-dark);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 0.85rem;
  outline: none;
  cursor: pointer;
}

/* View Mode Switcher */
.view-toggle {
  display: flex;
  background: var(--bg-dark);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 2px;
}

.view-toggle-btn {
  padding: 0.4rem 0.75rem;
  background: transparent;
  border: none;
  color: var(--text-dim);
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
}
.view-toggle-btn.active {
  background: var(--bg-card);
  color: var(--primary);
  font-weight: 600;
}

/* Table View */
.table-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

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

.accounts-table th {
  background: #0F151E;
  padding: 0.9rem 1.25rem;
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.accounts-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.accounts-table tbody tr {
  transition: background 0.15s ease;
}
.accounts-table tbody tr:hover {
  background: var(--bg-card-hover);
}

.accounts-table tbody tr.selected {
  background: var(--primary-light);
}

/* Secret Field Display */
.secret-code {
  font-family: var(--font-mono);
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: #E2E8F0;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Inline MFA Input Styles */
.inline-mfa-box {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
  max-width: 280px;
}

.inline-mfa-input {
  background: #0D121B;
  border: 1.5px solid var(--primary);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 0.3rem 0.6rem;
  outline: none;
  width: 100%;
  box-shadow: 0 0 10px rgba(16, 163, 127, 0.25);
  transition: all 0.2s ease;
}

.inline-mfa-input:focus {
  border-color: var(--primary-hover);
  box-shadow: 0 0 14px rgba(16, 163, 127, 0.45);
}

.inline-mfa-btn {
  padding: 0.3rem 0.5rem;
  font-size: 0.75rem;
  height: 28px;
  aspect-ratio: 1;
}

.btn-inline-mfa-add {
  font-size: 0.75rem;
  padding: 0.25rem 0.65rem;
  color: #F59E0B;
  background: rgba(245, 158, 11, 0.1);
  border: 1px dashed rgba(245, 158, 11, 0.4);
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.2s ease;
  cursor: pointer;
  font-weight: 500;
}

.btn-inline-mfa-add:hover {
  background: rgba(245, 158, 11, 0.2);
  border-color: #F59E0B;
  color: #FBBF24;
  transform: translateY(-1px);
}

.copy-mini-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 2px;
  border-radius: 3px;
  display: inline-flex;
}
.copy-mini-btn:hover {
  color: var(--primary);
}

/* Card View Grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}

.account-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
  box-shadow: var(--shadow-card);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.account-card:hover {
  border-color: rgba(16, 163, 127, 0.4);
  transform: translateY(-2px);
}

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

.card-field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.field-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 600;
  letter-spacing: 0.05em;
}

.field-value-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-dark);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.field-value-text {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  word-break: break-all;
}

.card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color);
  margin-top: 0.25rem;
}

/* Batch Action Floating Bar */
.batch-action-bar {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #17202D;
  border: 1px solid var(--primary);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), var(--shadow-glow);
  padding: 0.75rem 1.5rem;
  border-radius: 40px;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.25s ease, visibility 0.25s ease;
}

.batch-action-bar.active {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.batch-actions-desktop {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  align-items: center;
}

.batch-actions-mobile {
  display: none;
}

/* Mobile Batch Action Group & Grid inside Modal */
.batch-group {
  background: #0E131A;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.batch-group-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.batch-btn-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.batch-btn-grid button {
  width: 100%;
  justify-content: center;
  font-size: 0.825rem;
  padding: 0.6rem 0.5rem;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 520px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8);
  transform: scale(0.95);
  transition: transform 0.25s ease;
}

.modal-overlay.active .modal-card {
  transform: scale(1);
}

.modal-card.modal-lg {
  max-width: 850px;
}

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

.modal-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 1.25rem;
  padding: 0.25rem;
}
.modal-close-btn:hover {
  color: var(--danger);
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

/* Rendered Microsoft/Outlook email body: real formatting + clickable links */
.microsoft-mail-body {
  color: var(--text-muted);
}
.microsoft-mail-body a {
  color: #0b57d0;
  text-decoration: underline;
  word-break: break-word;
}
.microsoft-mail-body a:hover {
  opacity: 0.85;
}
/* Image-based CTA buttons often become empty <a> links after sanitizing
   (their visual came from a background image). Show the URL so the button
   stays visible & usable instead of an invisible-but-clickable gap. */
.microsoft-mail-body a:empty::after {
  content: "🔗 " attr(href);
  color: #0b57d0;
  text-decoration: underline;
  word-break: break-word;
}
.microsoft-mail-body img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}
/* Suppress the messy borders that emails bring in */
.microsoft-mail-body table,
.microsoft-mail-body td,
.microsoft-mail-body th,
.microsoft-mail-body tr,
.microsoft-mail-body tbody,
.microsoft-mail-body thead {
  border: none !important;
  background: transparent !important;
  color: inherit;
}
.microsoft-mail-body table {
  border-collapse: collapse;
  width: 100%;
  margin: 0.5rem 0;
}
.microsoft-mail-body td,
.microsoft-mail-body th {
  padding: 0.4rem 0.6rem;
  vertical-align: top;
}

/* Collapsible Microsoft inbox messages & modal */
.modal-card.modal-inbox-card {
  max-width: 920px;
  width: 95%;
  height: 88vh;
  max-height: 860px;
  display: flex;
  flex-direction: column;
}

.modal-inbox-header-title {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}
.modal-inbox-subtitle {
  color: var(--text-muted);
  font-size: 0.8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.modal-inbox-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Pinned Toolbar (Search, Filter Tabs, Batch Actions) */
.modal-inbox-toolbar {
  padding: 0.75rem 1.5rem 0.6rem;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-surface, var(--bg-card));
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  flex-shrink: 0;
}
.modal-inbox-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}
.modal-inbox-search-input {
  width: 100%;
  padding-right: 2rem;
  font-size: 0.85rem;
}
.modal-inbox-clear-search {
  position: absolute;
  right: 0.6rem;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 1.1rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.2rem;
}
.modal-inbox-clear-search:hover {
  color: var(--text-main);
}
.modal-inbox-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.modal-inbox-filter-tabs {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}
.inbox-filter-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.75rem;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.15s ease;
}
.inbox-filter-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}
.inbox-filter-btn.active {
  background: rgba(59, 130, 246, 0.15);
  border-color: #3b82f6;
  color: #60a5fa;
  font-weight: 600;
}
.inbox-filter-count {
  background: rgba(0, 0, 0, 0.35);
  padding: 0.05rem 0.35rem;
  border-radius: 999px;
  font-size: 0.7rem;
}
.modal-inbox-actions-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.btn-xs {
  padding: 0.2rem 0.5rem;
  font-size: 0.75rem;
}

/* Modal Body & List Container */
.modal-body.modal-inbox-body {
  padding: 0.85rem 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.modal-inbox-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-right: 2px;
}

/* Message Card - prevent squishing bug */
.ms-msg-card {
  background: var(--card-bg, #1a1e29);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  min-height: 52px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.ms-msg-card:hover {
  border-color: rgba(59, 130, 246, 0.4);
}
.ms-msg-head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.85rem;
  cursor: pointer;
  user-select: none;
  min-height: 52px;
  box-sizing: border-box;
}
.ms-msg-head:hover {
  background: rgba(255, 255, 255, 0.03);
}
.ms-chevron {
  flex: 0 0 auto;
  color: var(--primary, #3b82f6);
  font-size: 0.85rem;
  transition: transform 0.15s ease;
  width: 14px;
  text-align: center;
}
.ms-msg-content-preview {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1 1 auto;
  min-width: 0;
}
.ms-msg-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-width: 0;
}
.ms-msg-row-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-width: 0;
}
.ms-msg-from {
  color: var(--text-main);
  font-weight: 600;
  font-size: 0.82rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 0 1 auto;
}
.ms-msg-subj {
  color: var(--text-muted);
  font-size: 0.8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1 1 auto;
  min-width: 0;
}
.ms-msg-date {
  flex: 0 0 auto;
  color: var(--text-dim);
  font-size: 0.72rem;
  white-space: nowrap;
}
.ms-msg-badges {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex: 0 0 auto;
}

/* OTP Badge with 1-Click Copy */
.ms-otp-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  cursor: pointer;
  letter-spacing: 0.03em;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.ms-otp-badge:hover {
  background: rgba(16, 185, 129, 0.28);
  border-color: #10b981;
  color: #fff;
}
.ms-otp-badge.copied {
  background: #10b981;
  color: #064e3b;
  border-color: #10b981;
}
.ms-otp-badge .ms-copy-icon {
  font-size: 0.7rem;
  opacity: 0.85;
}
.ms-msg-flags {
  flex: 0 0 auto;
  font-size: 0.72rem;
  color: var(--primary);
  white-space: nowrap;
}
.ms-msg-new {
  flex: 0 0 auto;
  font-size: 0.68rem;
  font-weight: 700;
  color: #fff;
  background: var(--primary, #3b82f6);
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  white-space: nowrap;
}

/* Message Body & Sandboxed Shadow DOM */
.ms-msg-body {
  padding: 0 1rem 1rem;
  display: none;
}
.ms-msg-body.open {
  display: block;
  background: #ffffff;
  color: #1a1a1a;
  padding: 0.75rem 1rem 1rem;
  border-top: 1px solid var(--border-color);
  border-radius: 0 0 8px 8px;
  max-height: 520px;
  overflow-y: auto;
}
.ms-msg-body-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-bottom: 0.5rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid #e2e8f0;
  font-size: 0.75rem;
  color: #64748b;
}

/* Read / unread distinction */
.ms-msg-card.ms-unread {
  border-left: 3px solid var(--primary, #3b82f6);
}
.ms-msg-card.ms-unread .ms-msg-from {
  color: var(--text-main);
}
.ms-msg-card.ms-read {
  border-left: 3px solid transparent;
}
.ms-msg-card.ms-read .ms-msg-head {
  opacity: 0.75;
}
.ms-msg-card.ms-read .ms-msg-from {
  font-weight: 500;
}

/* Inbox State Boxes (loading / error / empty) */
.inbox-state-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
  color: var(--text-muted);
  font-size: 0.88rem;
  text-align: center;
  gap: 0.75rem;
}
.inbox-error-box {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 8px;
  padding: 1.25rem;
}
.inbox-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(59, 130, 246, 0.2);
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: inbox-spin 0.8s linear infinite;
}
@keyframes inbox-spin {
  to { transform: rotate(360deg); }
}

/* Modal Footer & Pagination */
.modal-footer.modal-inbox-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  border-top: 1px solid var(--border-color);
}
.inbox-pagination {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.inbox-pagination-controls {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.inbox-page-current {
  font-weight: 600;
  color: var(--text-main);
  padding: 0 0.25rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  background: #0E131A;
  border-bottom-left-radius: var(--radius-lg);
  border-bottom-right-radius: var(--radius-lg);
}

/* Forms */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
}

.form-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}

.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-dark);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 0.9rem;
  font-family: var(--font-main);
  outline: none;
  transition: border-color 0.2s ease;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-light);
}

.form-textarea {
  min-height: 120px;
  resize: vertical;
  font-family: var(--font-mono);
}

.form-checkbox-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: rgba(16, 163, 127, 0.08);
  border: 1px solid var(--primary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  user-select: none;
  font-weight: 600;
  color: var(--text-main);
}

.form-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  cursor: pointer;
  user-select: none;
}

/* Bulk Preview Table */
.preview-table-wrapper {
  max-height: 250px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  margin-top: 1rem;
}

.preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.preview-table th {
  background: #0F151E;
  padding: 0.6rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.preview-table td {
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--border-color);
}

.badge-status {
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
}
.badge-status.valid {
  background: rgba(16, 185, 129, 0.15);
  color: #10B981;
}
.badge-status.invalid {
  background: var(--danger-bg);
  color: var(--danger);
}
.badge-status.warning {
  background: var(--warning-bg);
  color: var(--warning);
}

/* Toast Notifications */
#toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 300;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: #17202D;
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--primary);
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: toastIn 0.3s ease forwards;
}

.toast.error {
  border-left-color: var(--danger);
}
.toast.info {
  border-left-color: #3B82F6;
}

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

/* Floating Action Button (FAB) */
.fab-add-account {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 90;
  background: linear-gradient(135deg, var(--primary), #059669);
  color: white;
  border: 1px solid rgba(16, 163, 127, 0.5);
  border-radius: 30px;
  padding: 0.75rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 0 15px rgba(16, 163, 127, 0.3);
  transition: all 0.25s ease;
  user-select: none;
}
.fab-add-account:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.5), 0 0 20px rgba(16, 163, 127, 0.45);
}
.fab-add-account:active {
  transform: translateY(0) scale(0.98);
}
.batch-action-bar.active ~ .fab-add-account {
  bottom: 5.5rem;
}

/* css/responsive.css */
/* Responsive & Mobile Design */

/* Mobile Bottom Navigation Bar */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100vw;
  background: #0E131A;
  border-top: 1px solid var(--border-color);
  z-index: 150;
  padding: 0.5rem 0;
}

.mobile-nav-list {
  display: flex;
  justify-content: space-around;
  align-items: center;
  list-style: none;
}

.mobile-nav-item button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 0.65rem;
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  cursor: pointer;
}

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

/* Responsive Media Queries */
@media (max-width: 900px) {
  .sidebar {
    display: none; /* Hide desktop sidebar on mobile */
  }

  /* Hide redundant FAB on mobile since mobile-bottom-nav already has + Tambah */
  #fab-add-account,
  .fab-add-account {
    display: none !important;
  }

  .mobile-bottom-nav {
    display: block;
  }

  .main-content {
    padding: 1rem 0.85rem 5.5rem 0.85rem; /* Extra bottom space for bottom nav */
  }

  /* Compact top header on mobile to maximize viewport space */
  .top-header {
    flex-direction: column;
    align-items: flex-start;
    padding: 0.5rem 0;
    margin-bottom: 0.75rem;
    position: relative;
    top: 0;
  }

  .header-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .controls-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-group {
    justify-content: space-between;
  }

  /* Hide Floating Batch Action Bar on Mobile (Moved to toolbar) */
  .batch-action-bar {
    display: none !important;
  }

  .batch-actions-desktop {
    display: none !important;
  }

  .batch-actions-mobile {
    display: none !important;
  }

  /* Mobile Bottom Sheet Modal */
  .modal-overlay.mobile-bottom-sheet {
    align-items: flex-end;
  }

  .modal-overlay.mobile-bottom-sheet .modal-card {
    width: 100%;
    max-width: 100%;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    max-height: 80vh;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.9);
  }

  /* Table turns into horizontal scrolling or auto card view fallback on small screens */
  .table-container {
    overflow-x: auto;
  }

  .pagination-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .pagination-controls {
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .pagination-page-size {
    margin-left: 0;
  }

  /* Mobile adjustments for Microsoft Inbox */
  .modal-card.modal-inbox-card {
    width: 100%;
    height: 92vh;
    max-height: 92vh;
  }
  .modal-inbox-toolbar {
    padding: 0.6rem 1rem 0.5rem;
  }
  .modal-inbox-filter-bar {
    gap: 0.4rem;
  }
  .modal-body.modal-inbox-body {
    padding: 0.6rem 0.85rem;
  }
  .ms-msg-head {
    padding: 0.6rem 0.65rem;
  }
  .modal-footer.modal-inbox-footer {
    padding: 0.6rem 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
}


