/* 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;
    --kf-warning: #f59e0b;
}

/* 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;
    border-bottom: 2px solid transparent;
}
.nav-links li a:hover {
    color: white;
    background: rgba(0, 188, 212, 0.15);
}
.nav-links li a.active {
    color: white;
    background: rgba(0, 188, 212, 0.2);
    border-bottom: 2px solid var(--kf-primary);
}
.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;
}
.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    color: rgba(255, 255, 255, 0.7);
    transition: color 0.2s;
    flex-shrink: 0;
}
.icon-btn:hover {
    color: var(--kf-primary);
}
.theme-toggle {
    /* inherits icon-btn */
}
.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;
}

/* TIMER BANNER — persistent across all pages */
.timer-banner {
    background: var(--kf-dark-lighter);
    color: white;
    padding: 0.4rem 0;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--kf-primary);
}

/* 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):not(.btn-action), [role="button"]:not(.outline):not(.secondary):not(.btn-action) {
    background-color: var(--kf-primary);
    border-color: var(--kf-primary);
}
button:not(.outline):not(.secondary):not(.btn-action):hover, [role="button"]:not(.outline):not(.secondary):not(.btn-action):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;
}

/* PROJECT COLOR DOT */
.project-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 0.3rem;
    vertical-align: middle;
}

/* CONTINUE BUTTON */
.btn-continue {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    padding: 0.1rem 0.3rem;
    color: #999;
    transition: color 0.2s;
}
.btn-continue:hover {
    color: var(--kf-success);
}

/* WEEKEND COLUMNS */
.weekend-col {
    background-color: rgba(239, 68, 68, 0.08);
    color: var(--kf-danger);
}
.weekend-col input {
    color: var(--kf-danger);
}

/* WEEKLY TIMESHEET */
.weekly-table {
    table-layout: auto;
}
.weekly-table .sticky-col {
    position: sticky;
    left: 0;
    background: var(--pico-background-color);
    z-index: 1;
    min-width: 180px;
    max-width: 250px;
}
.weekly-table input[type="number"] {
    border: 1px solid var(--kf-border);
    border-radius: 4px;
    font-variant-numeric: tabular-nums;
}
.weekly-table input[type="number"]:focus {
    border-color: var(--kf-primary);
    background: rgba(0, 188, 212, 0.05);
}
.weekly-table tfoot td {
    border-top: 2px solid var(--kf-primary);
    font-weight: 700;
}

/* 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;
    }
}

/* NOTIFICATIONS */
.notification-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}
.notification-bell {
    /* inherits icon-btn — no extra overrides needed */
}
.notification-badge {
    position: absolute;
    top: -4px;
    right: -2px;
    background: var(--kf-danger);
    color: white;
    font-size: 0.65rem;
    min-width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}
.notification-panel {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    width: 320px;
    max-height: 400px;
    overflow-y: auto;
    background: var(--kf-dark);
    border: 1px solid rgba(0,188,212,0.3);
    border-radius: 8px;
    z-index: 200;
    margin-top: 0.5rem;
}
.notification-panel.open {
    display: block;
}
.notification-item {
    display: block;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    color: var(--kf-text-muted);
    text-decoration: none;
    font-size: 0.85rem;
}
.notification-item.unread {
    color: white;
    background: rgba(0,188,212,0.08);
}
.notification-item:hover {
    background: rgba(0,188,212,0.15);
}
.notification-item small {
    display: block;
    color: var(--kf-text-muted);
    margin-top: 0.25rem;
    font-size: 0.75rem;
}

/* LEAVE CALENDAR */
.leave-calendar {
    border-collapse: collapse;
    width: 100%;
    table-layout: fixed;
}
.leave-calendar th {
    text-align: center;
    padding: 0.5rem;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.leave-calendar td {
    text-align: center;
    padding: 0.75rem 0.5rem;
    cursor: pointer;
    border-radius: 4px;
    font-size: 0.95rem;
    transition: background 0.15s;
}
.leave-calendar td:hover:not(.cal-empty):not(.leave-approved):not(.leave-pending) {
    background: rgba(0, 188, 212, 0.15);
}
.cal-empty { cursor: default; }
.cal-today { font-weight: 700; box-shadow: inset 0 0 0 2px var(--kf-primary); }
.leave-approved { background: rgba(34, 197, 94, 0.25) !important; color: var(--kf-success); cursor: default; }
.leave-pending { background: rgba(245, 158, 11, 0.25) !important; color: #f59e0b; cursor: default; }
.leave-rejected { background: rgba(239, 68, 68, 0.1); text-decoration: line-through; color: var(--kf-text-muted); }
.cal-selected-start, .cal-selected-end { background: var(--kf-primary) !important; color: white !important; }
.cal-selected-range { background: rgba(0, 188, 212, 0.2) !important; }

/* GANTT CHART */
/* GANTT CHART */
.gantt-wrap {
    overflow-x: auto;
    margin-bottom: 1rem;
    min-width: 0;
}
.gantt-row {
    display: flex;
    align-items: stretch;
    border-bottom: 1px solid var(--kf-border);
    min-height: 34px;
}
.gantt-header {
    min-height: auto;
    border-bottom: 2px solid var(--kf-border);
}
.gantt-label {
    width: 140px;
    min-width: 140px;
    padding: 0.25rem 0.5rem;
    font-size: 0.82rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
}
.gantt-month-col {
    flex: 1;
    min-width: 200px;
    border-left: 1px solid var(--kf-border);
    display: flex;
    flex-direction: column;
}
.gantt-month-title {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--kf-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.2rem 0.4rem;
    text-align: center;
}
.gantt-bars {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    min-height: 28px;
}
.gantt-day-marker {
    flex: 1;
    text-align: center;
    border-left: 1px solid var(--kf-border);
    font-size: 0.55rem;
    color: var(--kf-text-muted);
    padding: 0;
    line-height: 1.8;
    max-width: 18px;
}
.gantt-bar {
    position: absolute;
    height: 20px;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    color: white;
    overflow: hidden;
    white-space: nowrap;
    padding: 0 2px;
}
.gantt-approved { background: rgba(34, 197, 94, 0.75); }
.gantt-pending { background: rgba(245, 158, 11, 0.75); }

[data-theme="dark"] .gantt-row        { border-bottom: 1px solid rgba(255,255,255,0.07); }
[data-theme="dark"] .gantt-header     { border-bottom: 2px solid rgba(255,255,255,0.12); }
[data-theme="dark"] .gantt-month-col  { border-left:   1px solid rgba(255,255,255,0.1);  }
[data-theme="dark"] .gantt-day-marker { border-left:   1px solid rgba(255,255,255,0.06); }
[data-theme="dark"] .mini-month       { border:        1px solid rgba(255,255,255,0.08); }

/* YEAR GRID (12-month view) */
.year-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}
.mini-month {
    border: 1px solid var(--kf-border);
    border-radius: 8px;
    padding: 0.6rem 0.5rem;
}
.mini-month-header {
    text-align: center;
    font-weight: 600;
    font-size: 0.8rem;
    margin-bottom: 0.4rem;
    color: var(--kf-primary);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.mini-calendar {
    border-collapse: collapse;
    width: 100%;
    table-layout: fixed;
}
.mini-calendar th {
    text-align: center;
    font-size: 0.6rem;
    padding: 0.15rem 0;
    color: var(--kf-text-muted);
    text-transform: uppercase;
}
.mini-day {
    text-align: center;
    padding: 0.2rem 0.1rem;
    font-size: 0.72rem;
    cursor: pointer;
    border-radius: 3px;
    line-height: 1.6;
}
.mini-day:hover:not(.leave-approved):not(.leave-pending) {
    background: rgba(0, 188, 212, 0.15);
}
@media (max-width: 900px) {
    .year-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
    .year-grid { grid-template-columns: 1fr; }
}

/* ADMIN ACTION BUTTONS — compact, used inside table cells */
.btn-action {
    display: inline-block;
    padding: 0.2rem 0.65rem;
    font-size: 0.78rem;
    border-radius: 4px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    border: none;
    line-height: 1.4;
}
.btn-success         { background: var(--kf-success); color: white; }
.btn-success:hover   { background: #1aad52; }
.btn-danger          { background: var(--kf-danger);  color: white; }
.btn-danger:hover    { background: #dc2626; }
.btn-danger-outline  { background: none; border: 1px solid var(--kf-danger); color: var(--kf-danger); }
.btn-ghost           { background: none; border: none; color: var(--kf-text-muted); }
.btn-ghost:hover     { color: var(--kf-danger); }

/* STATUS BADGES */
.badge {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: 12px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.badge-approved { background: rgba(34,197,94,0.15);  color: var(--kf-success); }
.badge-rejected { background: rgba(239,68,68,0.12);  color: var(--kf-danger);  }
.badge-pending  { background: rgba(245,158,11,0.15); color: var(--kf-warning); }

/* ACTION CELL — flex row of buttons in a td */
.action-cell { display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; }

/* REJECT EXPAND ROW */
.reject-form > td    { padding: 0.5rem 0.75rem; background: rgba(239,68,68,0.04); }
.reject-textarea     { width: 100%; font-size: 0.82rem; resize: vertical; min-height: 4rem; }
.reject-actions      { display: flex; gap: 0.5rem; margin-top: 0.4rem; }

/* MISC */
.heading-pending { color: var(--kf-warning); }
.text-muted-p    { color: var(--kf-text-muted); }
