:root {
  --primary: #1f4b7c; /* DEBTIX Navy Blue */
  --primary-dark: #163a63;
  --secondary: #c9a04d; /* DEBTIX Gold */
  --bg-body: #f8fafc;
  --bg-sidebar: #1f4b7c; /* Brand Navy */
  --bg-surface: #ffffff;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --text-light: #f1f5f9;
  --border: #e2e8f0;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --radius: 0.5rem;
}

* { box-sizing: border-box; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background-color: var(--bg-body);
  color: var(--text-main);
  margin: 0;
  height: 100vh;
  overflow: hidden;
}

/* Layout */
.app-container {
  display: flex;
  height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 260px;
  background-color: var(--bg-sidebar);
  color: var(--text-light);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  box-shadow: 4px 0 24px rgba(0,0,0,0.1);
  z-index: 10;
}

.sidebar .brand {
  height: 90px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  gap: 12px;
}

.sidebar nav {
  flex: 1;
  padding: 24px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  border-radius: var(--radius);
  transition: all 0.2s;
  font-weight: 500;
  border-left: 4px solid transparent;
}

.sidebar nav a:hover {
  background-color: rgba(255,255,255,0.1);
  color: #fff;
}

.sidebar nav a.active {
  background-color: rgba(255,255,255,0.15);
  color: #fff;
  border-left-color: var(--secondary);
}
.sidebar nav a.active .material-icons-round {
    color: var(--secondary);
}

.sidebar .user-info {
  padding: 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(0,0,0,0.1);
}
.sidebar .avatar {
  width: 40px; height: 40px;
  background: var(--secondary);
  color: var(--primary);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
}
.sidebar .details { display: flex; flex-direction: column; }
.sidebar .details .name { font-weight: 600; font-size: 0.9rem; }
.sidebar .details .role a { color: rgba(255,255,255,0.6); font-size: 0.8rem; }
.sidebar .details .role a:hover { color: #fff; }

/* Main Content */
.content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.topbar {
  height: 64px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  flex-shrink: 0;
}

.page-content {
  flex: 1;
  overflow-y: auto;
  padding: 32px;
}

/* Typography & Elements */
h1, h2, h3 { margin-top: 0; color: var(--text-main); font-weight: 600; }
h2 { font-size: 1.5rem; margin-bottom: 1.5rem; }
h3 { font-size: 1.125rem; margin-bottom: 1rem; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Cards */
section, .card {
  background: var(--bg-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  padding: 24px;
  margin-bottom: 24px;
}

/* Breadcrumbs */
.breadcrumbs {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  display: flex; gap: 8px; align-items: center;
}
.breadcrumbs a { color: var(--text-muted); }
.breadcrumbs a:hover { color: var(--primary); }

/* Tables */
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
}
th {
  background: #f8fafc;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
td {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background-color: #f8fafc; }

/* Buttons */
.btn, button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-weight: 500;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
  text-decoration: none;
}
.btn.small { padding: 6px 12px; font-size: 0.8rem; }
.btn.primary, button[type="submit"] {
  background-color: var(--primary);
  color: white;
}
.btn.primary:hover, button[type="submit"]:hover {
  background-color: var(--primary-dark);
}
.btn.secondary {
  background-color: white;
  border-color: var(--border);
  color: var(--text-main);
}
.btn.secondary:hover {
  background-color: #f8fafc;
  color: var(--primary);
  border-color: var(--primary);
}

/* Forms */
input, select, textarea {
  display: block;
  width: 100%;
  max-width: 500px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  color: var(--text-main);
  background: #fff;
  transition: border-color 0.2s;
  margin-top: 4px;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(31, 75, 124, 0.1); /* Adjusted shadow color */
}
label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-main);
  margin-bottom: 12px;
}

/* Dashboard Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}
.stat-card {
  background: white;
  padding: 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}
.stat-card .label { font-size: 0.875rem; color: var(--text-muted); font-weight: 500; }
.stat-card .value { font-size: 1.875rem; font-weight: 700; color: var(--text-main); margin-top: 8px; }
.stat-card .trend { font-size: 0.75rem; margin-top: 4px; color: var(--success); }

/* Badges */
.badge {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}
.badge.gray { background: #f1f5f9; color: #475569; }
.badge.blue { background: #eff6ff; color: var(--primary); }
.badge.green { background: #f0fdf4; color: #15803d; }
.badge.red { background: #fef2f2; color: #b91c1c; }
.badge.yellow { background: #fffbeb; color: #b45309; }

/* Tabs */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}
.tab {
  padding: 12px 24px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
}
.tab:hover { color: var(--text-main); }
.tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* Material Icons adjustment */
.material-icons-round { font-size: 20px; vertical-align: middle; }
