/* ============================================================
   ADMIN DASHBOARD CSS - Residencial Chã de Pedra
   ============================================================ */
:root {
  --purple-900: #4C1D95;
  --purple-800: #5B21B6;
  --purple-700: #6D28D9;
  --purple-600: #7C3AED;
  --purple-500: #8B5CF6;
  --purple-100: #EDE9FE;
  --purple-50:  #F5F3FF;
  --dark:       #1A0A2E;
  --text:       #374151;
  --text-light: #6B7280;
  --white:      #FFFFFF;
  --gray-50:    #F9FAFB;
  --gray-100:   #F3F4F6;
  --gray-200:   #E5E7EB;
  --success:    #10B981;
  --danger:     #EF4444;
  --warning:    #F59E0B;
  --info:       #3B82F6;
  --sidebar-w:  260px;
  --font:       'Jost', sans-serif;
  --font-serif: 'Cormorant Garamond', Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font); color: var(--text); background: var(--gray-50); }
a    { text-decoration: none; color: inherit; }
img  { max-width: 100%; }

/* ---- LAYOUT ---- */
.admin-body   { display: flex; min-height: 100vh; }
.admin-main   { flex: 1; margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-height: 100vh; }
.admin-content{ flex: 1; padding: 32px; }

/* ---- SIDEBAR ---- */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--dark);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  z-index: 100;
}

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

.sidebar-brand-inner {
  display: flex; align-items: center; gap: 10px;
}

.sidebar-brand-icon {
  width: 38px; height: 38px;
  background: var(--purple-700);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 16px;
}

.sidebar-brand-name { font-family: var(--font-serif); font-size: 16px; font-weight: 700; color: white; line-height: 1.1; }
.sidebar-brand-sub  { font-size: 9px; letter-spacing: 2px; color: rgba(255,255,255,.4); text-transform: uppercase; }

.sidebar-section-title {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255,255,255,.3);
  padding: 20px 20px 8px;
}

.sidebar-menu { padding: 0 12px; }

.sidebar-item a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13.5px;
  color: rgba(255,255,255,.6);
  transition: all .25s;
  margin-bottom: 2px;
}

.sidebar-item a i {
  width: 20px;
  text-align: center;
  font-size: 14px;
}

.sidebar-item a:hover,
.sidebar-item.active a {
  background: rgba(124,58,237,.25);
  color: white;
}

.sidebar-item.active a { font-weight: 600; }

.sidebar-item a .badge-num {
  margin-left: auto;
  background: var(--danger);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  min-width: 20px;
  text-align: center;
}

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

.sidebar-footer a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  color: rgba(255,255,255,.5);
  font-size: 13px;
  transition: all .25s;
}

.sidebar-footer a:hover { background: rgba(255,255,255,.07); color: white; }

/* ---- TOPBAR ---- */
.admin-topbar {
  background: white;
  border-bottom: 1px solid var(--gray-200);
  padding: 0 32px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-left h2 { font-family: var(--font-serif); font-size: 20px; color: var(--dark); }
.topbar-right   { display: flex; align-items: center; gap: 16px; }

.topbar-notif {
  position: relative;
  width: 38px; height: 38px;
  background: var(--gray-100);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-light);
  cursor: pointer;
}

.topbar-notif .dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 8px; height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid white;
}

.topbar-user {
  display: flex; align-items: center; gap: 10px;
  cursor: pointer;
}

.topbar-avatar {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--purple-700), var(--purple-500));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: white;
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 700;
}

.topbar-user-info strong { font-size: 13px; color: var(--dark); display: block; }
.topbar-user-info span   { font-size: 11px; color: var(--text-light); }

/* ---- PAGE HEADER ---- */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 16px;
}

.page-title { font-family: var(--font-serif); font-size: 28px; color: var(--dark); }
.page-sub   { font-size: 13.5px; color: var(--text-light); margin-top: 4px; }

/* ---- STAT CARDS ---- */
.stats-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  background: white;
  border-radius: 16px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
  border: 1px solid var(--gray-200);
  position: relative;
  overflow: hidden;
  transition: all .3s;
}

.stat-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,.08); }

.stat-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.stat-num { font-family: var(--font-serif); font-size: 24px; font-weight: 700; line-height: 1; }
.stat-lbl { font-size: 12px; color: var(--text-light); margin-top: 4px; }

.stat-purple .stat-icon { background: var(--purple-100); color: var(--purple-700); }
.stat-purple .stat-num  { color: var(--purple-700); }
.stat-green  .stat-icon { background: #D1FAE5; color: var(--success); }
.stat-green  .stat-num  { color: var(--success); }
.stat-orange .stat-icon { background: #FEF3C7; color: var(--warning); }
.stat-orange .stat-num  { color: var(--warning); }
.stat-blue   .stat-icon { background: #DBEAFE; color: var(--info); }
.stat-blue   .stat-num  { color: var(--info); }
.stat-red    .stat-icon { background: #FEE2E2; color: var(--danger); }
.stat-red    .stat-num  { color: var(--danger); }
.stat-teal   .stat-icon { background: #CCFBF1; color: #0D9488; }
.stat-teal   .stat-num  { color: #0D9488; }

.stat-trend {
  position: absolute;
  right: 16px; top: 50%;
  transform: translateY(-50%);
  color: var(--gray-200);
  font-size: 20px;
}

/* ---- ADMIN CARDS ---- */
.admin-card {
  background: white;
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
  border: 1px solid var(--gray-200);
  overflow: hidden;
  margin-bottom: 24px;
}

.admin-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--gray-100);
}

.admin-card-header h3 {
  font-family: var(--font-serif);
  font-size: 18px;
  color: var(--dark);
}

.admin-card-body { padding: 24px; }

.admin-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

/* ---- TABLE ---- */
.table-responsive { overflow-x: auto; }

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.admin-table th {
  background: var(--gray-50);
  color: var(--text-light);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 12px 20px;
  text-align: left;
  white-space: nowrap;
}

.admin-table td {
  padding: 14px 20px;
  border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
}

.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--purple-50); }

/* ---- BADGES ---- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
}

.badge-purple  { background: var(--purple-100); color: var(--purple-700); }
.badge-success { background: #D1FAE5; color: #065F46; }
.badge-danger  { background: #FEE2E2; color: #991B1B; }
.badge-warning { background: #FEF3C7; color: #92400E; }
.badge-gray    { background: var(--gray-100); color: var(--text-light); }
.badge-blue    { background: #DBEAFE; color: #1E40AF; }

/* ---- BUTTONS ---- */
.btn-admin {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  font-family: var(--font);
  transition: all .25s;
}

.btn-admin-primary {
  background: var(--purple-700);
  color: white;
}

.btn-admin-primary:hover {
  background: var(--purple-800);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(109,40,217,.3);
  color: white;
}

.btn-admin-outline {
  background: white;
  color: var(--purple-700);
  border: 1.5px solid var(--purple-300);
}

.btn-admin-outline:hover {
  background: var(--purple-50);
  color: var(--purple-700);
}

.btn-admin-danger {
  background: #FEE2E2;
  color: var(--danger);
}

.btn-admin-danger:hover { background: var(--danger); color: white; }

.btn-admin-sm {
  padding: 6px 14px;
  font-size: 12px;
  border-radius: 8px;
}

/* ---- QUICK ACTIONS ---- */
.quick-actions { padding: 8px 0; }

.quick-action {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 24px;
  font-size: 13.5px;
  color: var(--text);
  border-bottom: 1px solid var(--gray-100);
  transition: all .25s;
}

.quick-action:last-child { border-bottom: none; }

.quick-action i:first-child {
  width: 36px; height: 36px;
  background: var(--purple-50);
  color: var(--purple-600);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}

.quick-action span { flex: 1; font-weight: 500; }

.quick-action .arrow { color: var(--gray-200); font-size: 12px; }

.quick-action:hover {
  background: var(--purple-50);
  padding-left: 28px;
}

.quick-action:hover .arrow { color: var(--purple-500); }

/* ---- FORMS ---- */
.admin-form { max-width: 860px; }
.form-row    { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.form-full   { grid-column: span 2; }

.admin-form label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: 7px;
}

.admin-form input,
.admin-form select,
.admin-form textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: 10px;
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  background: var(--gray-50);
  transition: all .25s;
}

.admin-form input:focus,
.admin-form select:focus,
.admin-form textarea:focus {
  outline: none;
  border-color: var(--purple-500);
  background: white;
  box-shadow: 0 0 0 3px rgba(139,92,246,.1);
}

.admin-form textarea { min-height: 120px; resize: vertical; }

/* ---- STATUS TOGGLE ---- */
.toggle {
  position: relative;
  display: inline-flex;
  width: 44px; height: 24px;
}

.toggle input { opacity: 0; width: 0; height: 0; }

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--gray-200);
  border-radius: 24px;
  cursor: pointer;
  transition: .3s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  background: white;
  border-radius: 50%;
  bottom: 3px; left: 3px;
  transition: .3s;
}

.toggle input:checked + .toggle-slider { background: var(--purple-600); }
.toggle input:checked + .toggle-slider::before { transform: translateX(20px); }

/* ---- PAGINATION ---- */
.pagination {
  display: flex;
  gap: 6px;
  justify-content: center;
  padding: 20px;
}

.pagination a, .pagination span {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  border: 1.5px solid var(--gray-200);
  color: var(--text);
  transition: all .25s;
}

.pagination a:hover    { border-color: var(--purple-500); color: var(--purple-700); }
.pagination .current   { background: var(--purple-700); color: white; border-color: var(--purple-700); }

/* ---- SEARCH BAR ---- */
.search-bar {
  position: relative;
  flex: 1;
}

.search-bar input {
  width: 100%;
  padding: 10px 16px 10px 40px;
  border: 1.5px solid var(--gray-200);
  border-radius: 10px;
  font-size: 14px;
  font-family: var(--font);
  background: var(--gray-50);
}

.search-bar input:focus {
  outline: none;
  border-color: var(--purple-400);
  background: white;
}

.search-bar i {
  position: absolute;
  left: 14px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
}

/* ---- FILTERS ---- */
.filters {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  align-items: center;
}

/* ---- ALERT ---- */
.admin-alert {
  padding: 14px 18px;
  border-radius: 10px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}

.admin-alert-success { background: #D1FAE5; color: #065F46; }
.admin-alert-danger  { background: #FEE2E2; color: #991B1B; }
.admin-alert-info    { background: #DBEAFE; color: #1E40AF; }

/* ---- LOGIN ---- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--dark) 0%, var(--purple-900) 100%);
}

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

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

@media (max-width: 768px) {
  .admin-main   { margin-left: 0; }
  .sidebar      { transform: translateX(-100%); transition: transform .3s; }
  .sidebar.open { transform: translateX(0); }
  .admin-content{ padding: 20px; }
  .form-row     { grid-template-columns: 1fr; }
  .form-full    { grid-column: 1; }
}
