/* Admin Panel Styles */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }

body {
  font-family: 'Inter', sans-serif;
  background: #F4F6F9;
  color: #1A1A2E;
  min-height: 100vh;
}

/* Login Page */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #0D1B3E 0%, #1B2B5E 60%, #C8102E 100%);
  padding: 20px;
}

.login-card {
  background: white;
  border-radius: 20px;
  padding: 48px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 32px 80px rgba(0,0,0,0.3);
}

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

.login-logo img {
  max-height: 56px;
  object-fit: contain;
}

.login-title {
  font-size: 22px;
  font-weight: 700;
  color: #0D1B3E;
  text-align: center;
  margin-bottom: 6px;
}

.login-sub {
  font-size: 13px;
  color: #888;
  text-align: center;
  margin-bottom: 32px;
}

.login-group { margin-bottom: 18px; }

.login-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #444;
  margin-bottom: 6px;
}

.login-input {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid #DDD;
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: all 0.3s;
  background: #FAFAFA;
}

.login-input:focus {
  border-color: #1B2B5E;
  background: white;
  box-shadow: 0 0 0 3px rgba(27,43,94,0.08);
}

.login-error {
  display: none;
  font-size: 12px;
  color: #C8102E;
  text-align: center;
  margin-top: 12px;
  padding: 10px;
  background: rgba(200,16,46,0.08);
  border-radius: 8px;
}

.login-btn {
  width: 100%;
  padding: 14px;
  background: #C8102E;
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  margin-top: 8px;
  transition: all 0.3s;
}

.login-btn:hover {
  background: #E8334A;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(200,16,46,0.35);
}

/* Admin Layout */
.admin-layout { display: flex; min-height: 100vh; }

/* Sidebar */
.admin-sidebar {
  width: 250px;
  min-width: 250px;
  background: #0D1B3E;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; bottom: 0; left: 0;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-logo { display: flex; align-items: center; gap: 10px; }
.sidebar-logo img { height: 36px; object-fit: contain; filter: brightness(0) invert(1); }
.sidebar-logo-text { font-size: 11px; font-weight: 600; color: rgba(255,255,255,0.7); line-height: 1.4; letter-spacing: 0.05em; }

.sidebar-nav { flex: 1; padding: 16px 12px; }

.sidebar-section-label {
  font-size: 10px; font-weight: 700; color: rgba(255,255,255,0.3);
  letter-spacing: 0.12em; text-transform: uppercase; padding: 12px 8px 6px;
}

.sidebar-link {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 8px;
  color: rgba(255,255,255,0.65); text-decoration: none;
  font-size: 14px; font-weight: 500; transition: all 0.25s;
  margin-bottom: 2px; cursor: pointer; border: none;
  background: none; width: 100%; text-align: left;
}

.sidebar-link:hover, .sidebar-link.active {
  background: rgba(255,255,255,0.1); color: white;
}
.sidebar-link.active { background: rgba(200,16,46,0.2); color: #FF8A8A; }
.sidebar-link .icon { font-size: 16px; }

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

.logout-btn {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 8px;
  color: rgba(255,255,255,0.5); font-size: 14px; cursor: pointer;
  transition: all 0.25s; background: none; border: none;
  font-family: inherit; width: 100%;
}
.logout-btn:hover { background: rgba(200,16,46,0.15); color: #FF8A8A; }

/* Main Content */
.admin-main { flex: 1; margin-left: 250px; display: flex; flex-direction: column; }

.admin-topbar {
  background: white; padding: 0 32px; height: 64px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid rgba(0,0,0,0.08);
  position: sticky; top: 0; z-index: 50; flex-wrap: wrap; gap: 8px;
}

.topbar-title { font-size: 17px; font-weight: 700; color: #0D1B3E; }
.topbar-right { display: flex; align-items: center; gap: 16px; }

.topbar-badge {
  background: rgba(200,16,46,0.1); color: #C8102E;
  padding: 4px 12px; border-radius: 50px; font-size: 12px; font-weight: 600;
}

.admin-content { flex: 1; padding: 32px; }
.admin-view { display: none; }
.admin-view.active { display: block; }

/* Stats Cards */
.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px; margin-bottom: 32px;
}

.stat-widget {
  background: white; border-radius: 14px; padding: 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06); border: 1px solid rgba(0,0,0,0.05);
  transition: all 0.3s;
}
.stat-widget:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,0.1); }
.stat-widget-icon { font-size: 28px; margin-bottom: 12px; }
.stat-widget-value { font-size: 32px; font-weight: 700; color: #0D1B3E; line-height: 1; margin-bottom: 6px; }
.stat-widget-label { font-size: 13px; color: #888; }

/* Charts */
.charts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 32px; }

.chart-card {
  background: white; border-radius: 14px; padding: 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.chart-title { font-size: 15px; font-weight: 700; color: #0D1B3E; margin-bottom: 20px; }

/* Bar chart */
.bar-chart {
  display: flex; align-items: flex-end; gap: 8px; height: 180px; padding: 0 4px;
}
.bar-item {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; gap: 4px; height: 100%; justify-content: flex-end;
}
.bar-fill {
  width: 100%; background: linear-gradient(180deg, #C8102E, #E8334A);
  border-radius: 4px 4px 0 0; transition: height 0.8s ease; min-height: 4px;
}
.bar-label { font-size: 10px; color: #888; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60px; }
.bar-value { font-size: 10px; font-weight: 700; color: #0D1B3E; }

/* Donut Chart */
.donut-wrapper { display: flex; align-items: center; gap: 24px; }
.donut-legend { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.donut-legend-item { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #555; }
.donut-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

/* Table */
.table-card { background: white; border-radius: 14px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); overflow: hidden; }

.table-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px; border-bottom: 1px solid rgba(0,0,0,0.07); flex-wrap: wrap; gap: 12px;
}
.table-title { font-size: 16px; font-weight: 700; color: #0D1B3E; }
.table-actions { display: flex; gap: 10px; align-items: center; }

.table-search {
  padding: 8px 14px; border: 1.5px solid #DDD; border-radius: 8px;
  font-size: 13px; font-family: inherit; outline: none; width: 220px; transition: all 0.3s;
}
.table-search:focus { border-color: #1B2B5E; }

.btn-export {
  padding: 8px 16px; background: #0D1B3E; color: white; border: none;
  border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer;
  font-family: inherit; transition: all 0.3s;
}
.btn-export:hover { background: #1B2B5E; }

.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
  padding: 12px 16px; text-align: left; font-size: 11px; font-weight: 700;
  color: #888; text-transform: uppercase; letter-spacing: 0.08em;
  background: #FAFAFA; border-bottom: 1px solid rgba(0,0,0,0.07); white-space: nowrap;
}
.data-table td {
  padding: 14px 16px; border-bottom: 1px solid rgba(0,0,0,0.05);
  color: #333; vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #F8F9FF; }
.td-company { font-weight: 600; color: #0D1B3E; }
.td-email a { color: #1B2B5E; text-decoration: none; }
.td-email a:hover { text-decoration: underline; }
.td-date { color: #888; font-size: 12px; }

.tag-small {
  display: inline-block; background: rgba(200,16,46,0.08); color: #C8102E;
  padding: 2px 8px; border-radius: 50px; font-size: 10px; font-weight: 600; margin: 2px;
}

.empty-state { text-align: center; padding: 60px 20px; color: #888; }
.empty-state-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state-text { font-size: 15px; }

.btn-view {
  padding: 5px 12px; background: rgba(27,43,94,0.08); color: #1B2B5E;
  border: none; border-radius: 6px; font-size: 12px; font-weight: 600;
  cursor: pointer; font-family: inherit; transition: all 0.25s;
}
.btn-view:hover { background: rgba(27,43,94,0.15); }

/* Detail Modal */
.detail-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  z-index: 999; display: flex; align-items: center; justify-content: center;
  padding: 20px; opacity: 0; visibility: hidden; transition: all 0.3s;
}
.detail-modal-overlay.show { opacity: 1; visibility: visible; }
.detail-modal {
  background: white; border-radius: 16px; padding: 32px;
  max-width: 640px; width: 100%; max-height: 80vh; overflow-y: auto;
  transform: scale(0.9); transition: transform 0.3s;
}
.detail-modal-overlay.show .detail-modal { transform: scale(1); }
.detail-modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.detail-modal-title { font-size: 18px; font-weight: 700; color: #0D1B3E; }
.detail-close {
  width: 32px; height: 32px; background: #F0F0F0; border: none;
  border-radius: 50%; cursor: pointer; font-size: 16px; display: flex;
  align-items: center; justify-content: center; transition: background 0.2s;
}
.detail-close:hover { background: #E0E0E0; }
.detail-row { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid rgba(0,0,0,0.06); }
.detail-row:last-child { border-bottom: none; }
.detail-key { font-size: 12px; font-weight: 700; color: #888; min-width: 140px; padding-top: 2px; }
.detail-val { font-size: 14px; color: #333; flex: 1; line-height: 1.5; }

.section-heading { font-size: 20px; font-weight: 700; color: #0D1B3E; margin-bottom: 20px; }

/* Responsive */
@media (max-width: 900px) {
  .admin-sidebar { transform: translateX(-100%); transition: transform 0.3s; }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-main { margin-left: 0; }
  .charts-grid { grid-template-columns: 1fr; }
}
