@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --accent: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --bg-main: #f8fafc;
  --sidebar-bg: #ffffff;
  --topbar-bg: #ffffff;
  --card-bg: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --radius: 16px;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body {
  background: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* App Container */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* LIGHT THEME FULL WIDTH TOP NAVBAR */
.topbar {
  height: 70px;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  color: var(--text-main);
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 240px;
}

.topbar-logo {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: white;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.topbar-title {
  font-size: 20px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.5px;
}

.topbar-title span {
  color: #2563eb;
}

.topbar-search {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  padding: 8px 16px;
  border-radius: 99px;
  width: 440px;
}

.topbar-search input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 13.5px;
  width: 100%;
  color: #0f172a;
}

.topbar-search input::placeholder {
  color: #94a3b8;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.btn-primary-action {
  background: var(--primary);
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.btn-primary-action:hover {
  background: var(--primary-hover);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 16px;
  border-left: 1px solid var(--border);
  color: var(--text-main);
}

.avatar {
  width: 38px;
  height: 38px;
  background: #e2e8f0;
  color: #1e293b;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

/* Layout Body Below Topbar */
.layout-body {
  display: flex;
  margin-top: 70px;
  min-height: calc(100vh - 70px);
}

/* LIGHT COLLAPSIBLE SIDEBAR */
.sidebar {
  width: 260px;
  background: #ffffff;
  color: #64748b;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 70px;
  bottom: 0;
  left: 0;
  z-index: 100;
  border-right: 1px solid var(--border);
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-x: hidden;
}

.sidebar.collapsed {
  width: 72px;
}

.sidebar-header-toggle {
  padding: 10px 14px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar.collapsed .sidebar-header-toggle {
  justify-content: center;
}

.btn-toggle-sidebar {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #475569;
  border-radius: 8px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-toggle-sidebar:hover {
  background: #e2e8f0;
  color: #0f172a;
}

/* NO ANIMATION / TRANSFORM ON BUTTON HOVER */
.quick-grid-btn {
  transform: none !important;
  transition: none !important;
}

.sidebar.collapsed .quick-grid-wrapper {
  grid-template-columns: 1fr !important;
  gap: 6px !important;
  padding: 10px 8px !important;
}

.sidebar.collapsed .quick-grid-btn span {
  display: none !important;
}

.sidebar-menu {
  list-style: none;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  overflow-y: auto;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  color: #475569;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transform: none !important;
  transition: background 0.15s ease;
}

.sidebar.collapsed .menu-item {
  justify-content: center;
  padding: 12px;
}

.sidebar.collapsed .menu-item span {
  display: none !important;
}

.menu-item:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.menu-item.active {
  background: #eff6ff;
  color: #2563eb;
  font-weight: 700;
  border: 1px solid #bfdbfe;
}

.menu-item.logout {
  color: #ef4444;
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.menu-item.logout:hover {
  background: #fef2f2;
  color: #dc2626;
}

/* MAIN WRAPPER WITH COLLAPSIBLE MARGIN */
.main-wrapper {
  flex: 1;
  margin-left: 260px;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 70px);
  transition: margin-left 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.main-wrapper.collapsed {
  margin-left: 72px;
}

.content-area {
  padding: 32px;
  flex: 1;
}

.page-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 24px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stat-info h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.stat-info .amount {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-main);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-icon.red { background: rgba(239, 68, 68, 0.1); color: var(--danger); }
.stat-icon.green { background: rgba(16, 185, 129, 0.1); color: var(--accent); }
.stat-icon.blue { background: rgba(37, 99, 235, 0.1); color: var(--primary); }

.table-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

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

.table-header h3 {
  font-size: 16px;
  font-weight: 700;
}

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

.custom-table th {
  background: #f8fafc;
  padding: 14px 24px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
}

.custom-table td {
  padding: 16px 24px;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
  color: #334155;
}

.custom-table tr:last-child td {
  border-bottom: none;
}

.badge {
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 700;
  display: inline-block;
}

.badge.danger { background: #fef2f2; color: #dc2626; }
.badge.success { background: #ecfdf5; color: #059669; }
.badge.neutral { background: #f1f5f9; color: #475569; }

/* LOGIN STYLES */
.bg-blob {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  z-index: 0;
  opacity: 0.5;
  pointer-events: none;
}

.blob-1 {
  width: 400px;
  height: 400px;
  background: rgba(37, 99, 235, 0.15);
  top: -100px;
  left: -100px;
}

.blob-2 {
  width: 500px;
  height: 500px;
  background: rgba(16, 185, 129, 0.12);
  bottom: -150px;
  right: -150px;
}

.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  z-index: 10;
  background: #f8fafc;
}

.login-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 24px;
  padding: 40px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 20px 25px -5px rgba(0,0,0,0.05), 0 8px 10px -6px rgba(0,0,0,0.03);
}

.brand-header {
  text-align: center;
  margin-bottom: 28px;
}

.brand-logo {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: white;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  box-shadow: 0 8px 16px rgba(37, 99, 235, 0.25);
}

.brand-title {
  font-size: 24px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.5px;
}

.brand-title span {
  color: #2563eb;
}

.brand-subtitle {
  font-size: 13.5px;
  color: #64748b;
  margin-top: 4px;
}

.auth-tabs {
  display: flex;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 12px;
  margin-bottom: 24px;
}

.tab-btn {
  flex: 1;
  padding: 10px;
  border: none;
  background: transparent;
  font-size: 13.5px;
  font-weight: 700;
  color: #64748b;
  border-radius: 8px;
  cursor: pointer;
}

.tab-btn.active {
  background: #ffffff;
  color: #2563eb;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 6px;
}

.input-wrapper {
  position: relative;
}

.form-input {
  width: 100%;
  padding: 12px 16px 12px 42px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  font-size: 14px;
  outline: none;
  background: #ffffff;
  color: #0f172a;
}

.form-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.input-icon {
  position: absolute;
  left: 14px;
  top: 13px;
  color: #94a3b8;
}

.form-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  font-size: 13px;
}

.remember-me {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #475569;
  cursor: pointer;
}

.forgot-link {
  color: #2563eb;
  text-decoration: none;
  font-weight: 600;
}

.btn-submit {
  width: 100%;
  padding: 14px;
  background: #2563eb;
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
}

.btn-submit:hover {
  background: #1d4ed8;
}

.divider {
  text-align: center;
  margin: 20px 0;
  position: relative;
}

.divider::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  right: 0;
  height: 1px;
  background: #e2e8f0;
}

.divider span {
  position: relative;
  background: #ffffff;
  padding: 0 12px;
  font-size: 12px;
  color: #94a3b8;
  font-weight: 600;
}

.btn-demo {
  width: 100%;
  padding: 12px;
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
}

.btn-demo:hover {
  background: #dbeafe;
}

.footer-text {
  text-align: center;
  margin-top: 24px;
  font-size: 12px;
  color: #94a3b8;
}
