/* =============================================
   AVES CORRAL GRANDE — v1
   ============================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #f5f6fa;
  --surface:   #ffffff;
  --border:    #e8ecf0;
  --border-lt: #f0f2f5;
  --accent:    #c24f7a;
  --accent-dk: #9e3460;
  --accent-lt: #fce8f0;
  --accent-xlt:#fef5f8;
  --text:      #1a1f36;
  --text-2:    #4a5568;
  --text-3:    #8a96a8;
  --green:     #0d9f6e;
  --green-lt:  #e6f9f3;
  --orange:    #e07b1f;
  --orange-lt: #fff4e6;
  --red:       #e03535;
  --red-lt:    #fef0f0;
  --blue:      #2563eb;
  --blue-lt:   #eff6ff;
  --purple:    #7c3aed;
  --purple-lt: #f5f3ff;
  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
  --shadow:    0 2px 12px rgba(0,0,0,.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.12);
  --sidebar-w: 240px;
}

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  font-size: 14px;
  line-height: 1.5;
}

/* SIDEBAR */
#sidebar {
  width: var(--sidebar-w);
  background: #1a1f36;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform .25s cubic-bezier(.4,0,.2,1);
}

#sidebar-header {
  padding: 18px 16px 14px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.sidebar-logo { display: flex; align-items: center; gap: 12px; }

.sidebar-logo-img {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: #f5f0e4;
  object-fit: contain;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
}

.sidebar-logo h1 { font-size: .9rem; font-weight: 700; color: #fff; line-height: 1.2; }
.sidebar-logo p  { font-size: .66rem; color: rgba(255,255,255,.4); margin: 0; }

#sidebar nav { flex: 1; overflow-y: auto; padding: 12px 0; scrollbar-width: none; }
#sidebar nav::-webkit-scrollbar { display: none; }

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 20px;
  cursor: pointer; font-size: .82rem; font-weight: 500;
  color: rgba(255,255,255,.55);
  transition: background .15s, color .15s;
  border: none; background: none; width: 100%; text-align: left;
  position: relative;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: rgba(255,255,255,.9); }
.nav-item.active { background: rgba(194,79,122,.18); color: #f093b6; }
.nav-item.active::before {
  content: ''; position: absolute; left: 0; top: 4px; bottom: 4px;
  width: 3px; background: var(--accent); border-radius: 0 3px 3px 0;
}
.nav-item .icon { font-size: 1rem; width: 20px; text-align: center; flex-shrink: 0; }

#sidebar-footer {
  padding: 14px 20px;
  border-top: 1px solid rgba(255,255,255,.08);
  font-size: .7rem; color: rgba(255,255,255,.2); text-align: center;
}

/* MAIN */
#main { margin-left: var(--sidebar-w); flex: 1; min-height: 100vh; display: flex; flex-direction: column; }

#top-bar {
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 0 28px; height: 60px;
  display: flex; align-items: center; gap: 14px;
  position: sticky; top: 0; z-index: 50; box-shadow: var(--shadow-sm);
}

#hamburger { display: none; background: none; border: none; font-size: 1.2rem; cursor: pointer; color: var(--text-2); padding: 4px; }
.top-bar-left { display: flex; align-items: center; gap: 10px; flex: 1; }
h2.page-title { font-size: 1rem; font-weight: 700; color: var(--text); letter-spacing: -.02em; }
.top-bar-date { font-size: .75rem; color: var(--text-3); margin-left: auto; white-space: nowrap; }

#page-body { flex: 1; padding: 28px; max-width: 1100px; }

.section { display: none; }
.section.active { display: block; }

/* DASHBOARD BANNER */
.dash-banner {
  display: flex; align-items: center; gap: 18px;
  background: linear-gradient(135deg, #1a1f36 0%, #0d3d1a 100%);
  border-radius: var(--radius-lg); padding: 20px 24px; margin-bottom: 24px;
  box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.dash-banner::before {
  content: ''; position: absolute; top: -30px; right: -30px;
  width: 130px; height: 130px; background: rgba(13,159,110,.18); border-radius: 50%;
}
.dash-banner-logo {
  width: 72px; height: 72px; border-radius: 50%; background: #f5f0e4;
  object-fit: contain; flex-shrink: 0; box-shadow: 0 4px 16px rgba(0,0,0,.3); position: relative; z-index: 1;
}
.dash-banner-text { position: relative; z-index: 1; }
.dash-banner-text h2 { font-size: 1.25rem; font-weight: 800; color: #fff; margin-bottom: 4px; }
.dash-banner-text p  { font-size: .75rem; color: rgba(255,255,255,.5); text-transform: capitalize; }

/* STATS */
.stat-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px; margin-bottom: 22px;
}
.stat-box {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 18px 20px; box-shadow: var(--shadow-sm);
  position: relative; overflow: hidden;
}
.stat-box::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--c, var(--accent)); border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.stat-icon { font-size: 1.4rem; margin-bottom: 10px; display: block; }
.stat-val { font-size: 2rem; font-weight: 700; color: var(--c, var(--accent)); line-height: 1; letter-spacing: -.03em; }
.stat-lbl { font-size: .72rem; color: var(--text-3); margin-top: 5px; font-weight: 500; }

/* CARD */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); margin-bottom: 18px; overflow: hidden;
}
.card-header {
  padding: 16px 20px; border-bottom: 1px solid var(--border-lt);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.card-title { font-size: .85rem; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 8px; }
.card-title .card-icon {
  width: 28px; height: 28px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center; font-size: .9rem; flex-shrink: 0;
}
.icon-bg-pink   { background: var(--accent-lt); }
.icon-bg-green  { background: var(--green-lt); }
.icon-bg-orange { background: var(--orange-lt); }
.icon-bg-blue   { background: var(--blue-lt); }
.card-body    { padding: 20px; }
.card-body-sm { padding: 16px 20px; }

/* FORMS */
.form-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px; margin-bottom: 16px;
}
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group.full { grid-column: 1 / -1; }
label { font-size: .72rem; font-weight: 600; color: var(--text-2); }
input, select, textarea {
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  padding: 8px 11px; font-size: .83rem; font-family: inherit; color: var(--text);
  background: var(--surface); transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(194,79,122,.1);
}
input::placeholder { color: var(--text-3); font-size: .8rem; }

/* BUTTONS */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--radius-sm); border: none;
  cursor: pointer; font-size: .8rem; font-weight: 600; font-family: inherit;
  transition: all .15s; white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 2px 8px rgba(194,79,122,.3); }
.btn-primary:hover { background: var(--accent-dk); }
.btn-outline { background: transparent; border: 1.5px solid var(--border); color: var(--text-2); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-ghost { background: transparent; color: var(--text-2); padding: 6px 10px; }
.btn-ghost:hover { background: var(--bg); }
.btn-sm { padding: 5px 11px; font-size: .75rem; }
.btn-xs { padding: 3px 8px; font-size: .7rem; }
.btn-icon {
  background: none; border: none; cursor: pointer; font-size: .9rem;
  padding: 5px 7px; border-radius: var(--radius-sm); color: var(--text-3); transition: all .15s;
}
.btn-icon:hover { background: var(--bg); color: var(--red); }

/* TABLE */
.tbl-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .8rem; }
thead tr { background: var(--bg); border-bottom: 2px solid var(--border); }
thead th { padding: 10px 14px; font-size: .7rem; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; text-align: left; white-space: nowrap; }
tbody tr { border-bottom: 1px solid var(--border-lt); transition: background .1s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--accent-xlt); }
tbody td { padding: 11px 14px; vertical-align: middle; color: var(--text-2); }
tbody td strong { color: var(--text); font-weight: 600; }

/* BADGES */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 20px; font-size: .68rem; font-weight: 700;
}
.badge-green  { background: var(--green-lt);  color: var(--green); }
.badge-orange { background: var(--orange-lt); color: var(--orange); }
.badge-red    { background: var(--red-lt);    color: var(--red); }
.badge-blue   { background: var(--blue-lt);   color: var(--blue); }

/* FILTER BAR */
.filter-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.filter-bar label { font-size: .75rem; color: var(--text-3); white-space: nowrap; }
.filter-bar select, .filter-bar input { min-width: 140px; max-width: 200px; padding: 6px 10px; font-size: .78rem; }

/* MINI STATS */
.mini-stats { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.mini-stat { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; flex: 1; min-width: 100px; text-align: center; }
.mini-stat .ms-val { font-size: 1.5rem; font-weight: 700; line-height: 1; }
.mini-stat .ms-lbl { font-size: .7rem; color: var(--text-3); margin-top: 4px; font-weight: 500; }

/* EMPTY */
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-3); }
.empty-state .empty-icon { font-size: 2.5rem; margin-bottom: 12px; opacity: .6; }
.empty-state p { font-size: .82rem; }

/* TOAST */
#toast {
  position: fixed; bottom: 28px; right: 28px; background: var(--text); color: #fff;
  padding: 11px 18px; border-radius: var(--radius); font-size: .8rem; font-weight: 500;
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s;
  transform: translateY(8px); z-index: 1000; box-shadow: var(--shadow-lg);
}
#toast.show { opacity: 1; transform: translateY(0); }

/* SIDEBAR OVERLAY */
#sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 99; }
#sidebar-overlay.show { display: block; }

/* RESPONSIVE */
@media (max-width: 768px) {
  #sidebar { transform: translateX(-100%); }
  #sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  #main { margin-left: 0; }
  #hamburger { display: flex; }
  #page-body { padding: 16px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
}
