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

:root {
  --blue: #1e4899; --blue-dark: #0f2d5e; --blue-deeper: #091d40;
  --blue-light: #3a6fd8; --gold: #ffbd59; --gold-dark: #e5a33d; --gold-light: #ffd080;
  --gray-50: #f8f9fc; --gray-100: #edf0f7; --gray-200: #dde2ef;
  --gray-300: #c4cade; --gray-400: #9aa3bc; --gray-500: #6b7694;
  --gray-600: #5a6378; --gray-700: #3d4559; --gray-800: #1e2433;
  --green: #22c55e; --red: #ef4444; --orange: #f59e0b; --purple: #8b5cf6;
  --sidebar-w: 260px; --header-h: 64px;
  --radius: 12px; --radius-sm: 8px;
  --shadow: 0 2px 12px rgba(0,0,0,.06);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.1);
  --transition: all .3s cubic-bezier(.4,0,.2,1);
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Inter', sans-serif; background: var(--gray-50); color: var(--gray-800); font-size: 14px; line-height: 1.6; overflow-x: hidden; }
h1,h2,h3,h4,h5 { font-family: 'Space Grotesk', sans-serif; }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

/* ═══════════ SIDEBAR ═══════════ */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w); background: var(--blue-deeper);
  z-index: 1000; display: flex; flex-direction: column;
  transition: var(--transition);
}
.sidebar-brand {
  padding: 20px 24px; display: flex; align-items: center; gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.sidebar-brand img { height: 32px; }
.sidebar-brand h2 { font-size: 1.1rem; color: #fff; font-weight: 700; }
.sidebar-brand span { color: var(--gold); }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 16px 0; }
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 4px; }
.nav-section { padding: 8px 24px 4px; font-size: .65rem; text-transform: uppercase; letter-spacing: 1.5px; color: rgba(255,255,255,.25); font-weight: 700; margin-top: 8px; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 24px; color: rgba(255,255,255,.5);
  font-size: .85rem; font-weight: 500;
  transition: var(--transition); position: relative;
}
.nav-item:hover { color: rgba(255,255,255,.85); background: rgba(255,255,255,.04); }
.nav-item.active { color: var(--gold); background: rgba(255,189,89,.06); }
.nav-item.active::before { content: ''; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; background: var(--gold); border-radius: 0 3px 3px 0; }
.nav-item i { width: 20px; text-align: center; font-size: .9rem; }
.nav-item .badge { margin-left: auto; padding: 2px 8px; border-radius: 50px; font-size: .65rem; font-weight: 700; background: var(--red); color: #fff; }
.nav-item .badge.gold { background: var(--gold); color: var(--blue-dark); }
.sidebar-footer {
  padding: 16px 24px; border-top: 1px solid rgba(255,255,255,.06);
  display: flex; align-items: center; gap: 12px;
}
.sidebar-footer .user-avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--blue), var(--blue-light)); display: flex; align-items: center; justify-content: center; color: #fff; font-size: .8rem; font-weight: 700; }
.sidebar-footer .user-info h4 { font-size: .82rem; color: rgba(255,255,255,.85); }
.sidebar-footer .user-info p { font-size: .7rem; color: rgba(255,255,255,.35); }

/* ═══════════ MAIN LAYOUT ═══════════ */
.main-content { margin-left: var(--sidebar-w); min-height: 100vh; }
.top-header {
  position: sticky; top: 0; height: var(--header-h);
  background: rgba(255,255,255,.85); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--gray-100);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 32px; z-index: 100;
}
.top-header .page-title { display: flex; align-items: center; gap: 12px; }
.top-header .page-title h1 { font-size: 1.3rem; font-weight: 700; color: var(--gray-800); }
.top-header .page-title .breadcrumb-text { font-size: .78rem; color: var(--gray-400); }
.header-actions { display: flex; align-items: center; gap: 12px; }
.header-search {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 16px; border-radius: 50px;
  background: var(--gray-50); border: 1px solid var(--gray-200);
  width: 260px; transition: var(--transition);
}
.header-search:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(30,72,153,.08); }
.header-search i { color: var(--gray-400); font-size: .8rem; }
.header-search input { border: none; background: none; outline: none; font-size: .82rem; color: var(--gray-800); width: 100%; }
.header-btn {
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--gray-50); border: 1px solid var(--gray-200);
  color: var(--gray-500); font-size: .85rem;
  transition: var(--transition); position: relative;
}
.header-btn:hover { background: var(--blue); color: #fff; border-color: var(--blue); }
.header-btn .notif-dot { position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); border: 2px solid #fff; }
.content-area { padding: 28px 32px; }

/* ═══════════ CARDS & WIDGETS ═══════════ */
.card { background: #fff; border-radius: var(--radius); border: 1px solid var(--gray-100); transition: var(--transition); }
.card:hover { box-shadow: var(--shadow); }
.card-header { padding: 20px 24px; border-bottom: 1px solid var(--gray-100); display: flex; align-items: center; justify-content: space-between; }
.card-header h3 { font-size: .95rem; font-weight: 700; color: var(--gray-800); }
.card-header .card-actions { display: flex; gap: 8px; }
.card-body { padding: 24px; }
.card-footer { padding: 16px 24px; border-top: 1px solid var(--gray-100); }

/* ── KPI Cards ── */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 28px; }
.kpi-card {
  background: #fff; border-radius: var(--radius);
  padding: 24px; border: 1px solid var(--gray-100);
  display: flex; align-items: flex-start; justify-content: space-between;
  transition: var(--transition);
}
.kpi-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.kpi-info h4 { font-size: .75rem; color: var(--gray-500); text-transform: uppercase; letter-spacing: .5px; font-weight: 600; margin-bottom: 8px; }
.kpi-info .kpi-value { font-size: 1.8rem; font-weight: 800; color: var(--gray-800); font-family: 'Space Grotesk'; }
.kpi-info .kpi-change { font-size: .75rem; font-weight: 600; margin-top: 4px; display: flex; align-items: center; gap: 4px; }
.kpi-info .kpi-change.up { color: var(--green); }
.kpi-info .kpi-change.down { color: var(--red); }
.kpi-icon { width: 48px; height: 48px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 1.2rem; flex-shrink: 0; }
.kpi-icon.blue { background: rgba(30,72,153,.08); color: var(--blue); }
.kpi-icon.gold { background: rgba(255,189,89,.12); color: var(--gold-dark); }
.kpi-icon.green { background: rgba(34,197,94,.08); color: var(--green); }
.kpi-icon.purple { background: rgba(139,92,246,.08); color: var(--purple); }

/* ── Grid layouts ── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.grid-3 { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; }
.grid-row { margin-bottom: 24px; }

/* ═══════════ TABLE ═══════════ */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { text-align: left; padding: 12px 16px; font-size: .72rem; text-transform: uppercase; letter-spacing: .5px; color: var(--gray-500); font-weight: 700; background: var(--gray-50); border-bottom: 1px solid var(--gray-100); }
.data-table td { padding: 14px 16px; font-size: .85rem; border-bottom: 1px solid var(--gray-100); vertical-align: middle; }
.data-table tr:hover td { background: rgba(30,72,153,.02); }
.data-table .user-cell { display: flex; align-items: center; gap: 10px; }
.data-table .user-cell .avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, var(--blue), var(--blue-light)); display: flex; align-items: center; justify-content: center; color: #fff; font-size: .65rem; font-weight: 700; flex-shrink: 0; }
.data-table .user-cell h4 { font-size: .85rem; font-weight: 600; color: var(--gray-800); }
.data-table .user-cell p { font-size: .72rem; color: var(--gray-400); }

/* ── Status Badges ── */
.status { display: inline-flex; align-items: center; gap: 4px; padding: 4px 12px; border-radius: 50px; font-size: .72rem; font-weight: 600; }
.status.active { background: rgba(34,197,94,.1); color: var(--green); }
.status.pending { background: rgba(245,158,11,.1); color: var(--orange); }
.status.overdue { background: rgba(239,68,68,.1); color: var(--red); }
.status.completed { background: rgba(30,72,153,.08); color: var(--blue); }
.status.draft { background: var(--gray-100); color: var(--gray-500); }

/* ═══════════ BUTTONS ═══════════ */
.btn-sm { padding: 6px 14px; border-radius: 6px; font-size: .78rem; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; transition: var(--transition); }
.btn-sm.primary { background: var(--blue); color: #fff; }
.btn-sm.primary:hover { background: var(--blue-dark); }
.btn-sm.gold { background: var(--gold); color: var(--blue-dark); }
.btn-sm.gold:hover { background: var(--gold-dark); }
.btn-sm.outline { border: 1px solid var(--gray-200); color: var(--gray-600); }
.btn-sm.outline:hover { border-color: var(--blue); color: var(--blue); }
.btn-sm.danger { background: rgba(239,68,68,.08); color: var(--red); }
.btn-sm.success { background: rgba(34,197,94,.08); color: var(--green); }

/* ═══════════ CHART PLACEHOLDER ═══════════ */
.chart-placeholder { width: 100%; height: 260px; background: linear-gradient(135deg, var(--gray-50), #fff); border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; border: 1px dashed var(--gray-200); }
.chart-bars { display: flex; align-items: flex-end; gap: 8px; height: 200px; padding: 0 20px; }
.chart-bar { width: 36px; border-radius: 6px 6px 0 0; transition: var(--transition); position: relative; }
.chart-bar:hover { opacity: .8; }
.chart-bar.blue { background: linear-gradient(to top, var(--blue), var(--blue-light)); }
.chart-bar.gold { background: linear-gradient(to top, var(--gold-dark), var(--gold)); }
.chart-bar-label { position: absolute; bottom: -20px; left: 50%; transform: translateX(-50%); font-size: .6rem; color: var(--gray-400); white-space: nowrap; }

/* ═══════════ ACTIVITY FEED ═══════════ */
.activity-list { list-style: none; }
.activity-item { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--gray-100); }
.activity-item:last-child { border-bottom: none; }
.activity-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; }
.activity-dot.blue { background: var(--blue); }
.activity-dot.gold { background: var(--gold); }
.activity-dot.green { background: var(--green); }
.activity-dot.red { background: var(--red); }
.activity-text { font-size: .82rem; color: var(--gray-600); }
.activity-text strong { color: var(--gray-800); }
.activity-text .time { font-size: .7rem; color: var(--gray-400); display: block; margin-top: 2px; }

/* ═══════════ MESSAGING ═══════════ */
.msg-layout { display: grid; grid-template-columns: 320px 1fr; height: calc(100vh - var(--header-h) - 56px); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--gray-100); background: #fff; }
.msg-sidebar { border-right: 1px solid var(--gray-100); display: flex; flex-direction: column; }
.msg-search { padding: 16px; border-bottom: 1px solid var(--gray-100); }
.msg-search input { width: 100%; padding: 10px 14px; border: 1px solid var(--gray-200); border-radius: var(--radius-sm); font-size: .82rem; background: var(--gray-50); outline: none; }
.msg-search input:focus { border-color: var(--blue); }
.msg-list { flex: 1; overflow-y: auto; }
.msg-contact { display: flex; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--gray-100); cursor: pointer; transition: var(--transition); }
.msg-contact:hover { background: var(--gray-50); }
.msg-contact.active { background: rgba(30,72,153,.04); border-left: 3px solid var(--blue); }
.msg-contact .contact-avatar { width: 42px; height: 42px; border-radius: 50%; background: linear-gradient(135deg, var(--blue), var(--blue-light)); display: flex; align-items: center; justify-content: center; color: #fff; font-size: .75rem; font-weight: 700; flex-shrink: 0; position: relative; }
.msg-contact .online-dot { position: absolute; bottom: 0; right: 0; width: 10px; height: 10px; border-radius: 50%; background: var(--green); border: 2px solid #fff; }
.msg-contact .contact-info { flex: 1; min-width: 0; }
.msg-contact .contact-info h4 { font-size: .85rem; font-weight: 600; color: var(--gray-800); display: flex; justify-content: space-between; }
.msg-contact .contact-info h4 .time { font-size: .65rem; color: var(--gray-400); font-weight: 400; }
.msg-contact .contact-info p { font-size: .78rem; color: var(--gray-400); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-contact .unread-badge { padding: 2px 7px; border-radius: 50px; background: var(--blue); color: #fff; font-size: .6rem; font-weight: 700; }

.msg-main { display: flex; flex-direction: column; }
.msg-header { padding: 16px 20px; border-bottom: 1px solid var(--gray-100); display: flex; align-items: center; justify-content: space-between; }
.msg-header .chat-user { display: flex; align-items: center; gap: 12px; }
.msg-header .chat-user .avatar { width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg, var(--blue-deeper), var(--blue)); display: flex; align-items: center; justify-content: center; color: #fff; font-size: .75rem; font-weight: 700; }
.msg-header .chat-user h4 { font-size: .9rem; font-weight: 600; }
.msg-header .chat-user p { font-size: .72rem; color: var(--green); }
.msg-header .chat-actions { display: flex; gap: 8px; }
.msg-header .chat-actions button { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; border: 1px solid var(--gray-200); color: var(--gray-500); font-size: .85rem; transition: var(--transition); }
.msg-header .chat-actions button:hover { background: var(--blue); color: #fff; border-color: var(--blue); }
.msg-header .chat-actions button.wa { border-color: #25D366; color: #25D366; }
.msg-header .chat-actions button.wa:hover { background: #25D366; color: #fff; }

.msg-body { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 12px; background: var(--gray-50); }
.msg-bubble { max-width: 70%; padding: 12px 16px; border-radius: 16px; font-size: .85rem; line-height: 1.5; position: relative; }
.msg-bubble.sent { background: var(--blue); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.msg-bubble.received { background: #fff; border: 1px solid var(--gray-100); align-self: flex-start; border-bottom-left-radius: 4px; }
.msg-bubble .msg-time { font-size: .6rem; opacity: .6; margin-top: 4px; display: flex; align-items: center; gap: 4px; }
.msg-bubble.sent .msg-time { justify-content: flex-end; }
.msg-bubble .msg-media { border-radius: 8px; overflow: hidden; margin-bottom: 8px; background: var(--gray-100); height: 160px; display: flex; align-items: center; justify-content: center; color: var(--gray-400); }

.msg-input { padding: 16px 20px; border-top: 1px solid var(--gray-100); display: flex; align-items: center; gap: 10px; background: #fff; }
.msg-input .attach-btn { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--gray-400); font-size: .9rem; transition: var(--transition); }
.msg-input .attach-btn:hover { color: var(--blue); background: var(--gray-50); }
.msg-input input { flex: 1; padding: 10px 16px; border: 1px solid var(--gray-200); border-radius: 50px; font-size: .85rem; outline: none; background: var(--gray-50); }
.msg-input input:focus { border-color: var(--blue); }
.msg-input .send-btn { width: 40px; height: 40px; border-radius: 50%; background: var(--blue); color: #fff; display: flex; align-items: center; justify-content: center; font-size: .85rem; transition: var(--transition); }
.msg-input .send-btn:hover { background: var(--blue-dark); }

/* ═══════════ KANBAN ═══════════ */
.kanban-board { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.kanban-col { background: var(--gray-50); border-radius: var(--radius); padding: 16px; min-height: 400px; }
.kanban-col-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 2px solid; }
.kanban-col-header.todo { border-color: var(--gray-400); }
.kanban-col-header.progress { border-color: var(--blue); }
.kanban-col-header.review { border-color: var(--orange); }
.kanban-col-header.done { border-color: var(--green); }
.kanban-col-header h4 { font-size: .82rem; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.kanban-col-header .count { padding: 2px 8px; border-radius: 50px; background: var(--gray-200); font-size: .65rem; font-weight: 700; color: var(--gray-600); }
.kanban-card { background: #fff; border-radius: var(--radius-sm); padding: 14px; border: 1px solid var(--gray-100); margin-bottom: 10px; cursor: grab; transition: var(--transition); }
.kanban-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.kanban-card .card-tag { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: .65rem; font-weight: 600; margin-bottom: 8px; }
.kanban-card .card-tag.web { background: rgba(30,72,153,.08); color: var(--blue); }
.kanban-card .card-tag.mobile { background: rgba(139,92,246,.08); color: var(--purple); }
.kanban-card .card-tag.design { background: rgba(255,189,89,.12); color: var(--gold-dark); }
.kanban-card .card-tag.bug { background: rgba(239,68,68,.08); color: var(--red); }
.kanban-card h5 { font-size: .82rem; font-weight: 600; color: var(--gray-800); margin-bottom: 6px; }
.kanban-card p { font-size: .72rem; color: var(--gray-400); margin-bottom: 10px; }
.kanban-card .card-meta { display: flex; align-items: center; justify-content: space-between; }
.kanban-card .assignee { width: 24px; height: 24px; border-radius: 50%; background: var(--blue); display: flex; align-items: center; justify-content: center; color: #fff; font-size: .55rem; font-weight: 700; }
.kanban-card .due { font-size: .65rem; color: var(--gray-400); display: flex; align-items: center; gap: 4px; }

/* ═══════════ SECTION TABS ═══════════ */
.section-tabs { display: flex; gap: 0; border-bottom: 2px solid var(--gray-100); margin-bottom: 24px; }
.section-tab { padding: 12px 20px; font-size: .85rem; font-weight: 600; color: var(--gray-400); border-bottom: 2px solid transparent; margin-bottom: -2px; transition: var(--transition); cursor: pointer; }
.section-tab:hover { color: var(--gray-600); }
.section-tab.active { color: var(--blue); border-color: var(--blue); }

/* ═══════════ RESPONSIVE ═══════════ */
@media (max-width: 1200px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } .kanban-board { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 768px) { .sidebar { transform: translateX(-100%); } .main-content { margin-left: 0; } .kpi-grid { grid-template-columns: 1fr; } .grid-2, .grid-3 { grid-template-columns: 1fr; } .msg-layout { grid-template-columns: 1fr; } }
