/* ==========================================================================
   Kalodata Live Dashboard - Modern Clean Light Mode Design System
   Inspired by Linear (Light), Stripe Dashboard, and Notion
   ========================================================================== */

:root {
  /* Background & Surface */
  --bg-app: #F8FAFC;              /* Slate 50 - Background utama canvas */
  --bg-sidebar: #FFFFFF;          /* Pure White untuk sidebar */
  --bg-card: #FFFFFF;             /* Pure White untuk card */
  --bg-surface-hover: #F1F5F9;    /* Slate 100 - Hover surface */
  --bg-table-header: #F8FAFC;     /* Slate 50 untuk thead */
  
  /* Borders & Dividers */
  --border-subtle: #E2E8F0;       /* Slate 200 - Garis border utama */
  --border-hover: #CBD5E1;        /* Slate 300 - Border on hover */
  --border-focus: #6366F1;        /* Indigo 500 - Border active/focus */

  /* Shadows (Soft & Layered Stripe/Linear style) */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.07), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
  --shadow-card: 0 1px 3px rgba(15, 23, 42, 0.05), 0 10px 25px -5px rgba(15, 23, 42, 0.04);

  /* Typography (High Contrast, Readable Hierarchy) */
  --font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --text-primary: #0F172A;        /* Slate 900 - Headings & High Emphasis */
  --text-secondary: #334155;      /* Slate 700 - Body & Table primary */
  --text-muted: #64748B;          /* Slate 500 - Secondary captions/labels */
  --text-dim: #94A3B8;            /* Slate 400 - Placeholders & ID tags */

  /* Accent & Brand Colors */
  --accent-primary: #4F46E5;      /* Indigo 600 */
  --accent-primary-hover: #4338CA;/* Indigo 700 */
  --accent-primary-subtle: #EEF2FF;/* Indigo 50 */
  
  --accent-success: #059669;      /* Emerald 600 */
  --accent-success-subtle: #ECFDF5;/* Emerald 50 */
  --accent-success-border: #A7F3D0;/* Emerald 200 */

  --accent-warning: #D97706;      /* Amber 600 */
  --accent-warning-subtle: #FFFBEB;/* Amber 50 */
  --accent-warning-border: #FDE68A;/* Amber 200 */

  --accent-info: #0284C7;         /* Sky 600 */
  --accent-info-subtle: #F0F9FF;   /* Sky 50 */
  --accent-info-border: #BAE6FD;   /* Sky 200 */

  --accent-purple: #7C3AED;       /* Violet 600 */
  --accent-purple-subtle: #F5F3FF; /* Violet 50 */
  --accent-purple-border: #DDD6FE; /* Violet 200 */

  --accent-danger: #DC2626;       /* Red 600 */
  --accent-danger-subtle: #FEF2F2; /* Red 50 */

  /* Radii */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --radius-full: 9999px;
  --transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-app);
  color: var(--text-secondary);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Custom Clean Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-app);
}
::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94A3B8;
}

/* Clean Cards with Subtle Depth */
.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  transition: var(--transition);
}

.glass-card:hover {
  border-color: var(--border-hover);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  line-height: 1.4;
}

.btn-primary {
  background: var(--accent-primary);
  color: #FFFFFF;
  box-shadow: 0 1px 2px rgba(79, 70, 229, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}
.btn-primary:hover {
  background: var(--accent-primary-hover);
  box-shadow: 0 2px 4px rgba(79, 70, 229, 0.3);
  transform: translateY(-0.5px);
}

.btn-success {
  background: #059669;
  color: #FFFFFF;
  box-shadow: 0 1px 2px rgba(5, 150, 105, 0.2);
}
.btn-success:hover {
  background: #047857;
  transform: translateY(-0.5px);
}

.btn-secondary {
  background: #FFFFFF;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  box-shadow: var(--shadow-xs);
}
.btn-secondary:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

/* Form Controls */
.form-input, .form-select {
  width: 100%;
  padding: 8px 12px;
  background: #FFFFFF;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  outline: none;
  box-shadow: var(--shadow-xs);
  transition: var(--transition);
}

.form-input:focus, .form-select:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.form-input::placeholder {
  color: var(--text-dim);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: var(--radius-full);
  letter-spacing: 0.2px;
}

.badge-primary {
  background: var(--accent-purple-subtle);
  color: var(--accent-purple);
  border: 1px solid var(--accent-purple-border);
}

.badge-success {
  background: var(--accent-success-subtle);
  color: var(--accent-success);
  border: 1px solid var(--accent-success-border);
}

.badge-warning {
  background: var(--accent-warning-subtle);
  color: var(--accent-warning);
  border: 1px solid var(--accent-warning-border);
}

.badge-info {
  background: var(--accent-info-subtle);
  color: var(--accent-info);
  border: 1px solid var(--accent-info-border);
}

/* Main App Shell Layout */
.app-container {
  display: flex;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: var(--bg-app);
}

/* Sidebar */
.sidebar {
  width: 250px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  padding: 20px 16px;
  flex-shrink: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 18px;
}

.brand-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #4F46E5, #06B6D4);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.25);
}

.brand-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.2px;
}
.brand-subtitle {
  font-size: 11px;
  color: var(--text-muted);
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  list-style: none;
  flex-grow: 1;
}

.nav-item a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.nav-item a:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}

.nav-item.active a {
  background: var(--accent-primary-subtle);
  color: var(--accent-primary);
  font-weight: 600;
}

.sidebar-footer {
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Main Content Area */
.main-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  background: var(--bg-app);
}

/* Top Sticky Header */
.top-header {
  height: 64px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.content-body {
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Stat Cards Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
}

.stat-card {
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.stat-icon-wrapper {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.stat-info h4 {
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 2px;
}
.stat-info .stat-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

/* Table Design */
.table-container {
  overflow-x: auto;
  width: 100%;
  border-radius: var(--radius-lg);
}

.custom-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.custom-table th {
  padding: 11px 16px;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-table-header);
}

.custom-table td {
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text-secondary);
  border-bottom: 1px solid #F1F5F9;
  vertical-align: middle;
}

.custom-table tr:hover td {
  background: #F8FAFC;
}

.creator-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar-img {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  object-fit: cover;
  background: #E2E8F0;
  border: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 99;
}
.modal-backdrop.active {
  display: flex;
}
.modal-box {
  width: 100%;
  max-width: 480px;
  padding: 24px;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
}
