/* ===== Timeclock ===== */

/* Timeclock container */
.timeclock {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1.5rem 2rem;
}

/* ===== Skeleton Loading ===== */

.tc-skeleton-section {
    margin-bottom: 1.5rem;
}

.tc-skeleton-title {
    width: 140px;
    height: 18px;
    margin-bottom: 0.75rem;
}

.tc-skeleton-card {
    background: #fff;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.tc-skeleton-card-info {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.tc-skeleton-name { width: 120px; height: 16px; }
.tc-skeleton-role { width: 80px; height: 12px; }
.tc-skeleton-elapsed { width: 50px; height: 14px; }
.tc-skeleton-btn { width: 100px; height: 40px; border-radius: 10px; }

.tc-skeleton-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
}

.tc-skeleton-worker-btn {
    height: 80px;
    border-radius: 12px;
}

.tc-skeleton-entry {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.tc-skeleton-time { width: 160px; height: 14px; }
.tc-skeleton-hours { width: 50px; height: 14px; }

.tc-skeleton-summary-bar {
    display: flex;
    gap: 1.5rem;
    padding: 1rem;
    background: #fff;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    margin-bottom: 1rem;
}

.tc-skeleton-summary-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.tc-skeleton-summary-label { width: 70px; height: 10px; }
.tc-skeleton-summary-value { width: 60px; height: 22px; }

.tc-skeleton-date-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    margin-top: 1rem;
}

.tc-skeleton-date { width: 100px; height: 14px; }
.tc-skeleton-date-hours { width: 40px; height: 14px; }

/* Section title */
.tc-section-title {
    font-size: 1rem;
    font-weight: 700;
    color: #333;
    margin: 1rem 0 0.75rem;
}

.tc-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: #999;
    font-size: 0.95rem;
}

/* ===== Clock In/Out View ===== */

.tc-clocked-in-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tc-clocked-in-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 1rem;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.tc-clocked-in-card:hover {
    border-color: #B71C1C;
    box-shadow: 0 2px 8px rgba(183, 28, 28, 0.08);
}

.tc-clocked-in-info {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.tc-worker-name {
    font-weight: 700;
    font-size: 1.05rem;
    color: #222;
}

.tc-worker-role {
    font-size: 0.8rem;
    color: #888;
}

.tc-elapsed {
    font-size: 0.9rem;
    font-weight: 600;
    color: #B71C1C;
    margin-top: 0.25rem;
}

.tc-clock-out-btn {
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 700;
    background: #B71C1C;
    color: #fff;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

.tc-clock-out-btn:hover {
    background: #8B1515;
}

/* Worker grid */
.tc-worker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
}

.tc-worker-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.25rem 0.75rem;
    background: #fff;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 80px;
}

.tc-worker-btn:hover {
    border-color: #B71C1C;
    background: #fef2f2;
}

.tc-worker-btn:active {
    transform: scale(0.97);
}

.tc-worker-btn-name {
    font-weight: 700;
    font-size: 1rem;
    color: #222;
    text-align: center;
}

.tc-worker-btn-role {
    font-size: 0.75rem;
    color: #888;
    margin-top: 0.25rem;
}

.tc-add-worker-btn {
    border-style: dashed;
    border-color: #ccc;
    color: #888;
}

.tc-add-worker-btn:hover {
    border-color: #B71C1C;
    color: #B71C1C;
    background: #fef2f2;
}

.tc-add-worker-btn .tc-worker-btn-name {
    color: inherit;
    font-weight: 600;
}

/* ===== Daily Log & History Entries ===== */

.tc-entries-list {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.tc-entry-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: border-color 0.2s;
    gap: 0.75rem;
}

.tc-entry-row:hover {
    border-color: #B71C1C;
}

.tc-entry-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.tc-entry-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: #222;
}

.tc-entry-role {
    font-size: 0.75rem;
    color: #888;
}

.tc-entry-times {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.85rem;
    color: #555;
    white-space: nowrap;
}

.tc-entry-separator {
    color: #ccc;
}

.tc-still-working {
    color: #B71C1C;
    font-weight: 600;
    font-size: 0.8rem;
}

.tc-entry-hours {
    font-weight: 600;
    font-size: 0.9rem;
    color: #333;
    text-align: right;
    white-space: nowrap;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.tc-entry-cost {
    font-size: 0.75rem;
    color: #888;
    font-weight: 400;
}

.tc-summary {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: #555;
    border-top: 1px solid #e5e7eb;
    margin-top: 0.75rem;
}

/* ===== History View ===== */

.tc-history-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.tc-date-filter {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
}

.tc-date-filter label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #666;
}

.tc-date-filter input {
    padding: 0.5rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}

.tc-date-filter input:focus {
    border-color: #B71C1C;
}

.tc-history-summary {
    display: flex;
    gap: 1.5rem;
    padding: 1rem;
    background: #fff;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    margin-bottom: 1rem;
}

.tc-summary-item {
    display: flex;
    flex-direction: column;
}

.tc-summary-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tc-summary-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #222;
}

.tc-history-date-group {
    margin-bottom: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tc-history-date-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    font-size: 0.9rem;
    font-weight: 700;
    color: #555;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 0.375rem;
}

/* ===== Manage Workers ===== */

.tc-settings-section {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1rem;
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.tc-settings-group-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 0.5rem;
}

.tc-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.95rem;
    font-weight: 500;
    color: #333;
    cursor: pointer;
}

.tc-toggle-row input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: #B71C1C;
    cursor: pointer;
}

.tc-setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.95rem;
    font-weight: 500;
    color: #333;
}

.tc-setting-input {
    width: 80px;
    padding: 0.375rem 0.5rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.9rem;
    text-align: center;
    outline: none;
    transition: border-color 0.2s;
}

.tc-setting-input:focus {
    border-color: #B71C1C;
}

.tc-manage-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 1rem;
}

.tc-add-btn {
    padding: 0.5rem 1rem;
    min-width: 130px;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 600;
    background: #B71C1C;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.tc-add-btn:hover {
    background: #8B1515;
}

.tc-workers-list {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.tc-worker-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    gap: 0.75rem;
}

.tc-worker-row-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.tc-worker-row-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: #222;
}

.tc-worker-row-role {
    font-size: 0.75rem;
    color: #888;
}

.tc-worker-row-details {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-size: 0.8rem;
    color: #666;
    gap: 0.125rem;
}

.tc-worker-row-rate {
    font-weight: 600;
}

.tc-worker-row-pin {
    font-size: 0.75rem;
    color: #999;
}

.tc-worker-row-actions {
    display: flex;
    gap: 0.5rem;
}

.tc-edit-btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 600;
    background: #f3f4f6;
    color: #333;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.tc-edit-btn:hover {
    background: #e5e7eb;
}

.tc-remove-btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 600;
    background: #fef2f2;
    color: #B71C1C;
    border: 1px solid #fecaca;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.tc-remove-btn:hover {
    background: #fecaca;
}

/* ===== PIN Modal ===== */

.tc-pin-modal {
    max-width: 320px;
}

.tc-pin-display {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin: 1.5rem 0;
}

.tc-pin-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid #d1d5db;
    transition: all 0.15s ease;
}

.tc-pin-dot.filled {
    background: #B71C1C;
    border-color: #B71C1C;
}

.tc-pin-error {
    text-align: center;
    color: #dc2626;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    animation: pinShake 0.3s ease;
}

@keyframes pinShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}

.tc-keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    max-width: 260px;
    margin: 0 auto 1rem;
}

.tc-keypad-btn {
    padding: 1rem;
    font-size: 1.25rem;
    font-weight: 700;
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
    color: #222;
}

.tc-keypad-btn:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.tc-keypad-btn:active {
    transform: scale(0.95);
    background: #e5e7eb;
}

.tc-keypad-clear {
    font-size: 0.9rem;
    color: #666;
}

.tc-keypad-ok {
    background: #B71C1C;
    color: #fff;
    border-color: #B71C1C;
    font-size: 0.9rem;
}

.tc-keypad-ok:hover {
    background: #8B1515;
    border-color: #8B1515;
}

/* ===== Roles ===== */

.tc-roles-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.tc-role-chip {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #333;
}

.tc-role-edit {
    background: none;
    border: none;
    color: #888;
    font-size: 0.75rem;
    cursor: pointer;
    padding: 0 0.25rem;
}

.tc-role-edit:hover {
    color: #B71C1C;
}

.tc-role-remove {
    background: none;
    border: none;
    color: #ccc;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    padding: 0 0.25rem;
    line-height: 1;
}

.tc-role-remove:hover {
    color: #B71C1C;
}

.tc-role-select {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.tc-role-toggle {
    padding: 0.375rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 600;
    border: 2px solid #e5e7eb;
    border-radius: 20px;
    background: #fff;
    color: #666;
    cursor: pointer;
    transition: all 0.15s ease;
}

.tc-role-toggle.selected {
    background: #B71C1C;
    color: #fff;
    border-color: #B71C1C;
}

.tc-role-toggle:hover:not(.selected) {
    border-color: #d1d5db;
    background: #f9fafb;
}

.tc-empty-sm {
    font-size: 0.8rem;
    color: #999;
    padding: 0.25rem 0;
}

/* ===== Shared Modal Styles (extend expo modal pattern) ===== */

.tc-btn-primary {
    padding: 0.625rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 600;
    background: #B71C1C;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.tc-btn-primary:hover {
    background: #8B1515;
}

.tc-btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.modal-input {
    width: 100%;
    padding: 0.625rem 0.75rem;
    font-size: 0.95rem;
    border: 2px solid #d1d5db;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.modal-input:focus {
    border-color: #B71C1C;
}

/* ===== Mobile Responsive ===== */

@media (max-width: 600px) {
    .timeclock {
        padding: 0 1rem 2rem;
    }

    .expo-tab-bar {
        padding: 0.75rem 1rem 0;
    }

    .timeclock-nav {
        gap: 0.375rem;
        padding: 0.75rem 0;
    }

    .timeclock-nav-btn {
        padding: 0.375rem 0.75rem;
        font-size: 0.8rem;
    }

    .tc-worker-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .tc-clocked-in-card {
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch;
    }

    .tc-clock-out-btn {
        text-align: center;
    }

    .tc-entry-row {
        flex-wrap: wrap;
    }

    .tc-entry-times {
        font-size: 0.8rem;
    }

    .tc-history-filters {
        flex-direction: column;
        gap: 0.5rem;
    }

    .tc-worker-row {
        flex-wrap: wrap;
    }

    .tc-worker-row-actions {
        width: 100%;
        justify-content: flex-end;
        margin-top: 0.5rem;
    }
}

.tc-history-paginator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1rem;
    margin-top: 1rem;
}

.tc-paginator-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #e5e7eb;
    background: #fff;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    color: #222;
    cursor: pointer;
    transition: background 0.15s;
}

.tc-paginator-btn:hover:not(:disabled) {
    background: #f5f5f5;
}

.tc-paginator-btn:disabled {
    color: #bbb;
    cursor: not-allowed;
    background: #fafafa;
}

.tc-paginator-status {
    font-size: 0.875rem;
    color: #555;
}

.tc-paginator-count {
    color: #888;
    margin-left: 0.5rem;
}
