/* MediaRiver Desktop — Dark Theme */

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

body {
    background: #1a1a1a;
    color: #e0e0e0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.5;
}

a { color: #60a5fa; text-decoration: none; }
a:hover { text-decoration: underline; }

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 220px;
    height: 100vh;
    background: #111;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #333;
    z-index: 100;
}

.sidebar-brand {
    padding: 20px 16px;
    font-size: 1.2rem;
    font-weight: 700;
    border-bottom: 1px solid #333;
    color: #fff;
}

.sidebar-nav {
    list-style: none;
    padding: 8px 0;
    flex: 1;
}

.sidebar-nav a {
    display: block;
    padding: 10px 16px;
    color: #bbb;
    border-left: 3px solid transparent;
    transition: background 0.15s, border-color 0.15s;
}

.sidebar-nav a:hover {
    background: #222;
    color: #e0e0e0;
    text-decoration: none;
}

.sidebar-nav a.active {
    background: #2a2a2a;
    color: #fff;
    border-left-color: #2563eb;
}

/* Main content */
.main {
    margin-left: 220px;
    padding: 24px;
    min-height: 100vh;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 20px;
}

/* Cards */
.card {
    background: #2a2a2a;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 16px;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
}

.stat-label {
    font-size: 0.85rem;
    color: #888;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #333;
}

th {
    font-weight: 600;
    color: #aaa;
    font-size: 0.85rem;
    text-transform: uppercase;
}

tr:nth-child(odd) td { background: #252525; }
tr:nth-child(even) td { background: #2a2a2a; }

/* Status badges */
.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-done { background: #166534; color: #86efac; }
.badge-failed { background: #7f1d1d; color: #fca5a5; }
.badge-pending { background: #713f12; color: #fde68a; }
.badge-running { background: #1e3a5f; color: #93c5fd; }

/* Buttons */
button, .btn {
    display: inline-block;
    padding: 8px 16px;
    background: #3a3a3a;
    color: #e0e0e0;
    border: 1px solid #555;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.15s;
}

button:hover, .btn:hover {
    background: #4a4a4a;
}

.btn-accent {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}

.btn-accent:hover {
    background: #1d4ed8;
}

/* Form inputs */
input[type="text"],
input[type="number"],
input[type="url"],
select,
textarea {
    background: #333;
    border: 1px solid #555;
    color: #e0e0e0;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.9rem;
    width: 100%;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #2563eb;
}

label {
    display: block;
    margin-bottom: 4px;
    font-weight: 500;
    font-size: 0.9rem;
}

.form-group {
    margin-bottom: 16px;
}

/* Log viewer */
.log-viewer {
    background: #111;
    font-family: "Cascadia Code", "Fira Code", "Consolas", monospace;
    font-size: 0.82rem;
    max-height: 70vh;
    overflow: auto;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #333;
    line-height: 1.6;
}

.log-viewer div {
    white-space: pre-wrap;
    word-break: break-all;
}

/* Filter bar */
.filter-bar {
    display: flex;
    gap: 12px;
    align-items: end;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.filter-bar .form-group {
    margin-bottom: 0;
}

.filter-bar select {
    width: auto;
    min-width: 160px;
}

/* Pagination */
.pagination {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    justify-content: center;
}

/* Workflow card expand */
.workflow-yaml {
    background: #111;
    font-family: monospace;
    font-size: 0.82rem;
    padding: 12px;
    border-radius: 6px;
    margin-top: 8px;
    white-space: pre-wrap;
    display: none;
}

.workflow-yaml.open {
    display: block;
}

/* Utility */
.mb-4 { margin-bottom: 16px; }
.mt-4 { margin-top: 16px; }
.text-muted { color: #888; }
.text-sm { font-size: 0.85rem; }
.truncate { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
