/* LinkZoom Modern Desktop Application Stylesheet */
:root {
  --bg-app: #0b0f19;
  --bg-sidebar: #0e1424;
  --bg-card: #151d30;
  --bg-card-hover: #1c263f;
  --bg-input: #1a233a;
  --border: #232f4c;
  --border-focus: #3b82f6;
  
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: rgba(37, 99, 235, 0.15);
  
  --zoom-blue: #0b5cff;
  --zoom-blue-hover: #004bd8;
  
  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.15);
  
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.15);
  
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.15);
  
  --info: #06b6d4;
  --info-bg: rgba(6, 182, 212, 0.15);
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;
  
  --shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.5);
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

input, textarea, select {
  user-select: text;
}

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

/* App Container */
#app {
  display: flex;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

/* Sidebar */
.sidebar {
  width: 260px;
  min-width: 260px;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
}

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

.brand-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #0b5cff 0%, #002e8a 100%);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 4px 12px rgba(11, 92, 255, 0.35);
}

.brand-text h1 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: #fff;
}

.brand-text span {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

/* Nav Menu */
.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.nav-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-item i, .nav-item svg {
  width: 18px;
  height: 18px;
}

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

.nav-item.active {
  background-color: var(--primary);
  color: #fff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.nav-badge {
  background: var(--bg-input);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--radius-full);
}

.nav-item.active .nav-badge {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.sidebar-footer {
  padding-top: 15px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.system-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--text-dim);
  padding: 6px 10px;
}

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

/* Main Content Area */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background-color: var(--bg-app);
}

/* Top Header */
.top-header {
  height: 64px;
  min-height: 64px;
  border-bottom: 1px solid var(--border);
  background-color: var(--bg-sidebar);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
}

.header-title h2 {
  font-size: 1.2rem;
  font-weight: 600;
  color: #fff;
}

.header-title p {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.header-badge.active {
  border-color: rgba(16, 185, 129, 0.4);
  color: var(--success);
}

/* View Container */
.view-container {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px;
}

.view-section {
  display: none;
  animation: fadeIn 0.18s ease-in-out;
}

.view-section.active {
  display: block;
}

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

/* Cards & Grid */
.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

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

.card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.05rem;
  font-weight: 600;
  color: #fff;
}

.card-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 3px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--radius-md);
  font-size: 0.86rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background-color: var(--primary);
  color: #fff;
}
.btn-primary:hover {
  background-color: var(--primary-hover);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.btn-zoom {
  background: linear-gradient(135deg, #0b5cff 0%, #004bd8 100%);
  color: #fff;
}
.btn-zoom:hover {
  box-shadow: 0 4px 14px rgba(11, 92, 255, 0.4);
}

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

.btn-success {
  background-color: var(--success);
  color: #fff;
}
.btn-success:hover {
  background-color: #059669;
}

.btn-danger {
  background-color: var(--danger);
  color: #fff;
}
.btn-danger:hover {
  background-color: #dc2626;
}

.btn-outline-danger {
  background-color: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
}
.btn-outline-danger:hover {
  background-color: var(--danger-bg);
}

.btn-sm {
  padding: 6px 11px;
  font-size: 0.78rem;
  border-radius: var(--radius-sm);
}

.btn-icon {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: var(--radius-sm);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none !important;
}

/* Forms & Inputs */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.form-group.col-span-2 {
  grid-column: span 2;
}

label {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

label span.req {
  color: var(--danger);
  margin-left: 3px;
}

.form-control {
  background-color: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  color: var(--text-main);
  font-size: 0.88rem;
  outline: none;
  transition: var(--transition);
  width: 100%;
}

.form-control:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

textarea.form-control {
  min-height: 80px;
  resize: vertical;
}

select.form-control {
  cursor: pointer;
}

.input-hint {
  font-size: 0.74rem;
  color: var(--text-dim);
}

/* Switches & Checkboxes */
.checkbox-group {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--primary);
  cursor: pointer;
}

.switch-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background-color: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  margin-bottom: 10px;
}

.switch-label .switch-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.switch-label .switch-title {
  font-size: 0.86rem;
  font-weight: 500;
  color: #fff;
}

.switch-label .switch-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

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

th {
  background-color: var(--bg-sidebar);
  color: var(--text-muted);
  font-weight: 600;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-main);
  vertical-align: middle;
}

tr:hover td {
  background-color: var(--bg-card-hover);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-neutral { background: var(--bg-input); color: var(--text-muted); }

/* Quick Filter Bar */
.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

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

.search-box input {
  padding-left: 36px;
}

.search-box .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  width: 16px;
  height: 16px;
}

.filter-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Stat Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.stat-info .stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}

.stat-info .stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 50px 20px;
  color: var(--text-muted);
}

.empty-state i, .empty-state svg {
  width: 48px;
  height: 48px;
  margin-bottom: 14px;
  color: var(--text-dim);
}

.empty-state h3 {
  font-size: 1rem;
  color: #fff;
  margin-bottom: 6px;
}

.empty-state p {
  font-size: 0.82rem;
  max-width: 380px;
  margin: 0 auto 18px;
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(3, 7, 18, 0.75);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
  animation: modalFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.modal {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.7);
}

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

.modal-header h3 {
  font-size: 1.1rem;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.25rem;
  padding: 4px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  color: #fff;
  background-color: var(--bg-input);
}

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

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background-color: var(--bg-sidebar);
  border-bottom-left-radius: var(--radius-lg);
  border-bottom-right-radius: var(--radius-lg);
}

/* Toast System */
#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 0.86rem;
  color: #fff;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.6);
  min-width: 280px;
  max-width: 440px;
  animation: slideInRight 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.toast-success { background: #064e3b; border-color: #059669; }
.toast-error { background: #7f1d1d; border-color: #dc2626; }
.toast-info { background: #1e3a8a; border-color: #2563eb; }
.toast-warning { background: #78350f; border-color: #d97706; }

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

/* Code Preview Box */
.code-preview {
  background-color: #070a13;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.8rem;
  color: #38bdf8;
  max-height: 260px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
  user-select: text;
}

/* Details Box / Link Zoom Highlight Box */
.highlight-box {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.1) 0%, rgba(11, 92, 255, 0.05) 100%);
  border: 1px solid rgba(37, 99, 235, 0.3);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 16px;
}

.highlight-box .link-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin-top: 8px;
}

.highlight-box .link-input {
  background: transparent;
  border: none;
  color: #60a5fa;
  font-weight: 500;
  font-size: 0.85rem;
  flex: 1;
  outline: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Loading Spinner */
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 0.7s linear infinite;
}

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

/* Tooltip copy animation */
.copied-tip {
  color: var(--success);
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}



/* ================= QUICK COMMAND BAR STYLES ================= */
.quick-command-card {
  border: 1px solid rgba(59, 130, 246, 0.45);
  background: linear-gradient(135deg, rgba(26, 38, 66, 0.85) 0%, rgba(15, 23, 42, 0.95) 100%);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  margin-bottom: 24px;
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.5), 0 0 25px -5px rgba(37, 99, 235, 0.25);
}

.quick-examples-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pill-badge {
  background: rgba(37, 99, 235, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.35);
  color: #93c5fd;
  font-size: 0.74rem;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.pill-badge:hover {
  background: rgba(37, 99, 235, 0.4);
  border-color: #60a5fa;
  color: #fff;
  transform: translateY(-1px);
}

.quick-command-input-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  background-color: #0b1120;
  border: 2px solid #2563eb;
  border-radius: var(--radius-md);
  padding: 7px 10px 7px 16px;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

.command-prefix-icon {
  color: #60a5fa;
  display: flex;
  align-items: center;
  justify-content: center;
}

.command-prefix-icon svg {
  width: 22px;
  height: 22px;
}

.quick-command-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-size: 1.05rem;
  font-weight: 500;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Segoe UI", sans-serif;
  letter-spacing: 0.3px;
}

.quick-command-input::placeholder {
  color: #64748b;
  font-size: 0.92rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.command-live-preview {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  margin-top: 14px;
  animation: fadeIn 0.15s ease-in;
}

.preview-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
}

.preview-item .lbl {
  color: var(--text-muted);
}

.preview-item strong {
  color: #fff;
}

/* ================= NO-SCROLL TABLE OPTIMIZATION ================= */
.table-responsive {
  width: 100%;
  overflow-x: hidden; /* Menghilangkan scrollbar horizontal */
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

@media (max-width: 1100px) {
  .table-responsive {
    overflow-x: auto;
  }
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.84rem;
  table-layout: fixed;
}

th, td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  word-break: break-word;
}

/* Kolom Table Created (6 kolom, keterangan tanggal & jam dihapus) */
#table-created th:nth-child(1), #table-created td:nth-child(1) { width: 30%; }
#table-created th:nth-child(2), #table-created td:nth-child(2) { width: 13%; }
#table-created th:nth-child(3), #table-created td:nth-child(3) { width: 29%; }
#table-created th:nth-child(4), #table-created td:nth-child(4) { width: 9%; }
#table-created th:nth-child(5), #table-created td:nth-child(5) { width: 8%; }
#table-created th:nth-child(6), #table-created td:nth-child(6) { width: 11%; text-align: right; }

/* Kolom Table Synced */
#table-synced th:nth-child(1), #table-synced td:nth-child(1) { width: 26%; }
#table-synced th:nth-child(2), #table-synced td:nth-child(2) { width: 14%; }
#table-synced th:nth-child(3), #table-synced td:nth-child(3) { width: 18%; }
#table-synced th:nth-child(4), #table-synced td:nth-child(4) { width: 10%; }
#table-synced th:nth-child(5), #table-synced td:nth-child(5) { width: 21%; }
#table-synced th:nth-child(6), #table-synced td:nth-child(6) { width: 11%; text-align: right; }

/* Kolom Table Accounts */
#table-accounts th:nth-child(1), #table-accounts td:nth-child(1) { width: 20%; }
#table-accounts th:nth-child(2), #table-accounts td:nth-child(2) { width: 18%; }
#table-accounts th:nth-child(3), #table-accounts td:nth-child(3) { width: 16%; }
#table-accounts th:nth-child(4), #table-accounts td:nth-child(4) { width: 12%; }
#table-accounts th:nth-child(5), #table-accounts td:nth-child(5) { width: 15%; }
#table-accounts th:nth-child(6), #table-accounts td:nth-child(6) { width: 9%; }
#table-accounts th:nth-child(7), #table-accounts td:nth-child(7) { width: 10%; text-align: right; }
