/* ============================================
   SELLMER SOLUTIONS – GLÄUBIGERPORTAL
   ============================================ */

:root {
  --highlight: #B4975A;
  --highlight-dark: #9a7f49;
  --dark: #303133;
  --white: #FFFFFF;
  --light-gray: #f5f5f3;
  --medium-gray: #999;
  --border: #e2e2e0;
  --danger: #ef4444;
  --success: #22c55e;
  --info: #3b82f6;
  --warning: #f59e0b;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 20px rgba(0,0,0,0.04);
  --shadow-lg: 0 12px 35px rgba(0,0,0,0.08);
  --transition: 0.25s ease;
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Source Sans 3', 'Segoe UI', sans-serif; font-size: 15px; color: var(--dark); background: var(--light-gray); line-height: 1.6; min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--highlight); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--highlight-dark); }
img { max-width: 100%; height: auto; }
h1, h2, h3 { font-family: 'Montserrat', sans-serif; }

/* ===== PORTAL HEADER ===== */
.portal-header { background: var(--dark); border-bottom: 3px solid var(--highlight); position: sticky; top: 0; z-index: 100; }
.portal-header-inner { max-width: 1280px; margin: 0 auto; padding: 0 2rem; display: flex; align-items: center; justify-content: space-between; height: 64px; }
.portal-logo { display: flex; align-items: center; gap: 1rem; }
.portal-logo img { height: 36px; width: auto; }
.portal-label { font-family: 'Montserrat', sans-serif; font-size: 0.75rem; font-weight: 600; color: var(--highlight); text-transform: uppercase; letter-spacing: 0.12em; background: rgba(180,151,90,0.12); padding: 0.2rem 0.7rem; border-radius: 4px; }
.portal-nav { display: flex; gap: 0.3rem; }
.portal-nav a { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0.9rem; border-radius: var(--radius-sm); font-family: 'Montserrat', sans-serif; font-size: 0.82rem; font-weight: 600; color: rgba(255,255,255,0.6); transition: all var(--transition); }
.portal-nav a:hover { color: white; background: rgba(255,255,255,0.08); }
.portal-nav a.active { color: var(--highlight); background: rgba(180,151,90,0.12); }
.portal-user { display: flex; align-items: center; gap: 1rem; }
.portal-user-name { font-size: 0.85rem; color: rgba(255,255,255,0.5); }
.portal-logout { display: flex; align-items: center; gap: 0.4rem; font-size: 0.82rem; font-weight: 600; color: rgba(255,255,255,0.4); }
.portal-logout:hover { color: var(--danger); }
.portal-hamburger { display: none; background: none; border: none; cursor: pointer; padding: 0.5rem; }
.portal-hamburger span { display: block; width: 20px; height: 2px; background: rgba(255,255,255,0.6); margin: 4px 0; border-radius: 2px; transition: var(--transition); }

/* ===== MAIN ===== */
.portal-main { flex: 1; padding: 2rem 0; }
.portal-container { max-width: 1280px; margin: 0 auto; padding: 0 2rem; }

/* ===== FOOTER ===== */
.portal-footer { background: var(--dark); padding: 1.2rem 2rem; display: flex; align-items: center; justify-content: space-between; font-size: 0.82rem; color: rgba(255,255,255,0.35); }
.portal-footer-links { display: flex; gap: 1.5rem; }
.portal-footer-links a { color: rgba(255,255,255,0.35); }
.portal-footer-links a:hover { color: var(--highlight); }

/* ===== FLASH MESSAGES ===== */
.flash { display: flex; align-items: center; gap: 0.8rem; padding: 1rem 1.3rem; border-radius: var(--radius-sm); margin-bottom: 1.5rem; font-weight: 500; font-size: 0.95rem; }
.flash svg { flex-shrink: 0; }
.flash-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }
.flash-success svg { color: var(--success); }
.flash-error { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.flash-error svg { color: var(--danger); }

/* ===== BUTTONS ===== */
.btn { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.65rem 1.3rem; border-radius: var(--radius-sm); font-family: 'Montserrat', sans-serif; font-size: 0.85rem; font-weight: 600; border: none; cursor: pointer; transition: all var(--transition); text-decoration: none; white-space: nowrap; }
.btn-primary { background: var(--highlight); color: white; box-shadow: 0 4px 15px rgba(180,151,90,0.25); }
.btn-primary:hover { background: var(--highlight-dark); color: white; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(180,151,90,0.35); }
.btn-secondary { background: white; color: var(--dark); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--highlight); color: var(--highlight); }
.btn-full { width: 100%; justify-content: center; padding: 0.85rem; }
.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.78rem; }

/* ===== AUTH PAGES ===== */
.auth-page { display: flex; justify-content: center; padding: 2rem 0; }
.auth-card { background: white; border-radius: var(--radius); box-shadow: var(--shadow-lg); max-width: 700px; width: 100%; overflow: hidden; }
.auth-card-narrow { max-width: 440px; }
.auth-card-header { background: var(--dark); padding: 2rem 2.5rem; }
.auth-card-header h1 { color: white; font-size: 1.5rem; font-weight: 800; }
.auth-card-header p { color: rgba(255,255,255,0.5); font-size: 0.9rem; margin-top: 0.3rem; }
.auth-form { padding: 2rem 2.5rem; }
.auth-footer { padding: 1.2rem 2.5rem; background: var(--light-gray); font-size: 0.9rem; color: var(--medium-gray); text-align: center; }
.auth-footer a { font-weight: 600; }

/* ===== FORMS ===== */
.form-group { display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 1rem; flex: 1; }
.form-group label { font-family: 'Montserrat', sans-serif; font-size: 0.8rem; font-weight: 600; color: var(--dark); }
.form-group label small { font-weight: 400; color: var(--medium-gray); }
.form-row { display: flex; gap: 1rem; }
.form-row .flex-2 { flex: 2; }
.form-section-title { font-size: 0.85rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--highlight); margin: 1.5rem 0 0.8rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.form-section-title:first-of-type { border-top: none; padding-top: 0; margin-top: 0; }

input[type="text"], input[type="email"], input[type="tel"], input[type="password"],
input[type="number"], input[type="date"], input[type="url"],
select, textarea {
  width: 100%; padding: 0.7rem 0.9rem; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-family: inherit; font-size: 0.92rem; color: var(--dark); background: white;
  transition: all var(--transition); outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--highlight); box-shadow: 0 0 0 3px rgba(180,151,90,0.12); }
textarea { resize: vertical; min-height: 100px; }
.input-disabled { background: var(--light-gray); color: var(--medium-gray); cursor: not-allowed; }
.form-hint { font-size: 0.82rem; color: var(--medium-gray); }

/* ===== FORM CARDS (neue Forderung / Profil) ===== */
.case-form { margin-bottom: 1.5rem; }
.form-card { background: white; border-radius: var(--radius); padding: 2rem; margin-bottom: 1.5rem; box-shadow: var(--shadow); }
.form-card-title { display: flex; align-items: center; gap: 0.7rem; font-size: 1.1rem; font-weight: 700; color: var(--dark); margin-bottom: 1.5rem; padding-bottom: 1rem; border-bottom: 2px solid var(--light-gray); }
.form-card-title svg { color: var(--highlight); }
.form-card-title small { font-size: 0.8rem; font-weight: 400; color: var(--medium-gray); }
.form-actions { display: flex; justify-content: flex-end; gap: 1rem; margin-top: 0.5rem; }

/* ===== FILE UPLOAD ===== */
.file-upload-area { border: 2px dashed var(--border); border-radius: var(--radius); padding: 2.5rem; text-align: center; cursor: pointer; transition: all var(--transition); position: relative; }
.file-upload-area:hover, .file-upload-area.drag-over { border-color: var(--highlight); background: rgba(180,151,90,0.04); }
.file-upload-area svg { color: var(--medium-gray); margin-bottom: 0.8rem; }
.file-upload-area p { color: var(--dark); font-size: 0.95rem; }
.file-upload-area small { color: var(--medium-gray); }
.file-upload-area input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-list { margin-top: 1rem; }
.file-item { display: flex; align-items: center; gap: 0.6rem; padding: 0.6rem 0.8rem; background: var(--light-gray); border-radius: var(--radius-sm); margin-bottom: 0.4rem; font-size: 0.88rem; }
.file-item svg { color: var(--highlight); flex-shrink: 0; }
.file-item small { color: var(--medium-gray); }

/* ===== DASHBOARD ===== */
.dashboard-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2rem; flex-wrap: wrap; gap: 1rem; }
.dashboard-header h1 { font-size: 1.6rem; font-weight: 800; }
.dashboard-header p { color: var(--medium-gray); font-size: 0.95rem; margin-top: 0.2rem; }

/* Stats */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 2rem; }
.stat-card { background: white; border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); border-left: 4px solid var(--border); }
.stat-card.stat-new { border-left-color: var(--info); }
.stat-card.stat-progress { border-left-color: var(--warning); }
.stat-card.stat-done { border-left-color: var(--highlight); }
.stat-number { font-family: 'Montserrat', sans-serif; font-size: 1.5rem; font-weight: 800; color: var(--dark); }
.stat-label { font-size: 0.82rem; color: var(--medium-gray); margin-top: 0.2rem; }

/* Filter */
.filter-bar { background: white; border-radius: var(--radius); padding: 1rem 1.5rem; margin-bottom: 1.5rem; box-shadow: var(--shadow); }
.filter-form { display: flex; gap: 0.8rem; align-items: center; }
.filter-search { display: flex; align-items: center; gap: 0.5rem; flex: 1; background: var(--light-gray); border-radius: var(--radius-sm); padding: 0 0.8rem; }
.filter-search svg { color: var(--medium-gray); flex-shrink: 0; }
.filter-search input { border: none; background: none; padding: 0.65rem 0; width: 100%; font-size: 0.92rem; outline: none; }
.filter-form select { padding: 0.65rem 0.8rem; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 0.88rem; background: white; }

/* Empty State */
.empty-state { text-align: center; padding: 4rem 2rem; background: white; border-radius: var(--radius); box-shadow: var(--shadow); }
.empty-state svg { color: var(--border); margin-bottom: 1.5rem; }
.empty-state h2 { font-size: 1.3rem; font-weight: 700; color: var(--dark); margin-bottom: 0.5rem; }
.empty-state p { color: var(--medium-gray); margin-bottom: 2rem; }

/* Data Table */
.table-wrapper { background: white; border-radius: var(--radius); box-shadow: var(--shadow); overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.data-table thead { background: var(--dark); color: rgba(255,255,255,0.7); }
.data-table th { padding: 0.9rem 1.2rem; text-align: left; font-family: 'Montserrat', sans-serif; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; white-space: nowrap; }
.data-table td { padding: 0.9rem 1.2rem; border-bottom: 1px solid var(--light-gray); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: rgba(180,151,90,0.03); }
.data-table .text-right { text-align: right; }
.data-table small { display: block; color: var(--medium-gray); font-size: 0.8rem; }
.table-count { text-align: right; font-size: 0.82rem; color: var(--medium-gray); margin-top: 0.8rem; }

/* Badges */
.badge { display: inline-block; padding: 0.25rem 0.7rem; border-radius: 20px; font-family: 'Montserrat', sans-serif; font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.badge-new { background: #dbeafe; color: #1d4ed8; }
.badge-progress { background: #fef3c7; color: #92400e; }
.badge-done { background: #dcfce7; color: #166534; }
.badge-cancelled { background: #f3f4f6; color: #6b7280; }

/* ===== DETAIL PAGE ===== */
.page-header { margin-bottom: 2rem; }
.page-header h1 { font-size: 1.5rem; font-weight: 800; }
.page-header h1 small { font-weight: 400; color: var(--medium-gray); font-size: 0.9rem; }
.page-header-row { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.back-link { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.85rem; font-weight: 600; color: var(--highlight); margin-bottom: 0.8rem; }
.back-link:hover svg { transform: translateX(-3px); }
.back-link svg { transition: transform var(--transition); }
.text-muted { color: var(--medium-gray); font-size: 0.88rem; }

.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-bottom: 1.5rem; }
.detail-card { background: white; border-radius: var(--radius); padding: 1.8rem; box-shadow: var(--shadow); }
.detail-card-full { grid-column: 1 / -1; }
.detail-card-title { display: flex; align-items: center; gap: 0.6rem; font-size: 1rem; font-weight: 700; margin-bottom: 1.2rem; padding-bottom: 0.8rem; border-bottom: 2px solid var(--light-gray); }
.detail-card-title svg { color: var(--highlight); }
.detail-card p { color: #555; line-height: 1.7; }
.detail-rows { display: flex; flex-direction: column; }
.detail-row { display: flex; justify-content: space-between; padding: 0.6rem 0; border-bottom: 1px solid var(--light-gray); font-size: 0.92rem; }
.detail-row:last-child { border-bottom: none; }
.detail-row span:first-child { color: var(--medium-gray); }
.detail-row strong { color: var(--dark); }
.detail-row-total { background: rgba(180,151,90,0.06); margin: 0.5rem -1rem 0; padding: 0.8rem 1rem; border-radius: var(--radius-sm); border-bottom: none; }
.detail-row-total strong { color: var(--highlight); font-size: 1.1rem; }

/* Document List */
.doc-list { display: flex; flex-direction: column; gap: 0.5rem; }
.doc-item { display: flex; align-items: center; gap: 0.8rem; padding: 0.8rem 1rem; background: var(--light-gray); border-radius: var(--radius-sm); }
.doc-item svg { color: var(--highlight); flex-shrink: 0; }
.doc-info { flex: 1; }
.doc-info strong { display: block; font-size: 0.9rem; }
.doc-info small { color: var(--medium-gray); font-size: 0.8rem; }

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

@media (max-width: 768px) {
  .portal-header-inner { padding: 0 1rem; }
  .portal-nav { display: none; position: absolute; top: 64px; left: 0; right: 0; background: var(--dark); flex-direction: column; padding: 1rem; border-top: 1px solid rgba(255,255,255,0.1); }
  .portal-nav.active { display: flex; }
  .portal-user { display: none; }
  .portal-hamburger { display: block; }
  .portal-container { padding: 0 1rem; }
  .portal-main { padding: 1.5rem 0; }

  .stats-grid { grid-template-columns: 1fr 1fr; }
  .filter-form { flex-direction: column; }
  .filter-search { width: 100%; }
  .form-row { flex-direction: column; gap: 0; }
  .detail-grid { grid-template-columns: 1fr; }
  .dashboard-header { flex-direction: column; align-items: flex-start; }
  .auth-form { padding: 1.5rem; }
  .auth-card-header { padding: 1.5rem; }
  .form-card { padding: 1.5rem; }
  .form-actions { flex-direction: column; }
  .form-actions .btn { width: 100%; justify-content: center; }

  .data-table { font-size: 0.82rem; }
  .data-table th, .data-table td { padding: 0.7rem 0.8rem; }

  .portal-footer { flex-direction: column; gap: 0.5rem; text-align: center; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
}
