/* K FORMA design language — dark nav, #00BCD4 accent, Arial Narrow, compact grid */

* {
    font-family: "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
}

:root {
    --kf-primary: #00BCD4;
    --kf-dark: #1a1f2e;
    --kf-dark-lighter: #252b3b;
    --kf-text: #212529;
    --kf-text-muted: #6c757d;
    --kf-bg-alt: #f8f9fa;
    --kf-border: #e9ecef;
    --kf-success: #22c55e;
    --kf-danger: #ef4444;
}

/* NAVIGATION */
.navbar-kforma {
    background: linear-gradient(180deg, var(--kf-dark) 0%, var(--kf-dark-lighter) 100%);
    border-bottom: 2px solid var(--kf-primary);
    padding: 0.5rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}
.nav-container {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}
.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: white;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    white-space: nowrap;
}
.nav-logo {
    height: 32px;
    width: auto;
}
.nav-links {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0.25rem;
    flex-wrap: wrap;
}
.nav-links li a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    padding: 0.4rem 0.75rem;
    border-radius: 4px;
    transition: all 0.2s;
}
.nav-links li a:hover {
    color: white;
    background: rgba(0, 188, 212, 0.15);
}
.nav-user {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 1rem;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}
.theme-toggle {
    background: none;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0.2rem 0.4rem;
    line-height: 1;
    color: rgba(255, 255, 255, 0.7);
    transition: color 0.2s;
}
.theme-toggle:hover {
    color: var(--kf-primary);
}
.nav-user-link {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}
.nav-user-link:hover {
    color: var(--kf-primary);
}
.nav-logout {
    color: var(--kf-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    padding: 0.3rem 0.75rem;
    border: 1px solid rgba(0, 188, 212, 0.4);
    border-radius: 4px;
    transition: all 0.2s;
}
.nav-logout:hover {
    background: var(--kf-primary);
    color: white;
}

/* MAIN CONTENT */
.main-content {
    padding-top: 1rem;
    padding-bottom: 2rem;
    max-width: 1400px;
}

/* HEADINGS */
h1, h2, h3, h4 {
    color: var(--kf-text);
    font-weight: 700;
    letter-spacing: 0.03em;
}
h2 {
    font-size: 1.3rem;
    text-transform: uppercase;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid var(--kf-primary);
    display: inline-block;
    margin-bottom: 1.5rem;
}

/* BUTTONS */
[role="button"], button, input[type="submit"] {
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.85rem;
    font-weight: 600;
}
button:not(.outline):not(.secondary), [role="button"]:not(.outline):not(.secondary) {
    background-color: var(--kf-primary);
    border-color: var(--kf-primary);
}
button:not(.outline):not(.secondary):hover, [role="button"]:not(.outline):not(.secondary):hover {
    background-color: #00a5bb;
    border-color: #00a5bb;
}

/* TABLES — compact, sortable */
table {
    font-size: 0.82rem;
    border-collapse: collapse;
    width: 100%;
    table-layout: fixed;
}
thead th {
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.7rem;
    color: var(--kf-text-muted);
    font-weight: 700;
    border-bottom: 2px solid var(--kf-primary);
    padding: 0.4rem 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    user-select: none;
}
thead th:hover {
    color: var(--kf-primary);
}
thead th.sorted-asc::after {
    content: " \25B2";
    font-size: 0.6rem;
}
thead th.sorted-desc::after {
    content: " \25BC";
    font-size: 0.6rem;
}
tbody td {
    padding: 0.35rem 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-bottom: 1px solid var(--kf-border);
}
tbody tr:hover {
    background-color: rgba(0, 188, 212, 0.04);
}

/* CARDS / ARTICLES */
article {
    border: 1px solid var(--kf-border);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* STAT CARDS */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.stat-card {
    text-align: center;
    border-top: 3px solid var(--kf-primary);
}
.stat-card h3 {
    font-size: 2.2rem;
    margin-bottom: 0.25rem;
    color: var(--kf-primary);
    border: none;
    display: block;
    padding: 0;
}
.stat-card small {
    color: var(--kf-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-size: 0.75rem;
}

/* TIMER */
.timer-display {
    font-size: 2.5rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.05em;
}
.timer-running {
    color: var(--kf-success);
}

/* FORMS — compact */
label {
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--kf-text-muted);
    margin-bottom: 0.2rem;
}
input, select, textarea {
    font-size: 0.85rem;
    padding: 0.4rem 0.6rem;
}
.grid {
    gap: 0.75rem;
}
input:focus, select:focus, textarea:focus {
    border-color: var(--kf-primary);
    box-shadow: 0 0 0 2px rgba(0, 188, 212, 0.15);
}

/* MESSAGES */
.message {
    border-left: 4px solid var(--kf-primary);
    border-radius: 4px;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.message.error {
    border-left-color: var(--kf-danger);
}

/* ERRORS */
small.error {
    color: var(--kf-danger);
    font-size: 0.8rem;
}

/* LINKS */
a {
    color: var(--kf-primary);
}
a:hover {
    color: #00a5bb;
}

/* LOGIN PAGE */
.login-card {
    max-width: 400px;
    margin: 3rem auto;
    border-top: 3px solid var(--kf-primary);
}
.login-card .login-logo {
    display: block;
    height: 48px;
    margin: 0 auto 1rem;
}
.login-card h2 {
    text-align: center;
    border: none;
    display: block;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    .nav-user {
        margin-left: 0;
    }
    .nav-links {
        gap: 0;
    }
    .stats-grid {
        grid-template-columns: 1fr;
    }
}
