/* Spartan, Construction Professional Aesthetic */
:root {
    --bg: #ffffff;
    --surface: #f4f4f4;
    --border: #000000;
    --text: #000000;
    --text-muted: #555555;
    --accent: #ffcc00; /* High visibility industrial yellow */
    --accent-hover: #e6b800;
}

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

body {
    font-family: system-ui, -apple-system, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.5;
    overflow: hidden;
}

.hidden { display: none !important; }

/* Typography */
h1, h2, h3 {
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
}

/* Buttons */
.btn {
    appearance: none;
    background: transparent;
    border: 2px solid var(--border);
    color: var(--text);
    padding: 0.5rem 1rem;
    font-weight: 600;
    text-transform: uppercase;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.2s;
}

.btn:hover { background: var(--surface); }

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

.btn.primary:hover { background: #333; }

.btn.small { padding: 0.25rem 0.5rem; }

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
}

input[type="text"], select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-family: inherit;
    border-radius: 0; /* Strict sharp edges */
}

input[type="text"]:focus, select:focus {
    outline: none;
    border-color: var(--accent);
}

.inline-form {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.inline-form input { flex: 1; }

/* Layout */
#app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* Sidebar (Off-canvas on mobile) */
#sidebar {
    width: 300px;
    border-right: 2px solid var(--border);
    background: var(--surface);
    display: flex;
    flex-direction: column;
    position: absolute;
    z-index: 100;
    height: 100%;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

#sidebar.open {
    transform: translateX(0);
}

@media (min-width: 768px) {
    #sidebar {
        position: static;
        transform: translateX(0);
    }
    #close-sidebar { display: none; }
    #open-sidebar { display: none; }
}

.sidebar-header {
    padding: 1rem;
    border-bottom: 2px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--accent);
}

#tree-container {
    padding: 1rem;
    overflow-y: auto;
    flex: 1;
}

/* Tree Navigation */
.tree-node {
    cursor: pointer;
    padding: 0.5rem;
    border: 1px solid transparent;
    margin-bottom: 2px;
    font-weight: 600;
    font-size: 0.9rem;
}

.tree-node:hover {
    border-color: var(--border);
}

.tree-node.active {
    background: var(--border);
    color: var(--bg);
}

.tree-children {
    padding-left: 1rem;
    border-left: 1px dashed var(--text-muted);
    margin-left: 0.5rem;
}

/* Workspace Hero */
#workspace {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: var(--bg);
    overflow-y: auto;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 2px solid var(--border);
    background: var(--surface);
}

.breadcrumb {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
}

.actions {
    display: flex;
    gap: 0.5rem;
}

#hero-content {
    padding: 2rem;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}

#hero-title {
    font-size: 2rem;
    margin-bottom: 2rem;
    border-bottom: 4px solid var(--border);
    padding-bottom: 0.5rem;
}

.panel {
    border: 2px solid var(--border);
    padding: 1.5rem;
    margin-bottom: 2rem;
    background: var(--bg);
}

.panel h3 {
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--border);
    padding-bottom: 0.5rem;
    display: inline-block;
}

/* Data Grids */
.data-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 1px;
    background: var(--border);
    border: 2px solid var(--border);
}

.data-row {
    display: contents;
}

.data-cell {
    background: var(--bg);
    padding: 0.75rem;
    font-size: 0.9rem;
}

.data-cell.key {
    font-weight: 700;
    text-transform: uppercase;
    background: var(--surface);
}

.list-group {
    border: 2px solid var(--border);
    border-bottom: none;
}

.list-item {
    padding: 0.75rem;
    border-bottom: 2px solid var(--border);
    cursor: pointer;
    font-weight: 600;
}
.list-item:hover { background: var(--surface); }

/* Modals */
.modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: var(--bg);
    padding: 2rem;
    border: 4px solid var(--border);
    width: 90%;
    max-width: 400px;
}

.modal-content h2 { margin-bottom: 1rem; }
.modal-content p { margin-bottom: 1.5rem; font-size: 0.9rem; }

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
}


/* Sidebar Footer */
.sidebar-footer {
    padding: 1rem;
    border-top: 2px solid var(--border);
    margin-top: auto;
}
