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

:root {
    --bg: #0a0a0a;
    --surface: #141414;
    --surface2: #1e1e1e;
    --border: #2a2a2a;
    --text: #e5e5e5;
    --text2: #a3a3a3;
    --accent: #3b82f6;
    --accent2: #2563eb;
    --green: #10b981;
    --yellow: #f59e0b;
    --red: #ef4444;
    --purple: #8b5cf6;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Layout */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 24px; border-bottom: 1px solid var(--border);
    background: var(--surface); position: relative;
}
.header h1 { font-size: 18px; font-weight: 600; }
.header h1 a { text-decoration: none; }
.nav-links { display: flex; gap: 16px; }
.nav-links a { color: var(--text2); font-size: 14px; text-decoration: none; }
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 4px; flex-direction: column; gap: 4px; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--text); border-radius: 1px; transition: 0.2s; }

@media (max-width: 640px) {
    .nav-toggle { display: flex; }
    .nav-links {
        display: none; position: absolute; top: 100%; right: 0; left: 0;
        flex-direction: column; background: var(--surface); border-bottom: 1px solid var(--border);
        padding: 8px 24px 16px; gap: 8px; z-index: 100;
    }
    .nav-links.open { display: flex; }
    .nav-links a { padding: 8px 0; font-size: 16px; }
}

.page-title {
    font-size: 24px; font-weight: 600;
    margin: 32px 0 24px;
}

/* Cards */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 16px;
}
.card-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 12px;
}
.card-title { font-size: 16px; font-weight: 600; }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 16px; border-radius: 6px;
    font-size: 14px; font-weight: 500;
    border: 1px solid var(--border);
    background: var(--surface2);
    color: var(--text);
    cursor: pointer;
    transition: all 0.15s;
}
.btn:hover { background: var(--border); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

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

.btn-success { background: var(--green); border-color: var(--green); color: white; }
.btn-danger { background: var(--red); border-color: var(--red); color: white; }
.btn-small { padding: 4px 10px; font-size: 12px; }

/* Forms */
input, textarea, select {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px 12px;
    color: var(--text);
    font-size: 14px;
    width: 100%;
    font-family: inherit;
}
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--accent);
}
label { display: block; font-size: 13px; color: var(--text2); margin-bottom: 4px; }
.form-group { margin-bottom: 16px; }

/* Badge */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: white;
}

/* Table */
.table-wrap { overflow-x: auto; }
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
th, td {
    text-align: left;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
}
th { color: var(--text2); font-weight: 500; font-size: 12px; text-transform: uppercase; }
tr:hover td { background: var(--surface2); }

/* Grid */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: 1fr 1fr 1fr; }
.grid-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }

/* Stats */
.stat { text-align: center; }
.stat-value { font-size: 28px; font-weight: 700; }
.stat-label { font-size: 12px; color: var(--text2); margin-top: 2px; }

/* Steps */
.steps {
    display: flex; gap: 4px; margin-bottom: 24px;
}
.step {
    flex: 1; padding: 10px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px; color: var(--text2);
    text-align: center;
}
.step.active { border-color: var(--accent); color: var(--accent); background: rgba(59,130,246,0.08); }
.step.done { border-color: var(--green); color: var(--green); background: rgba(16,185,129,0.08); }

/* Category tree */
.cat-tree { list-style: none; }
.cat-tree .top-cat {
    margin-bottom: 8px;
}
.cat-tree .top-cat-header {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 12px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
}
.cat-tree .top-cat-header:hover { border-color: var(--accent); }
.cat-tree .sub-cats { padding-left: 24px; margin-top: 4px; }
.cat-tree .sub-cat {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 12px;
    border-left: 2px solid var(--border);
    margin-bottom: 2px;
    cursor: pointer;
    border-radius: 0 6px 6px 0;
}
.cat-tree .sub-cat:hover { background: var(--surface2); }
.cat-tree .sub-cat.selected { background: rgba(59,130,246,0.1); border-left-color: var(--accent); }

/* Tag chips */
.tag-grid {
    display: flex; flex-wrap: wrap; gap: 8px;
}
.tag-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 12px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 13px;
}
.tag-chip.approved { border-color: var(--green); }
.tag-chip.rejected { opacity: 0.4; text-decoration: line-through; }
.tag-chip button {
    background: none; border: none; color: var(--text2);
    cursor: pointer; font-size: 14px; padding: 0 2px;
}

/* Detail panel */
.detail-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    position: sticky;
    top: 20px;
}

/* Two-column layout */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }

/* Progress bar */
.progress-bar {
    height: 8px;
    background: var(--surface2);
    border-radius: 4px;
    overflow: hidden;
    margin: 8px 0;
}
.progress-fill {
    height: 100%;
    background: var(--green);
    border-radius: 4px;
    transition: width 0.3s;
}

/* Toast */
.toast {
    position: fixed; bottom: 20px; right: 20px;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s;
    z-index: 1000;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast-success { border-color: var(--green); }
.toast-error { border-color: var(--red); }

/* Loading spinner */
.spinner {
    display: inline-block;
    width: 18px; height: 18px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Modal */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex; align-items: center; justify-content: center;
    z-index: 999;
}
.modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    min-width: 400px;
    max-width: 600px;
}
.modal h3 { margin-bottom: 16px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; }

/* Responsive */
@media (max-width: 768px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .two-col { grid-template-columns: 1fr; }
}
