/* EUROMODA 2 — Admin Panel Styles · Navy Blue Design */

:root {
    --sidebar-bg: #1a2542;
    --sidebar-border: #2d3a5c;
    --login-bg-1: #0d1b2e;
    --login-bg-2: #1a2542;
    --login-bg-3: #0d1b2e;
    --primary: #1a4e9e;
    --primary-hover: #2D6BC4;
    --primary-light: rgba(26, 78, 158, 0.1);
    --primary-glow: rgba(26, 78, 158, 0.15);
    --success: #059669;
    --success-hover: #047857;
    --danger: #dc2626;
    --danger-hover: #b91c1c;
    --warning: #d97706;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --border: #DBDBDB;
    --bg-page: #EBF0F7;
    --bg-card: #FFFFFF;
    --bg-card-hover: #F4F7FC;
    --bg-table-head: #f5f7fb;
    --radius-sm: 8px;
    --radius-md: 12px;
    --transition: 0.25s ease;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; padding: 0; font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif; -webkit-font-smoothing: antialiased; }

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }

/* === LOGIN === */
.em-login {
  position: fixed; inset: 0; z-index: 2000;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--login-bg-1) 0%, var(--login-bg-2) 50%, var(--login-bg-3) 100%);
}
.em-login.hidden { display: none; }
.em-login-card {
  background: #fff; border-radius: var(--radius-md); padding: 40px; width: 400px; max-width: 90vw;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.em-login-card h2 { margin: 0 0 8px; font-family: 'Sora', sans-serif; font-size: 1.25rem; font-weight: 700; color: var(--sidebar-bg); }
.em-login-card p { margin: 0 0 24px; font-size: 0.875rem; color: var(--text-secondary); }
.em-login-logo { text-align: center; margin-bottom: 24px; }
.em-login-logo span { font-family: 'Sora', sans-serif; font-size: 1.5rem; font-weight: 700; color: var(--sidebar-bg); letter-spacing: 2px; }
.em-login-logo small { display: block; font-size: 0.7rem; color: var(--text-muted); letter-spacing: 3px; text-transform: uppercase; }
.em-login-back { display: block; text-align: center; margin-top: 16px; font-size: 0.8rem; color: var(--text-secondary); text-decoration: none; transition: color var(--transition); }
.em-login-back:hover { color: var(--primary); }
.em-login-error { color: var(--danger); font-size: 0.8rem; text-align: center; margin-bottom: 12px; min-height: 20px; }

/* === FORM === */
.em-form-group { margin-bottom: 16px; }
.em-form-group label { display: block; font-size: 0.8rem; font-weight: 500; color: #374151; margin-bottom: 4px; }
.em-form-input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 6px;
  font-size: 0.875rem; font-family: 'Plus Jakarta Sans', sans-serif; transition: border-color 0.2s, box-shadow 0.2s;
}
.em-form-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }

/* === BUTTONS === */
.em-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 20px; border: none; border-radius: 6px;
  font-size: 0.875rem; font-weight: 500; font-family: 'Plus Jakarta Sans', sans-serif; cursor: pointer; transition: all 0.2s;
}
.em-btn-primary { background: var(--primary); color: #fff; }
.em-btn-primary:hover { background: var(--primary-hover); }
.em-btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.em-btn-full { width: 100%; }
.em-btn-danger { background: var(--danger); color: #fff; }
.em-btn-danger:hover { background: var(--danger-hover); }
.em-btn-success { background: var(--success); color: #fff; }
.em-btn-success:hover { background: var(--success-hover); }
.em-btn-ghost { background: transparent; color: var(--text-secondary); }
.em-btn-ghost:hover { background: var(--bg-card-hover); }

/* === APP SHELL === */
.em-app { display: none; height: 100vh; overflow: hidden; }
.em-app.active { display: flex; }

/* === SIDEBAR === */
.em-sidebar {
  width: 260px; min-width: 260px; background: var(--sidebar-bg); color: #fff;
  display: flex; flex-direction: column; transition: transform 0.3s; z-index: 100; overflow-y: auto;
}
.em-sidebar-brand { padding: 20px; border-bottom: 1px solid var(--sidebar-border); }
.em-sidebar-brand h3 { margin: 0; font-family: 'Sora', sans-serif; font-size: 1.1rem; font-weight: 700; letter-spacing: 2px; }
.em-sidebar-brand small { display: block; font-size: 0.65rem; color: rgba(255,255,255,0.4); letter-spacing: 3px; text-transform: uppercase; margin-top: 2px; }
.em-sidebar-nav { flex: 1; padding: 12px 0; }
.em-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 20px; color: rgba(255,255,255,0.65); font-size: 0.875rem;
  cursor: pointer; transition: all 0.2s; border-left: 3px solid transparent;
}
.em-nav-item:hover { background: rgba(255,255,255,0.05); color: #fff; }
.em-nav-item.active { background: var(--primary-glow); color: #fff; border-left-color: var(--primary); }
.em-nav-item i { font-size: 1.1rem; width: 20px; text-align: center; }
.em-nav-section { padding: 16px 20px 6px; font-family: 'Sora', sans-serif; font-size: 0.65rem; text-transform: uppercase; letter-spacing: 2px; color: rgba(255,255,255,0.3); }
.em-sidebar-footer { padding: 16px 20px; border-top: 1px solid var(--sidebar-border); }
.em-user-info { display: flex; align-items: center; gap: 10px; }
.em-user-avatar {
  width: 36px; height: 36px; border-radius: 50%; background: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 600; color: #fff;
}
.em-user-details { flex: 1; overflow: hidden; }
.em-user-name { font-size: 0.8rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.em-user-role { font-size: 0.7rem; color: rgba(255,255,255,0.4); }

/* === MAIN === */
.em-main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.em-topbar {
  height: 56px; background: #fff; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 20px; gap: 12px; flex-shrink: 0;
}
.em-hamburger { display: none; background: none; border: none; cursor: pointer; padding: 4px; color: #374151; }
.em-hamburger i { font-size: 1.25rem; }
.em-topbar-title { font-family: 'Sora', sans-serif; font-size: 1rem; font-weight: 600; color: var(--text-primary); }
.em-topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.em-content { flex: 1; overflow-y: auto; overflow-x: hidden; background: var(--bg-page); padding: 24px; }

/* === CARDS / TABLE / BADGES === */
.em-card { background: var(--bg-card); border-radius: var(--radius-sm); border: 1px solid var(--border); margin-bottom: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
.em-card-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.em-card-header h3 { margin: 0; font-family: 'Sora', sans-serif; font-size: 0.9375rem; font-weight: 600; color: var(--text-primary); }
.em-card-body { padding: 20px; }
.em-card-body.no-pad { padding: 0; }
.em-table-wrap { overflow-x: auto; }
.em-table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 0.875rem; }
.em-table th { background: var(--bg-table-head); padding: 10px 16px; text-align: left; font-weight: 500; color: var(--text-secondary); border-bottom: 1px solid var(--border); font-size: 0.8rem; }
.em-table td { padding: 12px 16px; border-bottom: 1px solid #f3f4f6; color: #374151; }
.em-table tr:hover td { background: var(--bg-card-hover); }
.em-badge { display: inline-block; padding: 3px 8px; border-radius: 4px; font-size: 0.75rem; font-weight: 600; }
.em-badge-success { background: #d1fae5; color: #065f46; }
.em-badge-warning { background: #fef3c7; color: #92400e; }
.em-badge-danger { background: #fee2e2; color: #991b1b; }
.em-badge-muted { background: #f3f4f6; color: #6b7280; }

/* === STATS === */
.em-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.em-stat-card { background: var(--bg-card); border-radius: var(--radius-sm); border: 1px solid var(--border); padding: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
.em-stat-value { font-family: 'Sora', sans-serif; font-size: 1.75rem; font-weight: 700; color: var(--text-primary); }
.em-stat-label { font-size: 0.8rem; color: var(--text-secondary); margin-top: 4px; }

/* === MISC === */
.em-loading { display: flex; align-items: center; justify-content: center; padding: 40px; color: var(--text-muted); }
.em-spinner { width: 24px; height: 24px; border: 3px solid #e5e7eb; border-top-color: var(--primary); border-radius: 50%; animation: spin 0.6s linear infinite; margin-right: 10px; }
@keyframes spin { to { transform: rotate(360deg); } }
.em-sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 99; }
.em-sidebar-backdrop.open { display: block; }
.em-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1500; display: flex; align-items: center; justify-content: center; }
.em-modal { background: #fff; border-radius: var(--radius-md); width: 500px; max-width: 90vw; max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.2); }
.em-modal-header { position: sticky; top: 0; background: #fff; padding: 20px 24px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; z-index: 1; }
.em-modal-header h3 { margin: 0; font-family: 'Sora', sans-serif; font-size: 1rem; font-weight: 600; }
.em-modal-close { background: none; border: none; font-size: 1.25rem; cursor: pointer; color: var(--text-secondary); transition: color var(--transition); }
.em-modal-close:hover { color: var(--text-primary); }
.em-modal-body { padding: 24px; }
.em-modal-footer { position: sticky; bottom: 0; background: #fff; padding: 16px 24px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; }

/* === HILFE-DRAWER === */
.em-help-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 45%; max-width: 720px; min-width: 320px;
  background: #fff; box-shadow: -4px 0 24px rgba(0,0,0,0.15);
  display: flex; flex-direction: column; z-index: 1200;
  transform: translateX(100%); transition: transform 0.3s ease;
}
.em-help-drawer.open { transform: translateX(0); }
.em-help-drawer-header {
  display: flex; align-items: center; gap: 10px;
  padding: 0 16px; height: 56px; border-bottom: 1px solid var(--border);
  background: #fff; flex-shrink: 0;
}
.em-help-drawer-header span { font-family: 'Sora', sans-serif; font-size: 0.9rem; font-weight: 600; flex: 1; }
.em-help-drawer iframe { flex: 1; border: none; width: 100%; }
@media (max-width: 768px) {
  .em-help-drawer { width: 100%; max-width: 100%; }
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .em-sidebar { position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-260px); }
  .em-sidebar.open { transform: translateX(0); }
  .em-hamburger { display: flex; }
}
@media (max-width: 640px) {
  .em-content { padding: 16px; }
  .em-modal { width: 100%; max-width: 100%; border-radius: 0; max-height: 100vh; }
}