@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --background: #fafafa;
  --foreground: #09090b;
  --card: #ffffff;
  --card-foreground: #09090b;
  --popover: #ffffff;
  --popover-foreground: #09090b;
  --primary: #18181b;
  --primary-foreground: #fafafa;
  --primary-hover: #27272a;
  --secondary: #f4f4f5;
  --secondary-foreground: #18181b;
  --secondary-hover: #e4e4e7;
  --muted: #f4f4f5;
  --muted-foreground: #71717a;
  --accent: #f4f4f5;
  --accent-foreground: #18181b;
  --destructive: #ef4444;
  --destructive-foreground: #fafafa;
  --destructive-hover: #dc2626;
  --success: #10b981;
  --success-foreground: #ffffff;
  --border: #e4e4e7;
  --input: #e4e4e7;
  --ring: #18181b;
  --radius: 0.5rem;
}

* {
  box-sizing: border-box;
  border: 0 solid var(--border);
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--background);
  color: var(--foreground);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
  font-size: 0.875rem;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Layout Utilities */
.min-h-screen { min-height: 100vh; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.w-full { width: 100%; }
.max-w-md { max-width: 28rem; }
.max-w-lg { max-width: 32rem; }
.max-w-4xl { max-width: 56rem; }
.max-w-7xl { max-width: 80rem; }
.mx-auto { margin-left: auto; margin-right: auto; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.p-2 { padding: 0.5rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.pt-16 { padding-top: 4rem; }
.pb-16 { padding-bottom: 4rem; }
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (min-width: 768px) {
  .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .md\:flex-row { flex-direction: row; }
}

/* Typography */
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted-foreground { color: var(--muted-foreground); }
.text-foreground { color: var(--foreground); }
.text-primary { color: var(--primary); }

/* Components */
.card {
  background-color: var(--card);
  color: var(--card-foreground);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}
.card-header {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}
.card-title {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.025em;
}
.card-description {
  font-size: 0.875rem;
  color: var(--muted-foreground);
}
.card-content {
  padding: 1.5rem;
  padding-top: 0;
}
.card-footer {
  padding: 1.5rem;
  padding-top: 0;
  display: flex;
  align-items: center;
}

/* Forms */
.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--foreground);
  line-height: 1;
}
.form-control {
  display: flex;
  height: 2.5rem;
  width: 100%;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid var(--input);
  background-color: transparent;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--foreground);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form-control[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: var(--muted);
}
.form-control:focus, .form-control:focus-visible {
  outline: none;
  border-color: var(--ring);
  box-shadow: 0 0 0 1px var(--ring);
}
.form-control::placeholder {
  color: var(--muted-foreground);
}
select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23131313%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 0.7rem top 50%;
    background-size: 0.65rem auto;
    padding-right: 2rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  border-radius: calc(var(--radius) - 2px);
  font-size: 0.875rem;
  font-weight: 500;
  height: 2.5rem;
  padding: 0.5rem 1rem;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
  font-family: inherit;
  border: 1px solid transparent;
}
.btn-sm {
  height: 2rem;
  padding: 0 0.75rem;
  font-size: 0.75rem;
}
.btn-lg {
  height: 3rem;
  padding: 0 2rem;
  font-size: 1rem;
}
.btn-primary {
  background-color: var(--primary);
  color: var(--primary-foreground);
}
.btn-primary:hover {
  background-color: var(--primary-hover);
}
.btn-secondary {
  background-color: var(--secondary);
  color: var(--secondary-foreground);
}
.btn-secondary:hover {
  background-color: var(--secondary-hover);
}
.btn-destructive {
  background-color: var(--destructive);
  color: var(--destructive-foreground);
}
.btn-destructive:hover {
  background-color: var(--destructive-hover);
}
.btn-outline {
  background-color: transparent;
  border: 1px solid var(--input);
  color: var(--foreground);
}
.btn-outline:hover {
  background-color: var(--accent);
  color: var(--accent-foreground);
}
.btn-ghost {
  background-color: transparent;
  color: var(--foreground);
}
.btn-ghost:hover {
  background-color: var(--accent);
  color: var(--accent-foreground);
}
.btn-link {
    background: none;
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 4px;
    padding: 0;
    height: auto;
}

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  border: 1px solid var(--border);
  padding: 0.125rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 600;
  transition: background-color 0.15s ease;
}
.badge-default {
  background-color: var(--primary);
  color: var(--primary-foreground);
  border-color: transparent;
}
.badge-secondary {
  background-color: var(--secondary);
  color: var(--secondary-foreground);
  border-color: transparent;
}
.badge-outline {
  color: var(--foreground);
}
.badge-destructive {
  background-color: var(--destructive);
  color: var(--destructive-foreground);
  border-color: transparent;
}
.badge-success {
    background-color: var(--success);
    color: var(--success-foreground);
    border-color: transparent;
}

/* Table */
.table-container {
    width: 100%;
    overflow: auto;
}
.table {
  width: 100%;
  caption-side: bottom;
  font-size: 0.875rem;
  border-collapse: collapse;
}
.table th {
  height: 3rem;
  padding: 0 1rem;
  text-align: left;
  vertical-align: middle;
  font-weight: 500;
  color: var(--muted-foreground);
  border-bottom: 1px solid var(--border);
}
.table td {
  padding: 1rem;
  vertical-align: middle;
  border-bottom: 1px solid var(--border);
}
.table tbody tr:hover {
  background-color: var(--muted);
}
.table tbody tr:last-child td {
    border-bottom: 0;
}

/* Alerts */
.alert {
  padding: 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  border: 1px solid var(--border);
  background: var(--background);
}
.alert-danger {
  border-color: #fca5a5;
  color: #991b1b;
  background-color: #fef2f2;
}
.alert-success {
  border-color: #6ee7b7;
  color: #065f46;
  background-color: #ecfdf5;
}
.alert svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  margin-top: 0.125rem;
}

/* Logo icon */
.logo-icon {
    width: 28px;
    height: 28px;
    background-color: var(--primary);
    color: white;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
}
.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.05em;
    color: var(--foreground);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Dashboard Layout Specifics */
.dash-layout {
    display: flex;
    min-height: 100vh;
    flex-direction: column;
}

.dash-header {
    height: 3.5rem;
    border-bottom: 1px solid var(--border);
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 40;
}

.dash-main {
    display: flex;
    flex: 1;
}

.dash-sidebar {
    width: 16rem;
    border-right: 1px solid var(--border);
    background-color: var(--background);
    padding: 1.5rem 1rem;
    display: none;
    flex-direction: column;
    gap: 0.5rem;
    position: fixed;
    top: 3.5rem; /* below header */
    bottom: 0;
    left: 0;
    z-index: 30;
    overflow-y: auto;
}

.dash-sidebar.open {
    display: flex;
}

@media (min-width: 768px) {
    .dash-sidebar {
        display: flex;
        position: static;
        z-index: auto;
    }
}

.dash-sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    color: var(--muted-foreground);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.15s ease;
}

.dash-sidebar-link:hover {
    background-color: var(--accent);
    color: var(--accent-foreground);
}

.dash-sidebar-link.active {
    background-color: var(--accent);
    color: var(--foreground);
    font-weight: 600;
}

.dash-sidebar-link svg {
    width: 1.25rem;
    height: 1.25rem;
}

.dash-content {
    flex: 1;
    padding: 1.5rem 1rem;
    max-width: 100vw;
    width: 100%;
}

@media (min-width: 768px) {
    .dash-content {
        padding: 2rem;
        max-width: calc(100vw - 16rem);
    }
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.page-title {
    font-size: 1.875rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}

/* Modal / Sheet Overlay */
.overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

/* Desktop header layout specific */
.header-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.header-nav-link {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--muted-foreground);
    transition: color 0.15s ease;
}

.header-nav-link:hover, .header-nav-link.active {
    color: var(--foreground);
}
