/* ==========================================================================
   KlusKit Design System — Global Overrides
   ==========================================================================
   This file defines CSS custom properties (design tokens) and overrides
   Bootstrap 5.3 component styles to achieve a modern, trustworthy,
   minimalist aesthetic inspired by macOS / GNOME / Windows 11.

   Tokens are also defined in variables.scss for documentation reference.
   ========================================================================== */

/* ---- Design Tokens (CSS Custom Properties) -------------------------------- */

:root {
    /* Override Bootstrap's default CSS variables with KlusKit values */

    /* Colors */
    --bs-body-bg:           #f5f6fa;
    --bs-body-color:        #1d1d1f;
    --bs-secondary-color:   #6c6c73;

    --bs-primary:           #0066cc;
    --bs-success:           #0a8754;
    --bs-danger:            #dc2626;
    --bs-info:              #0284c7;
    --bs-warning:           #d97706;

    /* Background subtle variants (Bootstrap 5.3) */
    --bs-success-bg-subtle: #d1fae5;
    --bs-danger-bg-subtle:  #fee2e2;
    --bs-info-bg-subtle:    #e0f2fe;
    --bs-warning-bg-subtle: #fef3c7;
    --bs-table-bg:          #ffffff;

    /* Border & shadows */
    --bs-border-color:      #e5e7eb;
    --bs-box-shadow-sm:     0 1px 3px rgba(0, 0, 0, 0.04),
                            0 1px 2px rgba(0, 0, 0, 0.06);
    --bs-box-shadow:        0 2px 8px rgba(0, 0, 0, 0.04),
                            0 4px 12px rgba(0, 0, 0, 0.06);

    /* Border radius */
    --bs-border-radius-sm:  6px;
    --bs-border-radius:     10px;
    --bs-border-radius-lg:  14px;

    /* Typography */
    --bs-font-family:       -apple-system, BlinkMacSystemFont, "Segoe UI",
                            Roboto, Helvetica, Arial, sans-serif;

    /* Custom KlusKit-specific variables not in Bootstrap */
    --surface:              #ffffff;
    --surface-hover:        #f8f9fb;
    --text-secondary:       #6c6c73;
    --text-tertiary:        #86868b;
    --primary-hover:        #0052a3;
    --primary-light:        #e8f0fe;
    --primary-focus:        rgba(0, 102, 204, 0.25);
    --border-focus:         #0066cc;
    --shadow-lg:            0 8px 24px rgba(0, 0, 0, 0.08),
                            0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-elevated:      0 12px 32px rgba(0, 0, 0, 0.10),
                            0 4px 12px rgba(0, 0, 0, 0.06);
    --radius-xl:            20px;
    --radius-pill:          9999px;
    --transition:           all 0.2s ease;
}

/* ---- Global Reset & Body -------------------------------------------------- */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    margin: 0;
    font-family: var(--bs-font-family);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--bs-body-color);
    background-color: var(--bs-body-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* ---- App Container -------------------------------------------------------- */

.app-container {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* ---- Header / Navbar ------------------------------------------------------ */

header {
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
    background-color: var(--surface);
    border-bottom: 1px solid var(--bs-border-color);
    box-shadow: var(--bs-box-shadow-sm);
    padding: 0 1.5rem;
}

header .container,
header > .container {
    max-width: 1120px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    height: 56px;
}

header a,
header .nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.375rem 0.75rem;
    border-radius: var(--bs-border-radius-sm);
    font-size: 0.9375rem;
    font-weight: 500;
    transition: var(--transition);
}

header a:hover,
header .nav-link:hover {
    color: var(--bs-body-color);
    background-color: var(--surface-hover);
    text-decoration: none;
}

header a:active,
header .nav-link:active {
    background-color: rgba(0, 0, 0, 0.04);
}

header a.active,
header .nav-link.active {
    color: var(--bs-primary);
    background-color: var(--primary-light);
}

header .brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--bs-body-color) !important;
    letter-spacing: -0.02em;
    white-space: nowrap;
}

header .brand-icon {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
}

header .brand .bi {
    color: var(--bs-primary);
}

header .main-nav {
    gap: 0.25rem;
}

header .main-nav .bi {
    margin-right: 0.25rem;
}

header .user-info {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Header buttons keep Bootstrap's button colors, not the header link style. */
header .btn,
header .dropdown-item {
    font-size: 0.9375rem;
}

header .dropdown-item {
    border-radius: 0;
}

header .scope-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    max-width: 220px;
}

/* Icon-only button (theme switch, account menu): large enough to tap. */
.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--text-secondary);
    font-size: 1.25rem;
}

.btn-icon:hover,
.btn-icon:focus-visible,
.btn-icon[aria-expanded="true"] {
    color: var(--bs-body-color);
    background-color: var(--surface-hover);
}

/* Buttons that are used in the field: at least 44px high (touch target). */
.btn-lg-touch {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Icon buttons inside lists/cards: compact but still tappable. */
.card .btn-icon,
.list-group .btn-icon {
    width: 40px;
    height: 40px;
    font-size: 1.0625rem;
}

/* Phones: every button is a full touch target (44px), small ones included,
   so buttons next to each other have the same height. Text links styled as
   a button without padding (.p-0, e.g. "Toon meer") stay inline. */
@media (max-width: 767.98px) {
    .btn:not(.p-0) {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .card .btn-icon,
    .list-group .btn-icon {
        width: 44px;
        height: 44px;
    }

    /* Job sheet choice in the material form: each option a full touch target. */
    .kk-sheet-list .form-check {
        min-height: 44px;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

    .kk-sheet-list .form-check-input {
        flex-shrink: 0;
        margin-top: 0;
    }

    .kk-sheet-list .form-check-label {
        flex-grow: 1;
        padding: 0.5rem 0;
    }
}

/* ---- Bottom navigation (phones) ------------------------------------------- */

.bottom-nav {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1030;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    background-color: var(--surface);
    border-top: 1px solid var(--bs-border-color);
    box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.04);
    padding-bottom: env(safe-area-inset-bottom);
}

.bottom-nav > a,
.bottom-nav .dropup > button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.125rem;
    width: 100%;
    min-height: 60px;
    padding: 0.375rem 0.25rem;
    border: 0;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 500;
    text-decoration: none;
}

.bottom-nav .bi {
    font-size: 1.375rem;
    line-height: 1;
}

.bottom-nav > a.active,
.bottom-nav .dropup > button.active,
.bottom-nav .dropup > button[aria-expanded="true"] {
    color: var(--bs-primary);
}

.bottom-nav .dropdown-item {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

@media (max-width: 767.98px) {
    /* Keep content clear of the fixed bottom bar. */
    body.has-bottom-nav {
        padding-bottom: calc(60px + env(safe-area-inset-bottom));
    }

    /* Scrolling to a focused link or button keeps it above the bottom bar instead of behind it. */
    html:has(body.has-bottom-nav) {
        scroll-padding-bottom: calc(76px + env(safe-area-inset-bottom));
    }
}

/* ---- Flash Messages ------------------------------------------------------- */
/* Flash messages now use Bootstrap's alert component instead */

/* ---- Cards ---------------------------------------------------------------- */

.card {
    border: none;
    border-radius: var(--bs-border-radius-lg);
    box-shadow: var(--bs-box-shadow);
    background-color: var(--surface);
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

.card-body {
    padding: 1.5rem;
}

.card-title {
    font-weight: 600;
    color: var(--bs-body-color);
    margin-bottom: 0.625rem;
}

.card-text {
    color: var(--text-secondary);
    line-height: 1.65;
}

/* ---- Buttons -------------------------------------------------------------- */

.btn {
    font-family: var(--bs-font-family);
    font-weight: 500;
    border-radius: var(--bs-border-radius);
    padding: 0.5rem 1.125rem;
    font-size: 0.9375rem;
    line-height: 1.5;
    transition: var(--transition);
    border-width: 1px;
}

.btn:focus-visible {
    box-shadow: 0 0 0 3px var(--primary-focus);
}

/* Primary */
.btn-primary {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
    color: #ffffff;
}

.btn-primary:hover,
.btn-primary:focus-visible {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    color: #ffffff;
}

/* Secondary */
.btn-secondary {
    background-color: #6b7280;
    border-color: #6b7280;
    color: #ffffff;
}

.btn-secondary:hover,
.btn-secondary:focus-visible {
    background-color: #4b5563;
    border-color: #4b5563;
    color: #ffffff;
}

/* Outline variants */
.btn-outline-primary {
    color: var(--bs-primary);
    border-color: var(--bs-primary);
    background-color: transparent;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus-visible {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
    color: #ffffff;
}

.btn-outline-secondary {
    color: var(--text-secondary);
    border-color: var(--bs-border-color);
    background-color: transparent;
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus-visible {
    background-color: var(--surface-hover);
    border-color: #d1d5db;
    color: var(--bs-body-color);
}

/* Success / Danger / Warning / Info outlines */
.btn-outline-success {
    color: var(--bs-success);
    border-color: var(--bs-success);
}
.btn-outline-success:hover {
    background-color: var(--bs-success);
    color: #fff;
}

.btn-outline-danger {
    color: var(--bs-danger);
    border-color: var(--bs-danger);
}
.btn-outline-danger:hover {
    background-color: var(--bs-danger);
    color: #fff;
}

/* Small buttons */
.btn-sm {
    padding: 0.3125rem 0.875rem;
    font-size: 0.8125rem;
    border-radius: var(--bs-border-radius-sm);
}

/* Large buttons */
.btn-lg {
    padding: 0.625rem 1.5rem;
    font-size: 1.0625rem;
    border-radius: var(--bs-border-radius);
}

/* ---- Forms ---------------------------------------------------------------- */

.form-control,
.form-select {
    font-family: var(--bs-font-family);
    font-size: 0.9375rem;
    color: var(--bs-body-color);
    background-color: var(--surface);
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
    padding: 0.5625rem 0.875rem;
    transition: var(--transition);
}

.form-control::placeholder,
.form-select::placeholder {
    color: var(--text-tertiary);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--primary-focus);
    background-color: var(--surface);
    outline: none;
}

.form-control:disabled,
.form-select:disabled {
    background-color: #f3f4f6;
    color: var(--text-tertiary);
}

.form-label {
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.375rem;
}

/* Floating labels */
.form-floating > .form-control:focus,
.form-floating > .form-control:not(:placeholder-shown) {
    padding-top: 1.25rem;
    padding-bottom: 0.5rem;
}

.form-floating > label {
    color: var(--kk-text-tertiary);
}

/* ---- Badges --------------------------------------------------------------- */

.badge {
    font-weight: 500;
    font-size: 0.75rem;
    padding: 0.3125rem 0.6875rem;
    border-radius: var(--radius-pill);
    letter-spacing: 0.01em;
}

.badge.bg-success {
    background-color: var(--bs-success-bg-subtle) !important;
    color: var(--bs-success) !important;
}

.badge.bg-warning {
    background-color: var(--bs-warning-bg-subtle) !important;
    color: var(--bs-warning) !important;
}

.badge.bg-info {
    background-color: var(--bs-info-bg-subtle) !important;
    color: var(--bs-info) !important;
}

.badge.bg-danger {
    background-color: var(--bs-danger-bg-subtle) !important;
    color: var(--bs-danger) !important;
}

/* ---- Tables --------------------------------------------------------------- */

.table {
    --bs-table-bg: var(--surface);
    font-size: 0.9375rem;
}

.table thead th {
    font-weight: 600;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--bs-border-color);
    padding: 0.875rem 1rem;
}

.table tbody td {
    padding: 0.875rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--bs-border-color);
}

.table-hover tbody tr:hover {
    background-color: var(--surface-hover);
}

.table-responsive {
    border-radius: var(--bs-border-radius-lg);
    box-shadow: var(--bs-box-shadow);
    background-color: var(--surface);
    border: 1px solid var(--bs-border-color);
    overflow: hidden;
}

/* ---- Breadcrumbs ---------------------------------------------------------- */

.breadcrumb {
    font-size: 0.875rem;
    padding: 0;
    background: transparent;
}

.breadcrumb-item a {
    color: var(--bs-primary);
    text-decoration: none;
    transition: var(--transition);
}

.breadcrumb-item a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: var(--text-secondary);
}

/* ---- Lists ---------------------------------------------------------------- */

.list-group {
    border-radius: var(--bs-border-radius-lg);
    overflow: hidden;
    box-shadow: var(--bs-box-shadow);
}

.list-group-item {
    border-color: var(--bs-border-color);
    padding: 0.875rem 1.25rem;
    font-size: 0.9375rem;
    background-color: var(--surface);
    transition: var(--transition);
}

.list-group-item:hover {
    background-color: var(--surface-hover);
}

/* ---- Alerts (Bootstrap override) ------------------------------------------ */

.alert {
    border-radius: var(--bs-border-radius);
    border-width: 1px;
    font-size: 0.9375rem;
    padding: 1rem 1.25rem;
}

/* ---- Code / Pre blocks ---------------------------------------------------- */

pre {
    background-color: var(--surface-hover);
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
    padding: 1rem 1.25rem;
    font-size: 0.875rem;
    color: var(--bs-body-color);
}

code {
    background-color: var(--surface-hover);
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius-sm);
    padding: 0.125rem 0.375rem;
    font-size: 0.8125em;
    color: var(--bs-primary);
}

/* ---- Misc Helpers --------------------------------------------------------- */

.text-muted {
    color: var(--text-secondary) !important;
}

hr {
    border-color: var(--bs-border-color);
    opacity: 1;
}

/* ---- Search Input --------------------------------------------------------- */

.search-input {
    font-size: 1.1rem;
    padding: 0.75rem 1.25rem;
    border-radius: var(--bs-border-radius-lg);
    border: 1px solid var(--bs-border-color);
    background-color: var(--surface);
    box-shadow: var(--bs-box-shadow-sm) inset;
    transition: var(--transition);
}

.search-input:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--primary-focus);
    outline: none;
}

/* ---- Product Card (legacy class kept) ------------------------------------- */

.product-card {
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
    padding: 1.25rem;
    margin-bottom: 1rem;
    background-color: var(--surface);
    box-shadow: var(--bs-box-shadow-sm);
    transition: var(--transition);
}

.product-card:hover {
    box-shadow: var(--bs-box-shadow);
}

/* ---- Footer --------------------------------------------------------------- */

footer {
    padding: 1.5rem;
    text-align: center;
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    border-top: 1px solid var(--bs-border-color);
    background-color: var(--surface);
}

/* ---- Impersonation Banner ------------------------------------------------- */

.impersonation-banner {
    background-color: var(--bs-warning-bg-subtle);
    border-bottom: 1px solid var(--bs-warning-border-subtle);
    padding: 0.5rem 1.5rem;
    font-size: 0.875rem;
    color: var(--bs-warning-text-emphasis);
}

.impersonation-banner .container {
    max-width: 1120px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.impersonation-banner strong {
    color: var(--bs-warning-text-emphasis);
}

/* ---- Responsive adjustments ----------------------------------------------- */

@media (max-width: 768px) {
    .app-container {
        padding: 1.5rem 1rem;
    }

    header .container,
    header > .container {
        height: 50px;
        gap: 0.75rem;
    }

    .card-body {
        padding: 1.25rem;
    }
}

/* ---- Utility: Center login card ------------------------------------------- */

.login-center {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 56px);
    padding: 2rem 1rem;
}

/* ---- Dark mode (Bootstrap 5.3 color mode) --------------------------------- */

[data-bs-theme="dark"] {
    --bs-body-bg:           #1c1c1e;
    --surface:              #2c2c2e;
    --surface-hover:        #3a3a3c;
    --bs-table-bg:          #2c2c2e;

    --bs-body-color:        #f5f5f7;
    --text-secondary:       #a1a1a6;
    --text-tertiary:        #86868b;

    --bs-primary:           #0a84ff;
    --primary-hover:        #409cff;
    --primary-light:        #1a3a5c;
    --primary-focus:        rgba(10, 132, 255, 0.3);

    --bs-success:           #30d158;
    --bs-success-bg-subtle: #0f2e1a;

    --bs-warning:           #ffd60a;
    --bs-warning-bg-subtle: #2e2a0f;

    --bs-danger:            #ff453a;
    --bs-danger-bg-subtle:  #2e1210;

    --bs-info:              #64d2ff;
    --bs-info-bg-subtle:    #0f2430;

    --bs-border-color:      #3a3a3c;
    --border-focus:         #0a84ff;

    --bs-box-shadow-sm:     0 1px 3px rgba(0, 0, 0, 0.3),
                            0 1px 2px rgba(0, 0, 0, 0.4);
    --bs-box-shadow:        0 2px 8px rgba(0, 0, 0, 0.3),
                            0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg:            0 8px 24px rgba(0, 0, 0, 0.5),
                            0 2px 8px rgba(0, 0, 0, 0.3);
}

[data-bs-theme="dark"] header a:active,
[data-bs-theme="dark"] .nav-link:active {
    background-color: rgba(255, 255, 255, 0.06);
}

[data-bs-theme="dark"] .form-control:disabled,
[data-bs-theme="dark"] .form-select:disabled {
    background-color: #3a3a3c;
}

/* ---- Expandable clamped notes --------------------------------------------- */

.kk-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.kk-clamp-2.expanded {
    -webkit-line-clamp: unset;
    display: block;
}

/* ---- Focus visible for accessibility -------------------------------------- */

:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--primary-focus);
}

/* ---- Current job bar ------------------------------------------------------- */

/* The job the user is working on, right below the header. */
.current-job-bar {
    background-color: var(--primary-light);
    border-bottom: 1px solid var(--bs-border-color);
}

.current-job-bar .container {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0.25rem 1.5rem;
}

@media (max-width: 768px) {
    .current-job-bar .container {
        padding: 0.25rem 1rem;
    }
}

/* ---- Search ---------------------------------------------------------------- */

/* Keep the search field in view while scrolling through results. */
.search-bar {
    position: sticky;
    top: 56px;
    z-index: 10;
    padding: 0.5rem 0;
    background-color: var(--bs-body-bg);
}

@media (max-width: 768px) {
    .search-bar {
        top: 50px;
    }
}

/* Results frame of an overview list (list_frame_controller.js); after paging it scrolls into view below the sticky header and search bar. */
.list-results {
    display: block;
    scroll-margin-top: 8rem;
}

/* Allow flex children to shrink so long names truncate instead of overflowing. */
.min-w-0 {
    min-width: 0;
}

/* ---- Job calendar (templates/job/calendar.html.twig) ------------------------ */

.kk-calendar {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    background-color: var(--surface);
}

.kk-calendar th {
    padding: 0.375rem 0;
    font-size: 0.8125rem;
    font-weight: 600;
    text-align: center;
    color: var(--text-secondary);
}

.kk-calendar abbr {
    text-decoration: none;
}

.kk-calendar td {
    height: 7rem;
    padding: 0.25rem;
    vertical-align: top;
    border: 1px solid var(--bs-border-color);
}

.kk-calendar td.kk-cal-other {
    background-color: var(--bs-body-bg);
    color: var(--text-secondary);
    opacity: 0.6;
}

.kk-cal-day {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    min-height: 1.75rem;
    color: inherit;
    text-decoration: none;
}

.kk-cal-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.75rem;
    height: 1.75rem;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 600;
}

.kk-cal-today .kk-cal-number {
    background-color: var(--bs-primary);
    color: #fff;
}

.kk-cal-selected {
    box-shadow: inset 0 0 0 2px var(--bs-primary);
}

.kk-cal-item {
    align-items: center;
    gap: 0.125rem;
    min-height: 1.75rem;
    margin-top: 0.125rem;
    border-left: 3px solid var(--kk-cal-status, var(--bs-secondary));
    border-radius: 0.25rem;
    background-color: var(--bs-tertiary-bg);
}

.kk-cal-ref {
    flex: 1;
    min-width: 0;
    padding: 0.125rem 0.25rem;
    overflow: hidden;
    font-size: 0.8125rem;
    font-weight: 600;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: var(--bs-body-color);
    text-decoration: none;
}

.kk-cal-time {
    margin-right: 0.25rem;
    font-weight: 400;
    color: var(--text-secondary);
}

.kk-cal-info {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    flex-shrink: 0;
    color: var(--text-secondary);
}

.kk-cal-more {
    display: block;
    padding: 0.125rem 0.25rem;
    font-size: 0.8125rem;
}

/* "New job" placeholder: shown while hovering a day (or tabbing to it); touch screens use the button below the day list. */
.kk-cal-add {
    align-items: center;
    gap: 0.25rem;
    min-height: 1.75rem;
    margin-top: 0.125rem;
    padding: 0 0.25rem;
    border: 1px dashed var(--bs-border-color);
    border-radius: 0.25rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    text-decoration: none;
    opacity: 0;
    pointer-events: none;
}

.kk-calendar td:hover .kk-cal-add,
.kk-cal-add:focus-visible {
    opacity: 1;
    pointer-events: auto;
}

.kk-cal-add:hover {
    border-color: var(--bs-primary);
    color: var(--bs-primary);
}

@media (hover: none) {
    .kk-cal-add {
        display: none !important;
    }
}

.kk-status-new { --kk-cal-status: var(--bs-primary); }
.kk-status-in_progress { --kk-cal-status: var(--bs-info); }
.kk-status-completed { --kk-cal-status: var(--bs-success); }

.kk-cal-card {
    border-left: 4px solid var(--kk-cal-status, var(--bs-secondary));
}

/* Phones: a compact grid; each day is one large tap target with the number of jobs. */
@media (max-width: 767.98px) {
    .kk-calendar td {
        height: auto;
        padding: 0;
    }

    .kk-cal-day {
        flex-direction: column;
        justify-content: center;
        gap: 0;
        min-height: 3rem;
    }

    .kk-cal-other .kk-cal-number {
        display: flex;
        min-height: 3rem;
        margin: 0 auto;
    }

    .kk-cal-count {
        min-width: 1.25rem;
        padding: 0 0.25rem;
        border-radius: 999px;
        background-color: var(--primary-light);
        color: var(--bs-primary);
        font-size: 0.6875rem;
        font-weight: 700;
        line-height: 1.25rem;
        text-align: center;
    }
}
