/* assets/css/admin.css - improved dashboard styling (matches your screenshots)
   + chart container fixes so Chart.js doesn't expand the layout */

/* ========= THEME VARIABLES ========= */
:root{
  --bg: #fbf7f0;                 /* page background */
  --panel-bg: #fff;              /* card background */
  --muted: #6b7280;              /* muted text */
  --muted-2: #9ca3af;
  --accent: #7c5cff;             /* purple primary from screenshots */
  --accent-2: #6b8cff;           /* blue-ish */
  --accent-opaque: rgba(124,92,255,0.12);
  --accent-opaque-2: rgba(107,140,255,0.08);
  --border: #f3ece2;
  --radius: 14px;
  --card-radius: 12px;
  --shadow: 0 6px 24px rgba(14,30,37,0.06);
  --soft-shadow: 0 4px 14px rgba(14,30,37,0.04);
  --success: #10b981;
  --danger: #ef4444;
  --card-padding: 18px;
  --max-width: 1200px;
  --font-sans: "DM Sans", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  --chart-height: 340px; /* shared chart height */
}

/* Normalize box-sizing and basic layout */
*,
*::before,
*::after { box-sizing: border-box; }

/* ========= GLOBAL LAYOUT ========= */
html,body{height:100%}
body.app-root{
  margin:0;
  font-family:var(--font-sans);
  background:var(--bg);
  color:#111827;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  line-height:1.4;
}

/* Top header */
header.admin-top{
  position:sticky; top:0; z-index:60;
  background:var(--panel-bg);
  border-bottom:1px solid var(--border);
  box-shadow: 0 2px 6px rgba(19,19,24,0.02);
}
.header-inner{
  max-width:var(--max-width);
  margin:0 auto;
  padding:12px 20px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

/* Brand */
.brand{display:flex;align-items:center;gap:14px}
.brand .logo{
  width:44px;height:44px;border-radius:12px;
  background:linear-gradient(135deg,var(--accent),var(--accent-2));
  display:flex;align-items:center;justify-content:center;color:#fff;font-weight:700;
  box-shadow: var(--soft-shadow);
}
.brand .title{
  font-size:18px;font-weight:700;
  background:linear-gradient(90deg,var(--accent),var(--accent-2));
  -webkit-background-clip:text;background-clip:text;color:transparent;
}

/* Top actions: search, toggles, avatar */
.top-actions{display:flex;align-items:center;gap:14px}
.top-actions .search{
  display:flex;align-items:center;gap:8px;padding:8px 12px;border-radius:12px;
  background:#fff;border:1px solid #f1f5f9;box-shadow:none;
  min-width:260px;max-width:520px;
}
.top-actions .search input{border:0;outline:0;background:transparent;width:100%;font-size:14px;color:#374151}
.top-actions .kbd{background:#f3f4f6;border-radius:6px;padding:4px 7px;font-family:monospace;font-size:12px;color:#6b7280}

/* container */
.main-wrap{
  max-width:var(--max-width);
  margin:18px auto;
  padding:20px;
  display:flex;
  gap:20px;
  align-items:flex-start;
}

/* ========= SIDEBAR ========= */
.sidebar{
  width:260px;
  background:var(--panel-bg);
  border-radius:var(--radius);
  padding:18px;
  border:1px solid var(--border);
  box-shadow:var(--shadow);
  min-height:680px;
  display:flex;flex-direction:column;
  gap:6px;
  position:relative;
}
.nav-btn{
  display:flex;align-items:center;gap:12px;padding:12px;border-radius:10px;color:var(--muted);
  text-decoration:none;font-weight:500;font-size:15px;
  transition:all .18s ease;
  background:transparent;border:0;position:relative;
}
.nav-btn:hover{background:var(--accent-opaque);color:var(--accent);transform:translateY(-1px)}
.nav-btn .icon{
  width:36px;height:36px;border-radius:10px;display:flex;align-items:center;justify-content:center;
  background:#f7f6fb;color:var(--accent);font-weight:600;
}
.nav-btn.active{
  background:linear-gradient(90deg,var(--accent),var(--accent-2));
  color:#fff;box-shadow:0 6px 20px rgba(124,92,255,0.12);
}
.nav-btn.active .icon{background:rgba(255,255,255,0.12);color:#fff}

/* tiny left indicator dot for active */
.nav-btn.active::after{
  content:'';position:absolute;left:12px;width:8px;height:8px;border-radius:50%;background:#fff;opacity:0.25;
}

/* ========= CONTENT ========= */
.content{flex:1;display:flex;flex-direction:column;gap:18px}

/* Cards layout */
.cards-grid{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap:18px;
  align-items:start;
}
@media (max-width:1100px){
  .cards-grid{grid-template-columns:repeat(2,1fr)}
}
@media (max-width:700px){
  .cards-grid{grid-template-columns:repeat(1,1fr)}
}

.card{
  background:var(--panel-bg);
  border-radius:var(--card-radius);
  padding:var(--card-padding);
  border:1px solid var(--border);
  box-shadow:var(--soft-shadow);
  min-height:96px;
}

/* Card header + icon */
.card h3{margin:0;font-size:13px;color:var(--muted);font-weight:600}
.card .value{font-size:28px;font-weight:700;margin-top:8px;color:#111827}
.card .muted{color:var(--muted);font-size:13px;margin-top:6px}

/* Larger cards */
.card.large{min-height:300px;padding:22px}

/* Revenue & charts area */
.revenue-wrap{display:flex;gap:18px;align-items:flex-start;flex-wrap:wrap}
.revenue-chart{flex:2;min-height:var(--chart-height)}
.popular-services{flex:1;min-width:280px}

/* Chart container: stable height so chart doesn't push layout down */
.chart-container{
  height:var(--chart-height);              /* change to adjust chart height */
  position:relative;
  width:100%;
  overflow:hidden;
  padding:6px 0;             /* small breathing room */
  box-sizing:border-box;
  display:block;
  border-radius:8px;
  background:transparent;
}

/* Ensure canvas fills the chart container (Chart.js will use computed size) */
.chart-container canvas,
.revenue-chart canvas {
  width:100% !important;
  height:100% !important;
  display:block;             /* remove inline whitespace below canvas */
}

/* Chart legend quick styles (if you render custom legend) */
.chart-legend{display:flex;gap:10px;align-items:center}
.legend-dot{width:10px;height:10px;border-radius:10px;display:inline-block}

/* ========= POPULAR SERVICES (right column) ========= */
.popular-list{display:flex;flex-direction:column;gap:12px}
.popular-item{
  display:flex;align-items:center;justify-content:space-between;
  background:#fbf9f6;border-radius:10px;padding:12px;border:1px solid #f3efe7;
}
.popular-left{display:flex;align-items:center;gap:12px}
.rank-circle{
  width:40px;height:40px;border-radius:10px;background:#fff;border:1px solid #efe9e0;
  display:flex;align-items:center;justify-content:center;color:var(--muted);font-weight:700;
  font-size:14px;
}
.popular-meta{display:flex;flex-direction:column}
.popular-meta .name{font-weight:700;color:#111827}
.popular-meta .small{font-size:13px;color:var(--muted-2)}
.popular-revenue{font-weight:700;color:#111827;text-align:right;font-size:15px}

/* ========= RECENT ACTIVITY ========= */
.recent-activity{background:var(--panel-bg);border-radius:var(--card-radius);padding:18px;border:1px solid var(--border);box-shadow:var(--soft-shadow)}
.activity-list{display:flex;flex-direction:column;gap:12px}
.activity-item{
  display:flex;align-items:center;justify-content:space-between;padding:14px;border-radius:12px;background:#fff;border:1px solid #f6f4f2;
}
.activity-left{display:flex;align-items:center;gap:14px}
.activity-avatar{
  width:44px;height:44px;border-radius:999px;background:#f3f2fb;color:var(--accent);display:flex;align-items:center;justify-content:center;font-weight:700;
}
.activity-details{display:flex;flex-direction:column}
.activity-title{font-weight:700;color:#111827}
.activity-sub{font-size:13px;color:var(--muted)}
.activity-meta{display:flex;gap:12px;font-size:13px;color:var(--muted-2);align-items:center;margin-top:6px}

/* Status pills (confirmed/pending) */
.pill{
  padding:6px 10px;border-radius:999px;font-size:12px;font-weight:700;
  display:inline-flex;align-items:center;gap:8px;
}
.pill.confirmed{background:linear-gradient(90deg,#7c5cff,#6b8cff);color:#fff}
.pill.pending{background:#c8f7ef;color:var(--success);font-weight:700;color:#065f46}

/* ========= TABLES ========= */
.table{width:100%;border-collapse:collapse}
.table th,.table td{padding:12px;border-bottom:1px solid #f6f6f7;text-align:left;font-size:14px;color:#374151}

/* ========= SMALL CONTROLS ========= */
.btn{display:inline-flex;align-items:center;padding:8px 14px;border-radius:10px;border:0;background:var(--accent);color:#fff;text-decoration:none;font-weight:600}
.secondary{background:#fff;border:1px solid #f1f5f9;color:#374151}

/* ========= RESPONSIVE ========= */
@media (max-width:900px){
  .main-wrap{flex-direction:column;padding:12px}
  .sidebar{width:100%;min-height:unset}
  .brand .title{font-size:16px}
  .header-inner{padding:10px 12px}
  .top-actions .search{min-width:160px}
  .cards-grid{grid-template-columns:repeat(1,1fr)}
  .revenue-wrap{flex-direction:column}
  .popular-services{min-width:unset;width:100%}
  .revenue-chart{min-height:240px}
  .chart-container{height:240px}
}


.revenue-chart canvas { width:100% !important; height:340px !important; display:block; }
