/* ── Reset & basis ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --green-900: #1a3d1a;
  --green-800: #2d5a2d;
  --green-700: #3a7a3a;
  --green-600: #4a9a4a;
  --green-100: #e8f5e8;
  --green-50:  #f0f7f0;
  --text:      #1f2937;
  --text-muted:#6b7280;
  --border:    #e5e7eb;
  --bg:        #f9fafb;
  --white:     #ffffff;
  --red:       #dc2626;
  --red-light: #fef2f2;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
  --shadow:    0 4px 16px rgba(0,0,0,.10);
  --radius:    10px;
}

html, body { height: 100%; font-family: 'Segoe UI', system-ui, sans-serif; font-size: 15px; color: var(--text); }

/* ── Auth pagina ───────────────────────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--green-900) 0%, var(--green-700) 100%);
}

.auth-card {
  background: var(--white);
  border-radius: 16px;
  padding: 40px 44px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow);
}

.auth-logo {
  text-align: center;
  margin-bottom: 32px;
}

.logo-icon {
  font-size: 3rem;
  line-height: 1;
  margin-bottom: 8px;
}

.auth-logo h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--green-800);
}

.auth-hint {
  text-align: center;
  color: var(--text-muted);
  font-size: .875rem;
  margin-top: 16px;
}

.verify-intro {
  text-align: center;
  margin-bottom: 24px;
  color: var(--text-muted);
  line-height: 1.6;
}

.verify-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
}

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

/* ── Formulieren ───────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 20px; }

label { display: block; font-weight: 600; margin-bottom: 6px; font-size: .875rem; }

input[type="email"],
input[type="text"] {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  transition: border-color .2s;
  outline: none;
}
input:focus { border-color: var(--green-600); }

.input-readonly {
  background: var(--bg);
  color: var(--text-muted);
  cursor: default;
}

.otp-input {
  text-align: center;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: .4em;
  font-family: monospace;
  padding: 14px;
}

/* ── Knoppen ───────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid transparent;
  text-decoration: none;
  transition: all .15s;
  white-space: nowrap;
}

.btn-primary {
  background: var(--green-700);
  color: var(--white);
  border-color: var(--green-700);
}
.btn-primary:hover { background: var(--green-800); border-color: var(--green-800); }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover { background: var(--bg); }

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

.btn-link {
  background: none;
  border: none;
  color: var(--green-700);
  font-size: .875rem;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 8px;
  text-decoration: none;
}
.btn-link:hover { text-decoration: underline; }

.btn-logout {
  background: transparent;
  border: 1.5px solid rgba(255,255,255,.3);
  color: rgba(255,255,255,.85);
  font-size: .8rem;
  padding: 6px 12px;
  width: 100%;
  justify-content: center;
  margin-top: 8px;
}
.btn-logout:hover { background: rgba(255,255,255,.1); }

.btn-full { width: 100%; justify-content: center; padding: 12px; font-size: 1rem; }
.btn-sm   { padding: 6px 12px; font-size: .8rem; }
.btn-xs   { padding: 4px 8px; font-size: .75rem; }
.btn-lg   { padding: 14px 32px; font-size: 1.1rem; }

.upload-trigger { cursor: pointer; }

/* ── Alerts ────────────────────────────────────────────────────────────────── */
.alert {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: .875rem;
  margin-bottom: 16px;
}
.alert-error { background: var(--red-light); color: var(--red); border: 1px solid #fca5a5; }

/* ── Layout dashboard ──────────────────────────────────────────────────────── */
.layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
  background: var(--bg);
}

/* ── Zijbalk ───────────────────────────────────────────────────────────────── */
.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--green-900);
  color: var(--white);
  display: flex;
  flex-direction: column;
  padding: 0;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 24px 20px 20px;
  font-size: 1.15rem;
  font-weight: 700;
  border-bottom: 1px solid rgba(255,255,255,.1);
}

.logo-icon-sm { font-size: 1.4rem; }

.sidebar-nav {
  flex: 1;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: rgba(255,255,255,.75);
  text-decoration: none;
  font-size: .9rem;
  font-weight: 500;
  transition: all .15s;
  cursor: pointer;
}
.nav-item:hover, .nav-item.active {
  background: rgba(255,255,255,.12);
  color: var(--white);
}

.nav-icon { font-size: 1.1rem; }

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255,255,255,.1);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--green-600);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .9rem;
}

.user-name { font-size: .9rem; font-weight: 600; color: rgba(255,255,255,.9); }

/* ── Hoofdgebied ───────────────────────────────────────────────────────────── */
.main-content {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.section { padding: 28px 32px; flex: 1; }
.section.active { display: flex; flex-direction: column; }

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

.section-header h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
}

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

/* ── Upload balk ───────────────────────────────────────────────────────────── */
.upload-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--green-50);
  border: 1.5px solid var(--green-100);
  padding: 10px 16px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.folder-select {
  padding: 6px 10px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  font-size: .875rem;
  cursor: pointer;
}

.upload-progress { font-size: .85rem; color: var(--text-muted); }

/* ── Mappen raster ─────────────────────────────────────────────────────────── */
.folder-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.folder-card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .15s;
}
.folder-card:hover { box-shadow: var(--shadow); }

.folder-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  cursor: pointer;
  user-select: none;
  background: var(--white);
  transition: background .15s;
}
.folder-header:hover { background: var(--green-50); }

.folder-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: .95rem;
}

.folder-icon { font-size: 1.1rem; }

.folder-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.file-count { font-size: .8rem; color: var(--text-muted); }
.folder-toggle { font-size: .7rem; color: var(--text-muted); transition: transform .2s; }
.folder-toggle.open { transform: rotate(180deg); }

.folder-body {
  border-top: 1px solid var(--border);
  padding: 0;
  display: none;
}
.folder-body.open { display: block; }

.file-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}

.file-table th {
  background: var(--bg);
  padding: 8px 16px;
  text-align: left;
  font-size: .75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
}

.file-table td {
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  vertical-align: middle;
}

.file-table tr:hover td { background: var(--green-50); }

.filename {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

.filesize { color: var(--text-muted); font-size: .8rem; }

.actions-col { width: 200px; }

.file-actions { display: flex; gap: 6px; align-items: center; }

.empty-folder {
  padding: 16px;
  color: var(--text-muted);
  font-size: .875rem;
  font-style: italic;
}

.folder-upload {
  padding: 10px 16px;
  border-top: 1px dashed var(--border);
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-icon { font-size: 3rem; margin-bottom: 12px; }

/* ── Status indicator ──────────────────────────────────────────────────────── */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  display: inline-block;
}
.status-dot.connected    { background: #22c55e; box-shadow: 0 0 6px #22c55e; }
.status-dot.connecting   { background: #f59e0b; }
.status-dot.disconnected { background: var(--text-muted); }

.status-text { font-size: .85rem; color: var(--text-muted); }

.terminal-info {
  background: var(--green-50);
  border: 1px solid var(--green-100);
  border-radius: 8px;
  padding: 10px 16px;
  margin-bottom: 16px;
  font-size: .875rem;
  color: var(--text-muted);
}
.terminal-info code {
  background: var(--white);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: monospace;
  font-size: .875rem;
  color: var(--green-800);
}

/* ── Terminal ──────────────────────────────────────────────────────────────── */
.terminal-container {
  flex: 1;
  background: #1e1e1e;
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  min-height: 500px;
  display: flex;
  flex-direction: column;
}

.connect-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(30,30,30,.95);
  z-index: 10;
}

#xterm-mount {
  flex: 1;
  padding: 8px;
}

.xterm { height: 100%; }

/* ── Modal ─────────────────────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 100;
}

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 101;
  width: 380px;
}

.modal-box {
  background: var(--white);
  border-radius: 12px;
  padding: 28px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}

.modal-box h3 { margin-bottom: 8px; font-size: 1.1rem; }
.modal-box p  { color: var(--text-muted); font-size: .9rem; margin-bottom: 20px; word-break: break-all; }

.modal-actions { display: flex; gap: 8px; }
