/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --blue:       #1a56db;
  --blue-light: #e8f0fe;
  --blue-dark:  #1240a8;
  --green:      #0a7c42;
  --green-bg:   #e6f4ee;
  --red:        #c0392b;
  --red-bg:     #fdecea;
  --orange:     #d97706;
  --orange-bg:  #fef3c7;
  --gray-50:    #f9fafb;
  --gray-100:   #f3f4f6;
  --gray-200:   #e5e7eb;
  --gray-300:   #d1d5db;
  --gray-500:   #6b7280;
  --gray-700:   #374151;
  --gray-900:   #111827;
  --white:      #ffffff;
  --radius:     8px;
  --radius-lg:  12px;
  --shadow:     0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:  0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
  --shadow-lg:  0 10px 15px rgba(0,0,0,.1), 0 4px 6px rgba(0,0,0,.05);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--gray-50);
  color: var(--gray-900);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===== NAVBAR ===== */
.navbar {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}
.nav-logo { font-size: 20px; }
.nav-title { font-weight: 700; font-size: 16px; color: var(--gray-900); }
.nav-sub { font-size: 11px; color: var(--gray-500); background: var(--gray-100); padding: 2px 6px; border-radius: 4px; }

.nav-links { display: flex; gap: 4px; flex: 1; }
.nav-link {
  padding: 6px 12px;
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--gray-700);
  font-size: 14px;
  font-weight: 500;
  transition: background .15s, color .15s;
}
.nav-link:hover, .nav-link.active { background: var(--blue-light); color: var(--blue); }

.nav-user { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.nav-user-info { font-size: 13px; color: var(--gray-700); }
.nav-role-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.nav-role-badge.client  { background: var(--blue-light); color: var(--blue); }
.nav-role-badge.staff   { background: var(--orange-bg); color: var(--orange); }
.nav-role-badge.admin   { background: var(--red-bg); color: var(--red); }

/* ===== MAIN ===== */
.main-container { flex: 1; max-width: 1100px; margin: 0 auto; padding: 32px 24px; width: 100%; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 18px; border-radius: var(--radius); font-size: 14px; font-weight: 500;
  cursor: pointer; border: none; transition: all .15s; text-decoration: none;
  white-space: nowrap;
}
.btn-primary   { background: var(--blue); color: var(--white); }
.btn-primary:hover { background: var(--blue-dark); }
.btn-outline   { background: transparent; color: var(--gray-700); border: 1px solid var(--gray-300); }
.btn-outline:hover { background: var(--gray-100); }
.btn-danger    { background: var(--red); color: var(--white); }
.btn-danger:hover { background: #a93226; }
.btn-full      { width: 100%; }
.btn-sm        { padding: 6px 12px; font-size: 13px; }

/* ===== HERO ===== */
.hero { text-align: center; padding: 48px 0 32px; }
.hero h1 { font-size: 36px; font-weight: 800; color: var(--gray-900); margin-bottom: 12px; }
.hero-sub { font-size: 18px; color: var(--gray-500); max-width: 600px; margin: 0 auto; }

/* ===== GDPR STATUS GRID ===== */
.gdpr-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
  margin: 32px 0;
}
.status-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  box-shadow: var(--shadow);
}
.status-icon { font-size: 28px; flex-shrink: 0; }
.status-label { font-size: 12px; font-weight: 600; color: var(--gray-500); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 4px; }
.status-value { font-size: 15px; font-weight: 600; margin-bottom: 2px; }
.status-value.active { color: var(--green); }
.status-detail { font-size: 12px; color: var(--gray-500); }

/* ===== DEMO ACCOUNTS ===== */
.demo-section { margin: 40px 0; }
.demo-section h2 { font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.demo-section > p { color: var(--gray-500); margin-bottom: 20px; }
.demo-accounts { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.demo-account {
  background: var(--white);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 20px;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.demo-account:hover { border-color: var(--blue); box-shadow: var(--shadow-md); }
.demo-role {
  display: inline-block;
  font-size: 11px; font-weight: 700;
  padding: 3px 10px; border-radius: 99px;
  text-transform: uppercase; letter-spacing: .8px;
  margin-bottom: 10px;
}
.demo-role.client { background: var(--blue-light); color: var(--blue); }
.demo-role.staff  { background: var(--orange-bg); color: var(--orange); }
.demo-role.admin  { background: var(--red-bg); color: var(--red); }
.demo-name  { font-size: 16px; font-weight: 600; margin-bottom: 2px; }
.demo-email { font-size: 13px; color: var(--gray-500); margin-bottom: 10px; }
.demo-desc  { font-size: 13px; color: var(--gray-700); }

/* ===== ARTICLES GRID ===== */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin: 40px 0;
}
.article-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
}
.article-num {
  font-size: 11px; font-weight: 700; color: var(--blue);
  background: var(--blue-light); display: inline-block;
  padding: 3px 8px; border-radius: 4px; margin-bottom: 10px;
  text-transform: uppercase; letter-spacing: .5px;
}
.article-card h3 { font-size: 15px; font-weight: 600; margin-bottom: 8px; }
.article-card p  { font-size: 13px; color: var(--gray-500); line-height: 1.5; }
.article-card code { background: var(--gray-100); padding: 1px 5px; border-radius: 3px; font-size: 12px; }

/* ===== AUTH ===== */
.auth-container { max-width: 440px; margin: 40px auto; }
.auth-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 36px;
  box-shadow: var(--shadow-md);
}
.auth-card h2 { font-size: 24px; font-weight: 700; margin-bottom: 6px; }
.auth-sub { color: var(--gray-500); font-size: 14px; margin-bottom: 24px; }
.auth-divider { text-align: center; color: var(--gray-500); font-size: 13px; margin: 16px 0; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 500; color: var(--gray-700); margin-bottom: 6px; }
.form-input {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--gray-300); border-radius: var(--radius);
  font-size: 14px; color: var(--gray-900);
  transition: border-color .15s, box-shadow .15s;
  background: var(--white);
}
.form-input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(26,86,219,.15); }
.optional { color: var(--gray-500); font-weight: 400; font-size: 12px; }
.form-actions { display: flex; gap: 10px; margin-top: 20px; }
.consent-box { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 20px; font-size: 13px; color: var(--gray-600); }
.consent-box input { margin-top: 3px; flex-shrink: 0; }

/* ===== ALERTS ===== */
.alert { padding: 12px 16px; border-radius: var(--radius); font-size: 14px; margin-bottom: 16px; }
.alert-error   { background: var(--red-bg); color: var(--red); border: 1px solid #f5c6c2; }
.alert-success { background: var(--green-bg); color: var(--green); border: 1px solid #a7d9bc; }

/* ===== CARDS ===== */
.card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; gap: 12px; flex-wrap: wrap;
}
.card-header h3 { font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ===== PAGE HEADER ===== */
.page-header { display: flex; align-items: center; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.page-header h1 { font-size: 28px; font-weight: 800; }
.gdpr-badge {
  font-size: 12px; font-weight: 600;
  background: var(--blue-light); color: var(--blue);
  padding: 4px 12px; border-radius: 99px;
}

/* ===== PROFILE ===== */
.profile-grid { display: grid; grid-template-columns: 1fr 340px; gap: 20px; }
@media (max-width: 768px) { .profile-grid { grid-template-columns: 1fr; } }

.profile-field {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 0; border-bottom: 1px solid var(--gray-100);
  gap: 16px;
}
.profile-field:last-child { border-bottom: none; }
.field-label { font-size: 13px; color: var(--gray-500); font-weight: 500; flex-shrink: 0; }
.field-value { font-size: 14px; color: var(--gray-900); font-weight: 500; text-align: right; word-break: break-word; }
.field-masked { font-size: 14px; color: var(--gray-400); font-style: italic; }

/* ===== GDPR RIGHTS CARD ===== */
.gdpr-card { border: 2px solid var(--blue-light); }
.gdpr-card h3 { color: var(--blue); margin-bottom: 20px; }
.gdpr-right { padding: 16px 0; border-bottom: 1px solid var(--gray-100); }
.gdpr-right:last-child { border-bottom: none; padding-bottom: 0; }
.gdpr-right-title { font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.gdpr-right p { font-size: 13px; color: var(--gray-500); margin-bottom: 12px; }
.export-buttons { display: flex; gap: 8px; }
.danger-zone .gdpr-right-title { color: var(--red); }

/* ===== DATA INVENTORY ===== */
.inventory-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0; border-bottom: 1px solid var(--gray-100); font-size: 14px;
}
.inventory-item:last-child { border-bottom: none; }

/* ===== BADGES ===== */
.badge {
  font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 99px;
  display: inline-block;
}
.badge-active    { background: var(--green-bg); color: var(--green); }
.badge-sensitive { background: var(--orange-bg); color: var(--orange); }
.badge-info      { background: var(--blue-light); color: var(--blue); }
.badge-admin     { background: var(--red-bg); color: var(--red); }

/* ===== ADMIN TABS ===== */
.admin-tabs { display: flex; gap: 4px; margin-bottom: 20px; border-bottom: 1px solid var(--gray-200); }
.tab-btn {
  padding: 10px 18px; font-size: 14px; font-weight: 500;
  background: none; border: none; cursor: pointer;
  color: var(--gray-500); border-bottom: 2px solid transparent;
  margin-bottom: -1px; transition: all .15s;
}
.tab-btn:hover { color: var(--gray-900); }
.tab-btn.active { color: var(--blue); border-bottom-color: var(--blue); }

/* ===== TABLES ===== */
.table-wrapper { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
  text-align: left; padding: 10px 12px;
  background: var(--gray-50); border-bottom: 2px solid var(--gray-200);
  font-weight: 600; color: var(--gray-700); white-space: nowrap;
}
.data-table td {
  padding: 11px 12px; border-bottom: 1px solid var(--gray-100);
  color: var(--gray-700); vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--gray-50); }
.loading-cell { text-align: center; color: var(--gray-500); padding: 32px !important; }

/* ===== AUDIT META ===== */
.audit-meta {
  display: flex; gap: 20px; flex-wrap: wrap;
  font-size: 12px; color: var(--gray-500);
  background: var(--gray-50); padding: 10px 14px;
  border-radius: var(--radius); margin-bottom: 16px;
}
.masking-notice {
  font-size: 12px; background: var(--orange-bg); color: var(--orange);
  padding: 6px 12px; border-radius: var(--radius); font-weight: 500;
}

/* ===== ACTION BADGES ===== */
.action-read   { background: var(--blue-light); color: var(--blue); }
.action-write  { background: var(--green-bg); color: var(--green); }
.action-delete { background: var(--red-bg); color: var(--red); }

/* ===== DELETE OVERLAY ===== */
.delete-modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 36px;
  max-width: 360px;
  width: 90%;
  text-align: center;
  box-shadow: var(--shadow-lg);
}
.delete-icon { font-size: 40px; margin-bottom: 12px; }
.delete-modal h3 { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.delete-modal p  { font-size: 14px; color: var(--gray-700); margin-bottom: 16px; }
.delete-sub { font-size: 12px; color: var(--gray-500); margin-top: 12px !important; }
.progress-track {
  background: var(--gray-200); height: 8px; border-radius: 99px; overflow: hidden;
}
.progress-bar {
  background: var(--red); height: 100%; border-radius: 99px;
  transition: width .3s ease;
}

/* ===== FOOTER ===== */
.footer { background: var(--white); border-top: 1px solid var(--gray-200); padding: 16px 24px; margin-top: auto; }
.footer-inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; justify-content: space-between;
  font-size: 12px; color: var(--gray-500);
}
