/* =====================================================
   Bewerbungstracker – Modernes CSS
   Design: Clean, Dark-capable, vollständig responsiv
   ===================================================== */

:root {
  --primary:        #6366f1;
  --primary-dark:   #4f46e5;
  --primary-light:  #e0e7ff;
  --secondary:      #8b5cf6;
  --success:        #22c55e;
  --warning:        #f59e0b;
  --danger:         #ef4444;
  --info:           #3b82f6;

  /* Status-Farben */
  --status-open:       #f59e0b;
  --status-rejected:   #ef4444;
  --status-interview:  #3b82f6;
  --status-offer:      #8b5cf6;
  --status-accepted:   #22c55e;
  --status-withdrawn:  #6b7280;

  /* Hintergrundfarben */
  --bg:             #f8fafc;
  --bg-card:        #ffffff;
  --bg-sidebar:     #1e1b4b;
  --bg-topbar:      #ffffff;

  /* Text */
  --text:           #1e293b;
  --text-muted:     #64748b;
  --text-light:     #94a3b8;
  --text-inverse:   #ffffff;

  /* Rahmen */
  --border:         #e2e8f0;
  --border-focus:   #6366f1;

  /* Schatten */
  --shadow-sm:      0 1px 3px rgba(0,0,0,0.08);
  --shadow:         0 4px 12px rgba(0,0,0,0.10);
  --shadow-lg:      0 10px 30px rgba(0,0,0,0.12);

  /* Layout */
  --sidebar-width:  260px;
  --topbar-height:  64px;
  --radius:         12px;
  --radius-sm:      8px;
  --radius-lg:      16px;
  --transition:     0.2s ease;
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; }
input, select, textarea, button { font-family: inherit; font-size: inherit; }

/* =====================================================
   AUTH PAGES (Login, Passwort vergessen)
   ===================================================== */
.auth-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 1rem;
}
.auth-container { width: 100%; max-width: 420px; }
.auth-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  box-shadow: var(--shadow-lg);
}
.auth-logo { text-align: center; margin-bottom: 2rem; }
.auth-logo-icon { font-size: 3rem; margin-bottom: 0.5rem; }
.auth-logo h1 { font-size: 1.5rem; font-weight: 700; color: var(--text); }
.auth-logo p { color: var(--text-muted); font-size: 0.875rem; margin-top: 0.25rem; }
.auth-form { display: flex; flex-direction: column; gap: 1rem; }
.auth-links { text-align: center; margin-top: 1.25rem; font-size: 0.875rem; color: var(--text-muted); }
.auth-links a { color: var(--primary); font-weight: 500; }

/* =====================================================
   LAYOUT (Sidebar + Main)
   ===================================================== */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-sidebar);
  z-index: 1000;
  overflow-y: auto;
  transition: transform var(--transition);
  display: flex;
  flex-direction: column;
}
.sidebar-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.sidebar-logo-icon { font-size: 1.5rem; }
.sidebar-logo-text { font-size: 1rem; font-weight: 700; color: #fff; flex: 1; }
.sidebar-close { display: none; background: none; border: none; color: rgba(255,255,255,0.6); font-size: 1.25rem; cursor: pointer; }

.sidebar-nav { list-style: none; padding: 0.75rem 0; flex: 1; }
.sidebar-nav li a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  color: rgba(255,255,255,0.7);
  transition: all var(--transition);
  font-size: 0.9rem;
  border-left: 3px solid transparent;
}
.sidebar-nav li a:hover { color: #fff; background: rgba(255,255,255,0.08); }
.sidebar-nav li a.active { color: #fff; background: rgba(255,255,255,0.12); border-left-color: var(--primary); font-weight: 600; }
.sidebar-nav li a.nav-logout { color: rgba(255,100,100,0.8); }
.sidebar-nav li a.nav-logout:hover { color: #ff6b6b; }
.nav-icon { font-size: 1.1rem; min-width: 1.5rem; }
.nav-divider { padding: 0.75rem 1.25rem 0.25rem; }
.nav-divider span { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em; color: rgba(255,255,255,0.3); font-weight: 600; }

/* Main Wrapper */
.main-wrapper {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--topbar-height);
  background: var(--bg-topbar);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  box-shadow: var(--shadow-sm);
}
.topbar-left { display: flex; align-items: center; gap: 1rem; }
.topbar-right { display: flex; align-items: center; gap: 0.75rem; }
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
}
.hamburger span { display: block; width: 22px; height: 2px; background: var(--text); border-radius: 2px; }
.page-title { font-size: 1rem; font-weight: 600; color: var(--text); }

/* User Menu */
.user-menu { position: relative; }
.user-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.75rem;
  cursor: pointer;
  transition: all var(--transition);
}
.user-btn:hover { background: var(--bg); border-color: var(--primary); }
.user-avatar {
  width: 30px; height: 30px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 0.8rem;
}
.user-name { font-weight: 500; font-size: 0.875rem; }
.chevron { font-size: 0.75rem; color: var(--text-muted); }
.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 160px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: none;
  z-index: 200;
}
.user-dropdown.open { display: block; }
.user-dropdown a {
  display: block;
  padding: 0.6rem 1rem;
  color: var(--text);
  font-size: 0.875rem;
}
.user-dropdown a:hover { background: var(--bg); }
.user-dropdown .dropdown-divider { border-top: 1px solid var(--border); margin: 0.25rem 0; }
.dropdown-logout { color: var(--danger) !important; }
.btn-add-top { white-space: nowrap; }

/* Page Content */
.page-content { padding: 1.5rem; flex: 1; }
.flash-container { padding: 0 1.5rem; }

/* Sidebar Overlay (Mobile) */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 999;
}

/* =====================================================
   CARDS
   ===================================================== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}
.card-title { font-size: 0.95rem; font-weight: 600; color: var(--text); margin-bottom: 1rem; }
.card-header-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.card-header-row .card-title { margin-bottom: 0; }
.card-warning { border-left: 4px solid var(--warning); background: #fffbeb; }
.card-danger-section { border-left: 4px solid var(--danger); }
.card-interview { border-left: 4px solid var(--status-interview); }

/* =====================================================
   BUTTONS
   ===================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 0.875rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
}
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn-outline { background: transparent; color: var(--text); border-color: var(--border); }
.btn-outline:hover { background: var(--bg); border-color: var(--primary); color: var(--primary); }
.btn-ghost { background: transparent; color: var(--text-muted); border-color: transparent; }
.btn-ghost:hover { background: var(--bg); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { background: #dc2626; color: #fff; }
.btn-success { background: var(--success); color: #fff; border-color: var(--success); }
.btn-success:hover { background: #16a34a; color: #fff; }
.btn-full { width: 100%; }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.8rem; }
.btn-xs { padding: 0.2rem 0.5rem; font-size: 0.75rem; }
.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  padding: 0.25rem;
  border-radius: 4px;
  transition: background var(--transition);
  color: var(--text-muted);
}
.btn-icon:hover { background: var(--bg); color: var(--text); }
.btn-danger-icon:hover { background: #fee2e2; color: var(--danger); }
.done-active { color: var(--success); background: #dcfce7 !important; }

/* =====================================================
   FORMS
   ===================================================== */
.form-group { display: flex; flex-direction: column; gap: 0.35rem; }
.form-group label { font-weight: 500; font-size: 0.85rem; color: var(--text); }
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="date"],
.form-group input[type="datetime-local"],
.form-group input[type="number"],
.form-group input[type="tel"],
.form-group select,
.form-group textarea,
.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"] {
  width: 100%;
  padding: 0.6rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.auth-form input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}
.form-group textarea { resize: vertical; min-height: 80px; }
.form-group select { cursor: pointer; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1rem; }
.form-group-wide { grid-column: 1 / -1; }
.form-section { margin-bottom: 1.5rem; padding: 1.25rem; background: var(--bg); border-radius: var(--radius); border: 1px solid var(--border); }
.form-section-title { font-size: 0.9rem; font-weight: 600; margin-bottom: 1rem; color: var(--text); }
.form-actions { display: flex; gap: 0.75rem; justify-content: flex-end; margin-top: 1.5rem; flex-wrap: wrap; }
.form-actions-row { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.form-page { max-width: 900px; }
.app-form { display: flex; flex-direction: column; gap: 0; }
.required { color: var(--danger); }

/* Input mit Icon */
.input-icon-wrap { position: relative; display: flex; align-items: center; }
/* Höhere Spezifität damit auth-form nicht überschreibt */
.input-icon-wrap input[type="text"],
.input-icon-wrap input[type="email"],
.input-icon-wrap input[type="password"],
.input-icon-wrap input[type="tel"],
.input-icon-wrap input[type="number"] { padding-left: 2.75rem !important; }
.input-icon {
  position: absolute;
  left: 0.875rem;
  font-size: 1rem;
  pointer-events: none;
  z-index: 1;
  line-height: 1;
  font-style: normal;
  color: var(--text-muted);
  display: flex;
  align-items: center;
}
.input-icon-svg { color: var(--text-muted); }
.pw-toggle {
  position: absolute;
  right: 0.75rem;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-muted);
  z-index: 1;
  padding: 0;
  line-height: 1;
}

/* Checkbox */
.checkbox-label { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; }
.checkbox-label input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--primary); }

/* File Upload */
.file-upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}
.file-upload-zone:hover, .file-upload-zone.drag-over { border-color: var(--primary); background: var(--primary-light); }
.file-input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.file-upload-label { display: flex; flex-direction: column; align-items: center; gap: 0.4rem; pointer-events: none; }
.file-upload-icon { font-size: 2rem; }
.file-upload-label small { color: var(--text-muted); font-size: 0.75rem; }
.file-preview { margin-top: 0.5rem; font-size: 0.875rem; color: var(--primary); }
.attachment-row { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.5rem; flex-wrap: wrap; }
.attachment-row input[type="file"] { flex: 1; min-width: 200px; }
.attachment-row-existing { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.attachment-row-existing span { flex: 1; }
.existing-attachments { margin-bottom: 1rem; }

/* Star Rating */
.star-rating { display: flex; gap: 0.25rem; cursor: pointer; }
.star { font-size: 1.5rem; color: var(--border); transition: color var(--transition); }
.star.active, .star:hover { color: var(--warning); }
.star-display { color: var(--warning); letter-spacing: 2px; }

/* =====================================================
   ALERTS
   ===================================================== */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.alert-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.alert-error   { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-info    { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }
.alert-dismissible button { background: none; border: none; cursor: pointer; font-size: 1rem; color: inherit; opacity: 0.6; }
.alert-dismissible button:hover { opacity: 1; }

/* =====================================================
   BADGES
   ===================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}
.badge-lg { font-size: 0.875rem; padding: 0.3rem 0.9rem; }
.badge-neutral   { background: #f1f5f9; color: var(--text-muted); }
.badge-success   { background: #dcfce7; color: #166534; }
.badge-error     { background: #fee2e2; color: #991b1b; }
.badge-primary   { background: var(--primary-light); color: var(--primary-dark); }
.badge-admin     { background: #fef3c7; color: #92400e; }

/* Status Badge */
.status-open      { background: #fef3c7; color: #92400e; }
.status-rejected  { background: #fee2e2; color: #991b1b; }
.status-interview { background: #dbeafe; color: #1e40af; }
.status-offer     { background: #f3e8ff; color: #6b21a8; }
.status-accepted  { background: #dcfce7; color: #166534; }
.status-withdrawn { background: #f1f5f9; color: var(--text-muted); }

/* Status row bg (Tabelle) */
.row-done td { opacity: 0.6; text-decoration: line-through; }
.row-done td .badge, .row-done td .btn { text-decoration: none; }

/* =====================================================
   TABLES
   ===================================================== */
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.data-table th {
  text-align: left;
  padding: 0.6rem 0.875rem;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
.data-table th a { color: var(--text-muted); font-weight: 600; }
.data-table th a:hover { color: var(--primary); }
.data-table td {
  padding: 0.75rem 0.875rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.data-table tbody tr:hover { background: var(--bg); }
.data-table tbody tr:last-child td { border-bottom: none; }
.actions-cell { white-space: nowrap; }

/* =====================================================
   DASHBOARD
   ===================================================== */
.dashboard-grid { display: flex; flex-direction: column; gap: 1.5rem; }
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-icon { font-size: 1.75rem; margin-bottom: 0.4rem; }
.stat-value { font-size: 2rem; font-weight: 700; line-height: 1; color: var(--text); }
.stat-label { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.25rem; font-weight: 500; }
.stat-open     .stat-value { color: var(--status-open); }
.stat-rejected .stat-value { color: var(--status-rejected); }
.stat-interview .stat-value { color: var(--status-interview); }
.stat-offer    .stat-value { color: var(--status-offer); }
.stat-last30   .stat-value { color: var(--primary); }

.charts-row {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 1rem;
}
.chart-card { padding: 1.25rem; }
.chart-wide { grid-column: auto; }

/* Donut Chart */
.donut-wrap { display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; }
.donut-legend { display: flex; flex-direction: column; gap: 0.4rem; }
.legend-item { display: flex; align-items: center; gap: 0.4rem; font-size: 0.8rem; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.status-open-dot      { background: var(--status-open); }
.status-rejected-dot  { background: var(--status-rejected); }
.status-interview-dot { background: var(--status-interview); }
.status-offer-dot     { background: var(--status-offer); }
.status-accepted-dot  { background: var(--status-accepted); }

/* Interview List */
.interview-list { display: flex; flex-direction: column; gap: 0.75rem; }
.interview-item { display: flex; align-items: center; gap: 1rem; padding: 0.75rem; background: var(--bg); border-radius: var(--radius-sm); flex-wrap: wrap; }
.interview-date-badge {
  min-width: 48px;
  text-align: center;
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 0.4rem;
}
.badge-day { display: block; font-size: 1.25rem; font-weight: 700; line-height: 1; }
.badge-month { display: block; font-size: 0.65rem; text-transform: uppercase; }
.interview-info { flex: 1; min-width: 150px; display: flex; flex-direction: column; gap: 0.1rem; }
.interview-info strong { font-size: 0.9rem; }
.interview-info small { font-size: 0.75rem; color: var(--text-muted); }

/* Reminders */
.reminder-list { display: flex; flex-direction: column; gap: 0.5rem; }
.reminder-item { display: flex; align-items: center; gap: 0.75rem; font-size: 0.875rem; flex-wrap: wrap; }
.reminder-days { background: var(--warning); color: #fff; padding: 0.15rem 0.5rem; border-radius: 20px; font-size: 0.75rem; font-weight: 600; flex-shrink: 0; }

/* Empty state */
.empty-state { text-align: center; padding: 2.5rem 1rem; color: var(--text-muted); }
.empty-icon { font-size: 3rem; margin-bottom: 0.75rem; }
.empty-state p { margin-bottom: 1rem; }

/* =====================================================
   APPLICATIONS LIST
   ===================================================== */
.page-actions-bar {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.filter-form {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
  flex: 1;
}
.filter-input {
  padding: 0.5rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  min-width: 200px;
  flex: 1;
  outline: none;
}
.filter-input:focus { border-color: var(--border-focus); }
.filter-select {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  cursor: pointer;
  outline: none;
}
.view-toggle-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  gap: 0.5rem;
}
.result-count { font-size: 0.875rem; color: var(--text-muted); }
.view-btns { display: flex; gap: 0.25rem; }
.view-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.6rem;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all var(--transition);
  color: var(--text-muted);
}
.view-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Status Dropdown */
.status-dropdown-wrap { position: relative; display: inline-block; }
.status-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 180px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  z-index: 50;
  display: none;
}
.status-menu.open { display: block; }
.status-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.5rem 0.875rem;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--text);
  transition: background var(--transition);
}
.status-menu-item:hover { background: var(--bg); }
.status-menu-item.active { font-weight: 600; color: var(--primary); }

/* Card Grid View */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}
.app-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: transform var(--transition), box-shadow var(--transition);
}
.app-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.app-card.card-done { opacity: 0.6; }
.open-card      { border-top: 3px solid var(--status-open); }
.rejected-card  { border-top: 3px solid var(--status-rejected); }
.interview-card { border-top: 3px solid var(--status-interview); }
.offer-card     { border-top: 3px solid var(--status-offer); }
.accepted-card  { border-top: 3px solid var(--status-accepted); }
.withdrawn-card { border-top: 3px solid var(--status-withdrawn); }
.app-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.5rem; }
.app-card-header h4 { font-size: 1rem; font-weight: 600; color: var(--text); }
.app-card-position { font-size: 0.875rem; color: var(--text-muted); }
.app-card-meta { display: flex; flex-wrap: wrap; gap: 0.5rem; font-size: 0.75rem; color: var(--text-muted); }
.app-card-interview { background: var(--bg); border-radius: var(--radius-sm); padding: 0.4rem 0.6rem; font-size: 0.8rem; }
.app-card-actions { display: flex; gap: 0.5rem; margin-top: auto; flex-wrap: wrap; }

/* =====================================================
   APPLICATION VIEW
   ===================================================== */
.view-page { max-width: 900px; }
.view-actions-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; flex-wrap: wrap; gap: 0.5rem; }
.view-actions-right { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.view-header-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
}
.view-header-card.status-open-border      { border-left: 5px solid var(--status-open); }
.view-header-card.status-rejected-border  { border-left: 5px solid var(--status-rejected); }
.view-header-card.status-interview-border { border-left: 5px solid var(--status-interview); }
.view-header-card.status-offer-border     { border-left: 5px solid var(--status-offer); }
.view-header-card.status-accepted-border  { border-left: 5px solid var(--status-accepted); }
.view-header-card.status-withdrawn-border { border-left: 5px solid var(--status-withdrawn); }
.view-header-main { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 0.75rem; }
.view-company { font-size: 1.5rem; font-weight: 700; }
.view-position { font-size: 1rem; color: var(--text-muted); font-weight: 400; margin-top: 0.25rem; }
.view-header-right { display: flex; flex-direction: column; gap: 0.5rem; align-items: flex-end; flex-shrink: 0; }
.view-meta-row { display: flex; flex-wrap: wrap; gap: 1rem; font-size: 0.85rem; color: var(--text-muted); }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.detail-list { display: grid; grid-template-columns: auto 1fr; gap: 0.4rem 0.75rem; font-size: 0.875rem; align-items: start; }
.detail-list dt { font-weight: 600; color: var(--text-muted); white-space: nowrap; }
.detail-list dd { color: var(--text); }
.notes-content { font-size: 0.875rem; line-height: 1.8; color: var(--text); }

/* Status Quick-Change */
.status-quick-form .status-buttons { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.status-btn {
  padding: 0.4rem 0.85rem;
  border-radius: 20px;
  border: 2px solid transparent;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  transition: all var(--transition);
  opacity: 0.7;
}
.status-btn:hover { opacity: 1; transform: scale(1.03); }
.status-btn-active { opacity: 1 !important; box-shadow: 0 0 0 3px rgba(0,0,0,0.1); transform: scale(1.05); }
.status-btn.status-open      { background: #fef3c7; color: #92400e; border-color: var(--status-open); }
.status-btn.status-rejected  { background: #fee2e2; color: #991b1b; border-color: var(--status-rejected); }
.status-btn.status-interview { background: #dbeafe; color: #1e40af; border-color: var(--status-interview); }
.status-btn.status-offer     { background: #f3e8ff; color: #6b21a8; border-color: var(--status-offer); }
.status-btn.status-accepted  { background: #dcfce7; color: #166534; border-color: var(--status-accepted); }
.status-btn.status-withdrawn { background: #f1f5f9; color: #4b5563; border-color: var(--status-withdrawn); }

/* Attachments */
.attachments-grid { display: flex; flex-direction: column; gap: 0.75rem; }
.attachment-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.875rem;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  flex-wrap: wrap;
}
.attachment-icon { font-size: 2rem; flex-shrink: 0; }
.attachment-info { flex: 1; min-width: 120px; display: flex; flex-direction: column; gap: 0.15rem; }
.attachment-info small { color: var(--text-muted); font-size: 0.75rem; }
.attachment-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }

/* =====================================================
   CALENDAR
   ===================================================== */
.calendar-page { max-width: 1000px; }
.calendar-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.calendar-nav-center { display: flex; align-items: center; gap: 0.75rem; }
.calendar-nav-center h2 { font-size: 1.1rem; font-weight: 600; min-width: 160px; text-align: center; }
.view-switcher { display: flex; gap: 0.25rem; }
.cal-legend { display: flex; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.cal-legend-item { display: flex; align-items: center; gap: 0.35rem; font-size: 0.8rem; color: var(--text-muted); }
.cal-dot { width: 10px; height: 10px; border-radius: 50%; }
.cal-dot-blue   { background: var(--status-interview); }
.cal-dot-green  { background: var(--status-accepted); }
.cal-dot-orange { background: var(--warning); }

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-card);
}
.cal-header-cell {
  padding: 0.75rem 0.5rem;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: var(--bg);
  border-bottom: 2px solid var(--border);
}
.cal-cell {
  min-height: 100px;
  padding: 0.4rem;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  transition: background var(--transition);
}
.cal-cell:nth-child(7n) { border-right: none; }
.cal-cell-empty { background: var(--bg); }
.cal-cell:hover { background: #f8fafc; }
.cal-today { background: var(--primary-light) !important; }
.cal-day-num {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  align-self: flex-start;
}
.cal-today .cal-day-num {
  background: var(--primary);
  color: #fff;
  width: 22px; height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
}
.cal-event {
  display: block;
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 500;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  color: #fff;
}
.cal-event-blue   { background: var(--status-interview); }
.cal-event-green  { background: var(--status-accepted); }
.cal-event-orange { background: var(--warning); }
.cal-more { font-size: 0.65rem; color: var(--text-muted); }
.cal-badge-blue   { background: #dbeafe; color: #1e40af; }
.cal-badge-green  { background: #dcfce7; color: #166534; }
.cal-badge-orange { background: #fef3c7; color: #92400e; }

/* =====================================================
   STATS PAGE
   ===================================================== */
.stats-page { display: flex; flex-direction: column; gap: 1.5rem; }
.stats-charts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 1rem; }
.source-bars { display: flex; flex-direction: column; gap: 0.5rem; }
.source-bar-row { display: flex; align-items: center; gap: 0.5rem; font-size: 0.8rem; }
.source-label { min-width: 100px; color: var(--text-muted); text-overflow: ellipsis; overflow: hidden; white-space: nowrap; }
.source-bar-wrap { flex: 1; height: 8px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.source-bar { height: 100%; background: linear-gradient(90deg, var(--primary), var(--secondary)); border-radius: 4px; transition: width 0.6s ease; }
.source-count { min-width: 2rem; text-align: right; font-weight: 600; }
.mini-bar { height: 6px; background: var(--bg); border-radius: 3px; overflow: hidden; min-width: 80px; }
.mini-bar-fill { height: 100%; border-radius: 3px; }
.status-open-bg      { background: var(--status-open); }
.status-rejected-bg  { background: var(--status-rejected); }
.status-interview-bg { background: var(--status-interview); }
.status-offer-bg     { background: var(--status-offer); }
.status-accepted-bg  { background: var(--status-accepted); }
.status-withdrawn-bg { background: var(--status-withdrawn); }

/* =====================================================
   PROFILE PAGE
   ===================================================== */
.profile-page { display: flex; flex-direction: column; gap: 1.25rem; max-width: 900px; }
.profile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1.25rem; }
.profile-avatar-section { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.profile-avatar-big {
  width: 64px; height: 64px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.5rem;
  font-weight: 700;
  flex-shrink: 0;
}
.profile-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; margin-top: 0.75rem; }
.profile-stats > div { text-align: center; }
.profile-stats strong { display: block; font-size: 1.1rem; font-weight: 700; }
.profile-stats small { font-size: 0.7rem; color: var(--text-muted); }
.profile-form { display: flex; flex-direction: column; gap: 0.875rem; }
.twofa-setup { display: flex; flex-direction: column; gap: 0.875rem; }
.qr-code-wrap { display: flex; justify-content: center; padding: 1rem; background: white; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.qr-code { width: 200px; height: 200px; }
.secret-key { font-size: 0.8rem; text-align: center; color: var(--text-muted); }
.secret-key code { background: var(--bg); padding: 0.2rem 0.4rem; border-radius: 4px; }
.backup-codes-card { border-color: var(--warning); background: #fffbeb; }
.backup-codes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0.5rem; margin: 1rem 0; }
.backup-code {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.75rem;
  font-size: 0.875rem;
  font-family: monospace;
  text-align: center;
  letter-spacing: 0.1em;
}

/* =====================================================
   ADMIN PAGE
   ===================================================== */
.admin-page, .admin-users-page { display: flex; flex-direction: column; gap: 1.25rem; }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 1.25rem; }
.card-wide { grid-column: 1 / -1; }

/* =====================================================
   MODALS
   ===================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.75rem;
  max-width: 450px;
  width: 100%;
  box-shadow: var(--shadow-lg);
}
.modal h3 { font-size: 1.1rem; margin-bottom: 0.75rem; }
.modal p { color: var(--text-muted); font-size: 0.875rem; margin-bottom: 1.25rem; }
.modal-actions { display: flex; gap: 0.75rem; justify-content: flex-end; flex-wrap: wrap; }

/* =====================================================
   TYPOGRAPHY HELPERS
   ===================================================== */
.text-muted { color: var(--text-muted); font-size: 0.8rem; }
.text-center { text-align: center; }
.text-xl { font-size: 1.25rem; }
.tracking-widest { letter-spacing: 0.15em; }

/* =====================================================
   RESPONSIVE – TABLET (max 1024px)
   ===================================================== */
@media (max-width: 1024px) {
  .charts-row { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: repeat(3, 1fr); }
}

/* =====================================================
   RESPONSIVE – MOBILE (max 768px)
   ===================================================== */
@media (max-width: 768px) {
  :root { --sidebar-width: 0px; }

  .sidebar {
    transform: translateX(-260px);
    width: 260px;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-close { display: block; }
  .sidebar-overlay.open { display: block; }

  .main-wrapper { margin-left: 0; }
  .hamburger { display: flex; }
  .page-title { font-size: 0.9rem; }
  .btn-add-top { display: none; }
  .user-name { display: none; }

  .page-content { padding: 1rem; }
  .flash-container { padding: 0 1rem; }

  .stats-row { grid-template-columns: repeat(3, 1fr); gap: 0.75rem; }
  .stat-card { padding: 0.875rem 0.5rem; }
  .stat-value { font-size: 1.5rem; }

  .form-grid { grid-template-columns: 1fr; }
  .form-group-wide { grid-column: auto; }

  .page-actions-bar { flex-direction: column; align-items: stretch; }
  .filter-form { flex-direction: column; }
  .filter-input, .filter-select { width: 100%; }

  .cards-grid { grid-template-columns: 1fr; }

  .view-header-main { flex-direction: column; }
  .view-header-right { align-items: flex-start; }
  .detail-grid { grid-template-columns: 1fr; }

  .calendar-grid { font-size: 0.7rem; }
  .cal-cell { min-height: 60px; padding: 0.25rem; }
  .cal-event { font-size: 0.6rem; }

  .profile-stats { grid-template-columns: repeat(2, 1fr); }
  .profile-grid { grid-template-columns: 1fr; }

  .admin-grid { grid-template-columns: 1fr; }
  .data-table { font-size: 0.8rem; }
  .data-table th, .data-table td { padding: 0.5rem; }
}

@media (max-width: 480px) {
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .auth-card { padding: 1.75rem 1.25rem; }
  .modal { padding: 1.25rem; }
  .calendar-nav { flex-direction: column; align-items: center; }
  .stats-charts-grid { grid-template-columns: 1fr; }
}

/* =====================================================
   PRINT STYLES (Backup Codes)
   ===================================================== */
@media print {
  .sidebar, .topbar, .view-actions-bar, .btn, .alert { display: none !important; }
  .main-wrapper { margin: 0; }
  .backup-codes-card { border: 2px solid #000; background: #fff !important; color: #000 !important; }
  .backup-code { border: 1px solid #000; }
}
