/* KSM Platform Global Styles */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap");
@import url("https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500&display=swap");

:root {
  /* Brand Colors */
  --primary-color: #4f46e5; /* Indigo 600 */
  --primary-hover: #4338ca; /* Indigo 700 */
  --secondary-color: #10b981; /* Emerald 500 */
  --accent-color: #f59e0b; /* Amber 500 */
  --danger-color: #ef4444; /* Red 500 */

  /* Neutral Colors / Dark Mode Base */
  --bg-body: #0f172a; /* Slate 900 */
  --bg-card: #1e293b; /* Slate 800 */
  --bg-input: #334155; /* Slate 700 */

  /* Text Colors */
  --text-main: #f8fafc; /* Slate 50 */
  --text-muted: #94a3b8; /* Slate 400 */
  --text-link: #818cf8; /* Indigo 400 */

  /* Borders & Shadows */
  --border-color: #334155; /* Slate 700 */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.3), 0 2px 4px -2px rgb(0 0 0 / 0.3);
  --shadow-lg:
    0 10px 15px -3px rgb(0 0 0 / 0.3), 0 4px 6px -4px rgb(0 0 0 / 0.3);

  /* Spacing & Sizing */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --header-height: 4rem;
  --sidebar-width: 16rem;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family:
    "Inter",
    system-ui,
    -apple-system,
    sans-serif;
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.5;
  font-size: 0.95rem;
  min-height: 100vh;
}

a {
  color: var(--text-link);
  text-decoration: none;
  transition: var(--transition-fast);
}

a:hover {
  color: var(--primary-color);
}

ul {
  list-style: none;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 600;
  line-height: 1.25;
  color: var(--text-main);
}

h1 {
  font-size: 1.875rem;
}
h2 {
  font-size: 1.5rem;
}
h3 {
  font-size: 1.25rem;
}

.font-mono {
  font-family: "JetBrains Mono", monospace;
}

.text-sm {
  font-size: 0.875rem;
}
.text-xs {
  font-size: 0.75rem;
}
.text-muted {
  color: var(--text-muted);
}

/* Layout Utilities */
.flex {
  display: flex;
}
.flex-col {
  display: flex;
  flex-direction: column;
}
.justify-between {
  justify-content: space-between;
}
.items-center {
  align-items: center;
}
.items-start {
  align-items: flex-start;
}
.gap-2 {
  gap: 0.5rem;
}
.gap-4 {
  gap: 1rem;
}
.gap-6 {
  gap: 1.5rem;
}
.gap-8 {
  gap: 2rem;
}

.grid {
  display: grid;
}
.grid-cols-2 {
  grid-template-columns: repeat(2, 1fr);
}
.grid-cols-3 {
  grid-template-columns: repeat(3, 1fr);
}
.grid-cols-4 {
  grid-template-columns: repeat(4, 1fr);
}

.w-full {
  width: 100%;
}
.h-full {
  height: 100%;
}
.p-4 {
  padding: 1rem;
}
.p-6 {
  padding: 1.5rem;
}
.px-4 {
  padding-left: 1rem;
  padding-right: 1rem;
}
.py-2 {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}
.mt-2 {
  margin-top: 0.5rem;
}
.mt-4 {
  margin-top: 1rem;
}
.mt-6 {
  margin-top: 1.5rem;
}
.mb-4 {
  margin-bottom: 1rem;
}

/* Components */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
  border: none;
  font-size: 0.875rem;
}

.btn-primary {
  background-color: var(--primary-color);
  color: white;
}

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

.btn-secondary {
  background-color: var(--bg-input);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background-color: var(--bg-card);
}

.btn-danger {
  background-color: rgba(239, 68, 68, 0.1);
  color: var(--danger-color);
  border: 1px solid var(--danger-color);
}

.btn-danger:hover {
  background-color: var(--danger-color);
  color: white;
}

/* Cards */
.card {
  background-color: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
  transition: var(--transition-fast);
}

.card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--primary-color);
}

/* Inputs */
.form-group {
  margin-bottom: 1rem;
}

.label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.input {
  width: 100%;
  padding: 0.625rem 0.875rem;
  background-color: var(--bg-body);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: inherit;
  transition: var(--transition-fast);
}

.input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2);
}

/* Select */
.select {
  width: 100%;
  padding: 0.625rem 0.875rem;
  background-color: var(--bg-body);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: inherit;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%239ca3af' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.5rem center;
  background-repeat: no-repeat;
  background-size: 1.5em 1.5em;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.badge-success {
  background-color: rgba(16, 185, 129, 0.1);
  color: var(--secondary-color);
}
.badge-warning {
  background-color: rgba(245, 158, 11, 0.1);
  color: var(--accent-color);
}
.badge-danger {
  background-color: rgba(239, 68, 68, 0.1);
  color: var(--danger-color);
}
.badge-neutral {
  background-color: var(--bg-input);
  color: var(--text-muted);
}

/* Layout Structure */
.layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-card);
  border-right: 1px solid var(--border-color);
  padding: 1.5rem;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
}

.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 2rem;
  max-width: 1600px;
}

/* Sidebar Navigation */
.nav-item {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  color: var(--text-muted);
  border-radius: var(--radius-md);
  margin-bottom: 0.25rem;
  font-weight: 500;
}

.nav-item:hover,
.nav-item.active {
  background-color: rgba(79, 70, 229, 0.1);
  color: var(--primary-color);
}

.nav-icon {
  width: 1.25rem;
  height: 1.25rem;
  margin-right: 0.75rem;
}

/* Tables */
.table-container {
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.table th,
.table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.table th {
  background-color: rgba(30, 41, 59, 0.5);
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

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

.table tr:hover td {
  background-color: rgba(255, 255, 255, 0.02);
}

/* Login Page Specific */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background:
    radial-gradient(
      circle at top right,
      rgba(79, 70, 229, 0.1),
      transparent 40%
    ),
    radial-gradient(
      circle at bottom left,
      rgba(16, 185, 129, 0.05),
      transparent 40%
    );
}

.login-card {
  width: 100%;
  max-width: 400px;
  background-color: var(--bg-card);
  padding: 2.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
}
