:root {
    --bg: #f5f2ec;
    --sidebar: #1f2937;
    --sidebar-text: #f9fafb;
    --accent: #d97706;
    --accent-dark: #b45309;
    --card: #ffffff;
    --text: #1f2937;
    --muted: #6b7280;
    --border: #e5e7eb;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Gill Sans", "Trebuchet MS", sans-serif;
    background: var(--bg);
    color: var(--text);
}

.app {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 220px;
    background: var(--sidebar);
    color: var(--sidebar-text);
    padding: 24px 18px;
}

.brand {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 24px;
}

.sidebar nav a {
    display: block;
    color: var(--sidebar-text);
    text-decoration: none;
    margin-bottom: 12px;
    padding: 8px 10px;
    border-radius: 8px;
}

.sidebar nav a:hover {
    background: rgba(255, 255, 255, 0.08);
}

.content {
    flex: 1;
    padding: 32px;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.page-header h1 {
    margin: 0 0 6px 0;
    font-size: 28px;
}

.actions {
    display: flex;
    gap: 12px;
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(17, 24, 39, 0.06);
}

.card.narrow {
    max-width: 420px;
    margin: 40px auto;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

.stat {
    background: var(--card);
    border-radius: 14px;
    padding: 18px;
    border: 1px solid var(--border);
}

.stat-label {
    color: var(--muted);
    margin-bottom: 6px;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
}

.form {
    display: grid;
    gap: 14px;
}

.grid-form {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.form label {
    display: grid;
    gap: 6px;
    font-weight: 600;
    color: var(--text);
}

.form input,
.form select,
.form textarea {
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    font-size: 14px;
}

.form input.readonly {
    background: #f3f4f6;
    color: var(--muted);
}

.full {
    grid-column: 1 / -1;
}

.btn {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    font-weight: 600;
}

.btn.secondary {
    background: #e5e7eb;
    color: var(--text);
}

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

.btn.secondary:hover {
    background: #d1d5db;
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card);
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.table th,
.table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

.table th {
    background: #f9fafb;
    font-weight: 600;
}

.table tr:last-child td {
    border-bottom: none;
}

.inline {
    display: inline;
}

.link {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    padding: 0;
    font-weight: 600;
}

.alert {
    background: #fef3c7;
    border: 1px solid #fcd34d;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.search {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.search input {
    flex: 1;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.doc-list {
    list-style: none;
    padding: 0;
    margin: 12px 0 0;
}

.doc-list li {
    margin-bottom: 6px;
}

.salary-search {
    display: grid;
    grid-template-columns: minmax(260px, 1.4fr) 160px 140px auto;
    gap: 12px;
    align-items: end;
}

.salary-search label {
    min-width: 0;
}

.salary-search .actions {
    align-self: end;
}

.time-entries-filter-actions {
    align-self: end;
    padding-top: 28px;
}

.time-entries-filter-actions .btn {
    min-width: 66px;
    text-align: center;
}

.employee-dashboard-stats {
    margin-bottom: 16px;
}

.timer-widget {
    padding: 14px 16px;
}

.timer-strip {
    position: sticky;
    top: 8px;
    z-index: 30;
    margin-bottom: 12px;
}

.timer-strip-btn {
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
    border-radius: 999px;
    padding: 6px 12px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(17, 24, 39, 0.08);
}

.timer-strip-icon {
    font-size: 14px;
    color: var(--accent);
}

.timer-popup {
    position: fixed;
    top: 64px;
    left: 250px;
    width: min(560px, calc(100vw - 280px));
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 12px 30px rgba(17, 24, 39, 0.22);
    padding: 14px 16px;
    z-index: 120;
    display: none;
}

.timer-popup.open {
    display: block;
}

.timer-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
}

.timer-popup-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.timer-widget-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.timer-widget-label {
    color: var(--muted);
    font-size: 13px;
}

.timer-widget-value {
    font-size: 26px;
    font-weight: 700;
    line-height: 1.1;
}

.timer-widget-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.timer-widget-status {
    font-weight: 700;
}

.timer-widget-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.timer-widget-fields label {
    display: grid;
    gap: 6px;
    font-weight: 600;
}

.timer-widget-fields input,
.timer-widget-fields select {
    padding: 9px 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
    font-size: 14px;
    background: #fff;
}

.timer-widget-error {
    margin-top: 10px;
    color: #b91c1c;
    font-size: 13px;
}

@media (max-width: 800px) {
    .app {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        padding: 16px;
    }

    .content {
        padding: 16px;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .sidebar nav {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .sidebar nav a {
        margin-bottom: 0;
        padding: 6px 10px;
    }

    .actions {
        flex-wrap: wrap;
        width: 100%;
    }

    .table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table th,
    .table td {
        white-space: nowrap;
    }

    .salary-search {
        grid-template-columns: 1fr;
    }

    .time-entries-filter-actions {
        padding-top: 0;
    }

    .timer-widget-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .timer-widget-fields {
        grid-template-columns: 1fr;
    }

    .timer-popup {
        left: 12px;
        top: 72px;
        width: calc(100vw - 24px);
    }
}
