/* Linear-like Design System */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');

:root {
    /* Colors */
    --bg-app: #141414;
    /* Extremely dark grey */
    --bg-panel: #1e1e1e;
    /* Sidebar/Card bg */
    --bg-hover: #262626;
    --border-subtle: #2e2e2e;
    --border-focus: #5e5e5e;

    /* Text */
    --text-primary: #f2f2f2;
    --text-secondary: #a1a1a1;
    --text-tertiary: #6b6b6b;

    /* Accents */
    --accent-primary: #5e6ad2;
    /* Blurple-ish */
    --accent-hover: #6e7be3;
    --accent-muted: rgba(94, 106, 210, 0.15);

    /* Spacing */
    --space-xs: 4px;
    --space-s: 8px;
    --space-m: 16px;
    --space-l: 24px;
    --space-xl: 32px;

    /* Radius */
    --radius-s: 4px;
    --radius-m: 6px;
    --radius-l: 8px;

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

body {
    background-color: var(--bg-app);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;

    /* Layout */
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar */
.app-sidebar {
    width: 240px;
    background-color: var(--bg-panel);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    padding: var(--space-m);
    flex-shrink: 0;
}

.brand-section {
    padding-bottom: var(--space-l);
    margin-bottom: var(--space-m);
    border-bottom: 1px solid var(--border-subtle);
    font-weight: 600;
    font-size: 16px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.brand-logo {
    width: 20px;
    height: 20px;
    background: var(--accent-primary);
    border-radius: 4px;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 6px 12px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-m);
    font-weight: 500;
    transition: all 0.15s ease;
}

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

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

.nav-item svg {
    margin-right: 10px;
    width: 16px;
    height: 16px;
    opacity: 0.8;
}

/* Main Content */
.app-main {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-xl);
    max-width: 1200px;
}

/* Typography Headers */
h1 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: var(--space-l);
    color: var(--text-primary);
}

h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: var(--space-m);
    color: var(--text-primary);
}

h3 {
    font-size: 15px;
    font-weight: 500;
    margin-bottom: var(--space-s);
    color: var(--text-secondary);
}

/* Cards / Panels */
.panel {
    background-color: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-l);
    padding: var(--space-l);
    margin-bottom: var(--space-l);
}

/* Forms */
label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

input,
select,
textarea {
    background-color: #121212;
    /* Darker than panel */
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: var(--radius-m);
    width: 100%;
    font-family: inherit;
    font-size: 14px;
    transition: border-color 0.15s;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--border-focus);
}

/* Custom Select Override for Dark Mode */
.custom-select-wrapper {
    margin-bottom: 0;
}

.custom-select .custom-select__trigger {
    background-color: #121212;
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
}

.custom-select.open .custom-select__trigger {
    border-color: var(--border-focus);
}

.custom-select__options {
    background-color: var(--bg-panel);
    border: 1px solid var(--border-subtle);
}

.custom-option {
    color: var(--text-secondary);
}

.custom-option:hover {
    background-color: var(--bg-hover);
    color: var(--text-primary);
}

.custom-option.selected {
    background-color: var(--accent-primary);
    color: white;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

thead th {
    text-align: left;
    color: var(--text-tertiary);
    font-weight: 500;
    padding: var(--space-s) var(--space-m);
    border-bottom: 1px solid var(--border-subtle);
}

tbody td {
    padding: var(--space-m);
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-secondary);
}

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

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

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--radius-m);
    cursor: pointer;
    transition: all 0.15s;
    border: 1px solid transparent;
}

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

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

.btn-secondary {
    background-color: transparent;
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    border-color: var(--text-secondary);
    color: var(--text-primary);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-subtle);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-focus);
}

/* Utilities */
.text-muted {
    color: var(--text-tertiary);
}

.flex-row {
    display: flex;
    gap: var(--space-m);
}

.flex-col {
    display: flex;
    flex-direction: column;
    gap: var(--space-m);
}

.mt-m {
    margin-top: var(--space-m);
}