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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #1a1d23;
    color: #c8ccd0;
    font-size: 14px;
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
}

/* Nav — scrollable on mobile */
nav {
    background: #12141a;
    padding: 10px 16px;
    display: flex;
    gap: 16px;
    align-items: center;
    border-bottom: 1px solid #2a2d35;
    position: sticky;
    top: 0;
    z-index: 100;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
}

nav a { color: #8a8f98; text-decoration: none; font-size: 13px; flex-shrink: 0; }
nav a:hover { color: #e0e0e0; }
nav .brand { color: #e0e0e0; font-weight: 600; font-size: 15px; margin-right: 4px; }

main { max-width: 960px; margin: 0 auto; padding: 20px 16px; }

h1 { font-size: 20px; font-weight: 600; color: #e0e0e0; margin-bottom: 4px; }
h2 { font-size: 13px; font-weight: 600; color: #8a8f98; margin: 24px 0 8px 0; }

.flash {
    background: #2a3a2a; color: #7bc67b;
    padding: 8px 12px; border-radius: 4px; margin-bottom: 16px; font-size: 13px;
}

.guide {
    background: #1a2030; border-left: 3px solid #3a5a8a;
    padding: 12px 14px; border-radius: 3px; margin-bottom: 16px;
    font-size: 13px; line-height: 1.6; color: #a0b0c8;
}
.guide strong { color: #c0d0e8; }
.guide code { background: #12141a; padding: 1px 5px; border-radius: 2px; font-size: 12px; color: #7bb5e8; }
.guide a { color: #7bb5e8; }

.hint { font-size: 11px; color: #555a62; font-weight: 400; }

/* Page header */
.page-title {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 4px;
}
.page-title h1 { margin-bottom: 0; }
.page-title a { font-size: 12px; color: #555a62; }
.page-title a:hover { color: #7bb5e8; }

/* Client/software detail line */
.detail-line {
    font-size: 13px;
    color: #c8ccd0;
    margin-bottom: 8px;
    line-height: 2;
}
.detail-line span { margin-right: 24px; display: inline-block; }
.detail-line .dl-label { font-size: 11px; color: #555a62; margin-right: 6px; }

/* Sections */
.section { margin-top: 12px; padding-top: 12px; border-top: 1px solid #1e2128; }

.section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 6px;
}

.section-title {
    font-size: 11px; font-weight: 600; color: #555a62;
    text-transform: uppercase; letter-spacing: 0.5px;
}

.section-action { font-size: 12px; color: #555a62; }
.section-action:hover { color: #7bb5e8; }

/* Tables — horizontally scrollable on mobile */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

table { width: 100%; border-collapse: collapse; }
th {
    text-align: left; font-size: 11px; text-transform: uppercase;
    color: #444950; padding: 4px 8px; border-bottom: 1px solid #252830;
}
td { padding: 7px 8px; font-size: 13px; white-space: nowrap; }
tr:hover { background: #1e2128; }

/* Status — text only */
.status { font-size: 11px; font-weight: 500; color: #555a62; }
.status-active { color: #5cb85c; }
.status-proven { color: #5bc0de; }
.status-stable { color: #5bdeb8; }
.status-draft { color: #c0b85c; }
.status-inactive, .status-archived { color: #555a62; }
.status-in-progress { color: #d4a84b; }
.expiring { color: #d9534f; font-weight: 600; }

/* Links */
a { color: #5b9bd5; text-decoration: none; }
a:hover { color: #7bb5e8; }

/* Buttons */
.btn {
    display: inline-block; padding: 6px 14px; background: #252830; color: #8a8f98;
    border: 1px solid #333840; border-radius: 3px; font-size: 12px; cursor: pointer;
    text-decoration: none; touch-action: manipulation;
}
.btn:hover { background: #333840; color: #c8ccd0; }
.btn-primary { background: #1a3a5a; border-color: #2a5a8a; color: #7bb5e8; }
.btn-primary:hover { background: #2a4a6a; }
.btn-danger { color: #d9534f; background: none; border: none; padding: 2px 6px; }
.btn-danger:hover { color: #ff6b6b; }
.btn-sm { padding: 3px 8px; font-size: 11px; }

/* Forms */
form { margin-bottom: 16px; }

label {
    display: block; font-size: 12px; color: #6a6f78;
    margin-bottom: 4px; margin-top: 16px;
}

label .hint { margin-left: 4px; }

input[type="text"], input[type="date"], textarea, select {
    width: 100%; padding: 8px 10px; background: #14161c; border: 1px solid #252830;
    border-radius: 3px; color: #c8ccd0; font-size: 14px; font-family: inherit;
}
input[type="file"] { color: #8a8f98; padding: 8px 0; }
input:focus, textarea:focus, select:focus { outline: none; border-color: #3a5a8a; }
textarea { resize: vertical; min-height: 60px; }

.form-actions {
    margin-top: 20px; display: flex; gap: 8px; align-items: center;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 20px;
}

.form-grid label { margin-top: 12px; }

.inline-form { display: inline; }

/* Dashboard */
.dash-grid { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.dash-card { background: #1e2128; border-radius: 4px; padding: 14px; }
.dash-stat { font-size: 28px; font-weight: 700; color: #e0e0e0; }
.dash-label { font-size: 11px; color: #555a62; text-transform: uppercase; }

/* Prompt blocks */
.prompt-block {
    position: relative; background: #14161c; border: 1px solid #252830;
    border-radius: 4px; padding: 12px; margin-bottom: 20px;
}
.prompt-block pre {
    font-family: 'SF Mono', 'Fira Code', monospace; font-size: 12px; line-height: 1.5;
    color: #8a9aaa; white-space: pre-wrap; word-wrap: break-word; margin: 0;
}
.copy-btn { position: absolute; top: 8px; right: 8px; }

/* Roadmap */
.roadmap-item { padding: 8px 0; }
.roadmap-title { font-size: 14px; color: #c8ccd0; }
.roadmap-title a { color: #c8ccd0; }
.roadmap-title a:hover { color: #7bb5e8; }
.roadmap-cat { font-size: 11px; color: #555a62; margin-left: 6px; }
.roadmap-desc { font-size: 12px; color: #6a6f78; margin-top: 2px; }
.roadmap-done { opacity: 0.4; }
.roadmap-done .roadmap-title a { text-decoration: line-through; }

/* Ops issue groups */
.ops-group {
    border-left: 3px solid #555a62;
    padding: 10px 14px;
    margin-bottom: 16px;
    border-radius: 2px;
}

.ops-critical { border-left-color: #d9534f; }
.ops-warn { border-left-color: #d4a84b; }

.ops-group-header {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: #6a6f78;
    margin-bottom: 6px;
}

.ops-critical .ops-group-header { color: #d9534f; }
.ops-warn .ops-group-header { color: #d4a84b; }

.ops-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 3px 0;
    font-size: 13px;
}

.ops-item a { color: #c8ccd0; }
.ops-item a:hover { color: #7bb5e8; }
.ops-critical .ops-item a { color: #e8a0a0; }

.ops-cost {
    font-size: 12px;
    color: #555a62;
    margin-left: 12px;
    flex-shrink: 0;
}

/* Mobile */
@media (max-width: 640px) {
    main { padding: 16px 12px; }
    .dash-grid { grid-template-columns: 1fr 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    h1 { font-size: 18px; }
    .detail-line span { display: block; margin-right: 0; margin-bottom: 2px; }
    table { display: block; overflow-x: auto; }
    pre { font-size: 11px !important; }
    .page-title h1 { font-size: 16px; }
}
