/* ----------------------------------------------------
   JobFlow Stylesheet — Adaptive Neutral Theme
---------------------------------------------------- */


* {
    box-sizing: border-box;
    font-family: "Segoe UI", Roboto, sans-serif;
    margin: 0;
    padding: 0;
}

:root {
    --primary-color: #111; /* Neutral dark buttons */
    --secondary-color: #222;
    --background-color: #f3f4f6;
    --card-bg: #fff;
    --border-color: #cbd5e1;
    --hover-bg: #e5e7eb;
    --success-bg: #dcfce7;
    --success-color: #166534;
    --error-bg: #fee2e2;
    --error-color: #7f1d1d;
}

/* Base scaling: 14px to 18px depending on screen */
html {
    font-size: clamp(14px, 1.2vw, 18px);
}

/* ----- Global Layout ----- */
body {
    background: var(--background-color);
    color: var(--secondary-color);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    padding: 2rem;
}

/* ----- Containers ----- */
.container {
    width: 100%;
    max-width: 460px;
    margin: 0 auto;
}

.card {
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    padding: clamp(1.5rem, 3vw, 2rem);
    text-align: center;
    position: relative;
}

/* Header line (if used) */
.header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--primary-color);
    border-radius: 2px 2px 0 0;
}

/* ----- Typography ----- */
h1, h2, h3, label {
    color: var(--secondary-color);
}

h1 {
    margin-bottom: 1.4rem;
    font-size: clamp(1.5rem, 2vw, 2rem);
    font-weight: 700;
}

h2 {
    font-size: clamp(1.2rem, 1.8vw, 1.6rem);
    margin-bottom: 1rem;
    font-weight: 600;
}

p {
    font-size: clamp(0.9rem, 1vw, 1rem);
    color: #555;
}

/* ----- Forms ----- */
form {
    text-align: left;
}

label {
    display: block;
    margin: 0.6rem 0 0.3rem;
    font-weight: 600;
}

input,
select,
textarea {
    width: 100%;
    padding: clamp(0.75rem, 1.5vw, 1rem);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: clamp(0.95rem, 1vw, 1.1rem);
    margin-bottom: 1rem;
    min-height: 48px; /* touch-friendly */
}

    input:focus,
    select:focus,
    textarea:focus {
        outline: none;
        border-color: var(--primary-color);
        box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.2);
    }

/* ----- Buttons ----- */
.btn {
    display: inline-block;
    background: var(--primary-color);
    color: #fff;
    padding: clamp(0.8rem, 1.5vw, 1rem) clamp(1.3rem, 2vw, 1.5rem);
    border: none;
    border-radius: 10px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    min-height: 50px;
}

    .btn:hover {
        background: #000;
        transform: translateY(-1px);
    }

    .btn:active {
        transform: scale(0.98);
    }

/* Variants */
.btn-yellow {
    background: #fbbf24;
    color: #111;
}

    .btn-yellow:hover {
        background: #facc15;
    }

.btn-ghost {
    background: #f8fafc;
    color: var(--primary-color);
    border: 1px solid #e5e7eb;
}

    .btn-ghost:hover {
        background: var(--hover-bg);
    }

/* ----- Alerts ----- */
.alert {
    border-left: 4px solid #cbd5e1;
    border-radius: 10px;
    padding: 1rem 1.2rem;
    margin: 0.8rem 0;
    text-align: left;
    transition: opacity 1s ease-in-out;
}

    .alert.success {
        background-color: var(--success-bg);
        color: var(--success-color);
        border-left-color: #10b981;
    }

    .alert.error {
        background-color: var(--error-bg);
        color: var(--error-color);
        border-left-color: #ef4444;
    }

    /* Buttons inside alerts */
    .alert .btn {
        display: inline-block;
        margin-top: 0.7rem;
        padding: 0.5rem 1.1rem;
        background: var(--primary-color);
        color: #fff;
        font-size: 0.9rem;
        border-radius: 6px;
    }

/* ----- Tables ----- */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    font-size: clamp(0.85rem, 1vw, 0.95rem);
}

th, td {
    text-align: left;
    padding: 10px 8px;
    border-bottom: 1px solid #e5e7eb;
}

th {
    background: #f8fafc;
    color: var(--primary-color);
    font-weight: 700;
}

tbody tr:hover {
    background: #f9fafb;
}

/* ----- Utility Classes ----- */
.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.actions {
    text-align: center;
    margin-top: 1.2rem;
}

    .actions .btn {
        margin: 0.4rem;
    }

/* ----- Responsiveness ----- */
@media (max-width: 1024px) {
    body {
        padding: 1.5rem;
        align-items: center;
    }

    .card {
        padding: 1.5rem;
    }
}

@media (max-width: 600px) {
    .container, .card {
        width: 95%;
    }

    .btn {
        width: 100%;
        font-size: 1rem;
    }

    h1, h2 {
        text-align: center;
    }
}

/* ----- Job Status Tags ----- */
.status-tag {
    display: inline-block;
    padding: 0.3rem 1rem;
    border-radius: 999px;
    font-weight: 600;
    margin: 0.5rem auto 0.8rem;
    font-size: 0.9rem;
}

.status-started {
    background: #dbeafe;
    color: #1e40af;
}

.status-hold {
    background: #fef9c3;
    color: #92400e;
}

.status-completed {
    background: #dcfce7;
    color: #166534;
}

.status-default {
    background: #f3f4f6;
    color: #374151;
}

.center-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: var(--background-color);
    padding: 1rem;
}

.global-department-switcher {
    position: fixed !important;
    top: 16px !important;
    right: 24px !important;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent; /* no white bubble */
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    font-size: 0.75rem;
}

    .global-department-switcher label {
        font-size: 0.75rem;
        font-weight: 500;
    }

    .global-department-switcher select {
        font-size: 0.75rem;
        padding: 2px 4px;
    }

.global-department-switcher select:focus {
    outline: none;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.card-title {
    font-size: 1.2rem;
    font-weight: 600;
}

.card-current-dept {
    font-size: 0.9rem;
    color: #555;
}

.card-logout .btn-ghost {
    padding: 4px 10px;
    font-size: 0.85rem;
}
