/* ──────────────────────────────────────
   Bootstrap overrides
────────────────────────────────────── */
:root {
    --bs-body-font-family: system-ui, -apple-system, sans-serif;
    --bs-body-bg: #f0f2f5;
    --bs-body-color: #333;
}

.btn-primary {
    --bs-btn-bg: #1a1a2e;
    --bs-btn-border-color: #1a1a2e;
    --bs-btn-hover-bg: #0f3460;
    --bs-btn-hover-border-color: #0f3460;
    --bs-btn-active-bg: #0f3460;
    --bs-btn-active-border-color: #0f3460;
    --bs-btn-focus-shadow-rgb: 26, 26, 46;
    --bs-btn-disabled-bg: #1a1a2e;
    --bs-btn-disabled-border-color: #1a1a2e;
}

/* Remove Bootstrap's default card border; use shadow */
.card {
    border: none;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
    background: #fff;
    padding: 24px;
}

/* Table */
.table { font-size: 14px; }
.table thead { background: #f7f8fa; }
.table thead th { font-size: 13px; font-weight: 600; color: #555; border-bottom-color: #eee; }
.table tbody tr:hover { background: #fafafa; }
.table > :not(caption) > * > * { padding: 12px 16px; vertical-align: middle; }

/* Alert */
.alert { font-size: 14px; }

/* ──────────────────────────────────────
   App Layout
────────────────────────────────────── */
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 200;
    background: #1a1a2e;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    height: 56px;
    flex-shrink: 0;
}
.header-left  { display: flex; align-items: center; gap: 14px; }
.header-right { display: flex; align-items: center; gap: 12px; }
.brand { color: #fff; text-decoration: none; font-size: 17px; font-weight: 600; letter-spacing: 0.2px; }
.user-name { font-size: 14px; color: #aac4e8; display: none; }
.btn-logout {
    font-size: 13px;
    color: #aac4e8;
    text-decoration: none;
    border: 1px solid #344;
    border-radius: 4px;
    padding: 5px 12px;
}
.btn-logout:hover { color: #fff; border-color: #aac4e8; }

.badge-admin-pill {
    background: #e94560; color: #fff;
    font-size: 11px; font-weight: 700;
    padding: 3px 8px; border-radius: 4px; letter-spacing: .5px;
}
.badge-role-pill {
    background: #253555; color: #aac4e8;
    font-size: 11px; font-weight: 600;
    padding: 3px 8px; border-radius: 4px; letter-spacing: .5px;
}

.menu-toggle {
    background: none; border: none; cursor: pointer;
    padding: 6px; display: flex; flex-direction: column; gap: 5px; width: 36px;
}
.menu-toggle span { display: block; height: 2px; background: #fff; border-radius: 2px; transition: all .2s; }

.app-body { display: flex; flex: 1; }

.app-sidebar {
    position: fixed;
    top: 56px; left: 0; bottom: 0;
    width: 220px;
    background: #16213e;
    z-index: 150;
    transform: translateX(-100%);
    transition: transform .25s ease;
    overflow-y: auto;
    padding: 16px 0;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 56px 0 0 0;
    background: rgba(0,0,0,.45);
    z-index: 140;
}
body.sidebar-open .app-sidebar { transform: translateX(0); }
body.sidebar-open .sidebar-overlay { display: block; }

.app-main {
    flex: 1;
    padding: 24px 16px;
    min-width: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.app-footer {
    background: #1a1a2e; color: #556;
    font-size: 12px; text-align: center; padding: 12px 16px; flex-shrink: 0;
}

/* ──────────────────────────────────────
   Navigation
────────────────────────────────────── */
.nav-list { list-style: none; }
.nav-link {
    display: flex; align-items: center; gap: 12px;
    padding: 13px 20px; color: #a8bfd4;
    text-decoration: none; font-size: 15px;
    transition: background .15s, color .15s;
}
.nav-link:hover { background: #0f3460; color: #fff; }
.nav-link.active { background: #0f3460; color: #fff; }
.nav-divider { border-top: 1px solid #253555; margin: 8px 0; }
.nav-section-label { padding: 6px 20px 2px; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: #4a6080; }

/* ──────────────────────────────────────
   Auth Layout
────────────────────────────────────── */
.auth-header {
    background: #1a1a2e; color: #fff;
    text-align: center; padding: 18px 16px;
    font-size: 18px; font-weight: 600; letter-spacing: 0.2px;
}
.auth-body { flex: 1; display: flex; align-items: center; justify-content: center; padding: 32px 16px; }
.auth-card {
    background: #fff; border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,.1);
    padding: 32px 28px; width: 100%; max-width: 400px;
}
.auth-footer { background: #1a1a2e; color: #556; font-size: 12px; text-align: center; padding: 12px 16px; }
.login-title { font-size: 20px; font-weight: 600; margin-bottom: 6px; color: #1a1a2e; }
.login-sub   { font-size: 14px; color: #888; margin-bottom: 28px; }

/* ──────────────────────────────────────
   Forms
────────────────────────────────────── */
.form-grid { display: grid; gap: 18px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 14px; font-weight: 500; color: #444; }
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="tel"],
.form-group input[type="date"],
.form-group input[type="file"],
.form-group select,
.form-group textarea {
    padding: 11px 13px;
    font-size: 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    outline: none;
    transition: border-color .15s;
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    background: #fff;
    box-shadow: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #1a1a2e;
    box-shadow: 0 0 0 3px rgba(26,26,46,.08);
}
.field-hint  { font-size: 12px; color: #aaa; }
.field-error { font-size: 12px; color: #c0392b; }
.form-actions { display: flex; gap: 10px; align-items: center; margin-top: 8px; }
.checkbox-group { display: flex; align-items: center; gap: 10px; }
.checkbox-group input[type="checkbox"] { width: 18px; height: 18px; cursor: pointer; flex-shrink: 0; }
.checkbox-group label { font-size: 14px; color: #444; margin: 0; cursor: pointer; }
.checkbox-group + .checkbox-group { margin-top: 10px; }
.checkbox-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px 16px; padding: 12px; border: 1px solid #dee2e6; border-radius: 6px; background: #fff; }
@media (max-width: 576px) { .checkbox-list { grid-template-columns: repeat(2, 1fr); } }
.required-star { color: #c0392b; }
.label-urgent  { color: #c0392b; font-weight: 600; }

/* ──────────────────────────────────────
   Page Components
────────────────────────────────────── */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.page-header h2 { font-size: 20px; font-weight: 600; margin: 0; }
.card--narrow  { max-width: 480px; }
.card--medium  { max-width: 600px; }
.card--success { background: #d4edda; border: 1px solid #c3e6cb; box-shadow: none; }
.empty-state { text-align: center; padding: 48px 16px; color: #aaa; font-size: 15px; background: #fff; border-radius: 8px; }
.empty-state-inline { padding: 12px 0; color: #bbb; font-size: 14px; }
.text-muted  { color: #aaa; font-size: 14px; }
.text-urgent { color: #c0392b; font-weight: 700; }
.text-overdue { color: #e94560; font-weight: 600; }
.text-warning-bold { color: #856404; font-weight: 600; }
.td-urgency { width: 4px; padding: 0 !important; }
.urgency-bar { width: 4px; background: #e94560; min-height: 48px; }
.td--nowrap  { white-space: nowrap; }
.td-count    { text-align: right; font-weight: 700; color: #1a1a2e; }
.td-count--muted { text-align: right; font-weight: 700; color: #888; }
.tr--subtle  { background: #f7f8fa; }
.tr-link     { cursor: pointer; }
.form-inline { display: inline; }
.row-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* ──────────────────────────────────────
   Badges & Job Status
────────────────────────────────────── */
.badge-urgent { background: #fde8ec; color: #c0392b; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 4px; display: inline-block; }
.badge-admin  { background: #fde8ec; color: #c0392b; }
.badge-office { background: #e8f0fe; color: #1a56db; }
.badge-field  { background: #e8f7ee; color: #1a7a40; }

.job-status { display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase; padding: 3px 8px; border-radius: 4px; letter-spacing: .4px; white-space: nowrap; }
.job-status--open        { background: #e8f0fe; color: #1a56db; }
.job-status--assigned    { background: #fff3cd; color: #856404; }
.job-status--in_progress { background: #e8f7ee; color: #1a7a40; }
.job-status--done        { background: #f0f0f0; color: #888; }

/* ──────────────────────────────────────
   Filter / Queue Tabs
────────────────────────────────────── */
/* Jobs toolbar (tabs + search) */
.jobs-toolbar { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.jobs-toolbar .filter-tabs { margin-bottom: 0; }
.jobs-search { display: flex; gap: 8px; align-items: center; }
.jobs-search__wrap { position: relative; }
.jobs-search__input { padding: 7px 32px 7px 12px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px; width: 220px; background: #fff; }
.jobs-search__input:focus { outline: none; border-color: #1a1a2e; }
.jobs-search__clear { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); color: #aaa; text-decoration: none; font-size: 13px; line-height: 1; }
.jobs-search__clear:hover { color: #333; }
.search-result-info { font-size: 13px; color: #888; margin-bottom: 12px; }
.pagination-wrap { display: flex; align-items: center; justify-content: space-between; margin-top: 20px; flex-wrap: wrap; gap: 8px; }
.pagination-info { font-size: 13px; color: #888; }

.filter-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 20px; }
.filter-tab {
    padding: 8px 16px; border-radius: 6px;
    font-size: 13px; font-weight: 500;
    text-decoration: none; color: #666;
    background: #fff; border: 1px solid #e0e0e0;
    cursor: pointer; display: inline-block;
}
.filter-tab.active { background: #1a1a2e; color: #fff; border-color: #1a1a2e; }
.filter-tab:hover:not(.active) { border-color: #aaa; color: #333; text-decoration: none; }
.filter-tab__count {
    display: inline-block; font-size: 11px; font-weight: 700;
    background: rgba(0,0,0,.12); color: inherit;
    padding: 1px 6px; border-radius: 8px; margin-left: 4px;
}
.filter-tab.active .filter-tab__count { background: rgba(255,255,255,.25); }

/* ──────────────────────────────────────
   Dashboard
────────────────────────────────────── */
.stat-card          { border-top: 3px solid #1a1a2e; text-decoration: none; display: block; transition: transform .1s, box-shadow .1s; }
.stat-card--urgent  { border-top-color: #e67e22; }
.stat-card--danger  { border-top-color: #e94560; }
.stat-card--done    { border-top-color: #27ae60; }
.stat-card__value   { font-size: 36px; font-weight: 700; color: #1a1a2e; line-height: 1; }
.stat-card__label   { font-size: 13px; color: #888; margin-top: 6px; }
a.stat-card:hover   { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,.1); }
.section-title { font-size: 14px; font-weight: 600; color: #555; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 10px; }
.more-link-wrap { margin-top: 10px; text-align: right; }
.more-link { font-size: 13px; color: #1a1a2e; }

/* ──────────────────────────────────────
   Field Job List
────────────────────────────────────── */
.job-section { margin-bottom: 28px; }
.job-section__header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.job-section__title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: #555; }
.job-section__count { background: #1a1a2e; color: #fff; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 10px; }
.job-section--done { margin-top: 8px; padding-top: 20px; border-top: 1px solid #eee; }
.job-section__count--done { background: #27ae60; }
.job-list { display: flex; flex-direction: column; gap: 10px; }

.field-card {
    display: block; background: #fff; border-radius: 8px;
    padding: 14px 16px; text-decoration: none; color: inherit;
    box-shadow: 0 1px 3px rgba(0,0,0,.08); border-left: 4px solid #ddd;
}
.field-card--urgent  { border-left-color: #e94560; }
.field-card__top     { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 4px; }
.field-card__building { font-weight: 700; font-size: 15px; line-height: 1.3; }
.field-card__type    { font-size: 13px; color: #555; margin-bottom: 4px; }
.field-card__meta    { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.field-card__due     { font-size: 12px; color: #999; }
.field-card__due--overdue { color: #e94560; font-weight: 600; }
.sig-required        { font-size: 11px; color: #888; }

/* ──────────────────────────────────────
   Job View (office readonly)
────────────────────────────────────── */
.view-grid   { display: grid; gap: 20px; align-items: start; }
.view-col    { display: flex; flex-direction: column; gap: 16px; }
.view-section-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: #aaa; margin-bottom: 16px; }
.view-fields-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.view-field  { display: flex; flex-direction: column; gap: 4px; }
.view-label  { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: #bbb; font-weight: 600; }
.view-value  { font-size: 14px; color: #333; }
.view-notes     { font-size: 14px; color: #444; white-space: pre-wrap; line-height: 1.6; margin: 0; }
.view-empty-msg { font-size: 14px; color: #bbb; margin: 0; }
.view-note-label  { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: #bbb; margin-bottom: 6px; }
.view-note-block  { margin-bottom: 4px; }
.view-media-block { margin-bottom: 4px; }
.view-divider { margin-top: 20px; padding-top: 16px; border-top: 1px solid #f0f0f0; }
.view-file-link { font-size: 14px; font-weight: 600; color: #1a1a2e; text-decoration: none; }
.view-file-link:hover { text-decoration: underline; }
.job-view-subtitle { font-size: 14px; color: #888; margin-top: 2px; }

.job-complete-banner {
    display: flex; align-items: center; gap: 14px;
    background: #d4edda; border: 1px solid #b8dfc6;
    border-radius: 8px; padding: 14px 18px;
}
.job-complete-banner__icon {
    width: 36px; height: 36px; border-radius: 50%;
    background: #27ae60; color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; font-weight: 700; flex-shrink: 0;
}
.job-complete-banner__title { font-weight: 700; font-size: 15px; color: #155724; }
.job-complete-banner__meta  { font-size: 13px; color: #1a5c2f; margin-top: 2px; }

/* ──────────────────────────────────────
   Field Detail (mobile job page)
────────────────────────────────────── */
.job-summary-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 14px; }
.job-building { font-size: 20px; font-weight: 700; color: #1a1a2e; }
.job-type     { font-size: 15px; color: #555; margin-top: 3px; }
.detail-grid  { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.detail-item  { display: flex; flex-direction: column; gap: 3px; }
.detail-label { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: #aaa; font-weight: 600; }
.card-section { margin-top: 14px; padding-top: 14px; border-top: 1px solid #f0f0f0; }
.action-stack { display: flex; gap: 10px; flex-direction: column; }
.pre-wrap { font-size: 14px; color: #444; white-space: pre-wrap; }
.complete-title { font-size: 22px; font-weight: 700; color: #155724; }
.complete-notes { margin-top: 12px; font-size: 14px; color: #1a3c20; text-align: left; }

.btn-complete {
    width: 100%; padding: 16px;
    background: #1a7a40; color: #fff;
    border: none; border-radius: 8px;
    font-size: 17px; font-weight: 700;
    cursor: pointer; letter-spacing: .3px;
}
.btn-complete:hover { background: #155724; }
.btn-clear {
    background: none; border: none;
    font-size: 13px; color: #888;
    cursor: pointer; padding: 0; margin-top: 6px;
}

/* ──────────────────────────────────────
   Photo capture widget
────────────────────────────────────── */
.photo-capture-wrap { position: relative; }

.photo-capture-btn {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 8px; width: 100%; padding: 28px 16px;
    background: #f7f8fa; border: 2px dashed #ccc; border-radius: 8px;
    color: #555; cursor: pointer; font-size: 14px; font-weight: 500;
    transition: border-color .15s, background .15s;
}
.photo-capture-btn:hover { border-color: #1a1a2e; background: #f0f1f5; color: #1a1a2e; }
.photo-capture-icon { font-size: 28px; line-height: 1; }

.photo-capture-preview {
    width: 100%; border-radius: 8px; display: block;
    object-fit: contain; max-height: 260px; background: #f8f9fa;
}

.photo-capture-actions {
    display: flex; align-items: center; gap: 12px; margin-top: 8px;
}
.photo-capture-retake {
    background: none; border: 1px solid #ccc; border-radius: 6px;
    padding: 5px 12px; font-size: 13px; cursor: pointer; color: #555;
}
.photo-capture-retake:hover { border-color: #1a1a2e; color: #1a1a2e; }
.photo-capture-view { font-size: 13px; color: #888; text-decoration: none; }
.photo-capture-view:hover { color: #1a1a2e; }

/* ──────────────────────────────────────
   Photos
────────────────────────────────────── */
.photo-thumb {
    display: block;
    margin-top: 8px;
    max-width: 120px;
    border-radius: 6px;
    border: 1px solid #eee;
    object-fit: cover;
}
.photo-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.photo-view-img {
    width: 100%;
    border-radius: 6px;
    border: 1px solid #eee;
    object-fit: cover;
    display: block;
    max-height: 240px;
}
.photo-view-img:hover { opacity: .9; }

.view-media-img {
    width: 100%;
    display: block;
    object-fit: contain;
    max-height: 340px;
    background: #f8f9fa;
    border-radius: 6px;
    transition: opacity .15s;
}
.view-media-img:hover { opacity: .9; }

/* ──────────────────────────────────────
   Signatures
────────────────────────────────────── */
.sig-name       { margin: 10px 0 12px; font-size: 15px; font-weight: 600; color: #333; }
.sig-img-wrap   { border: 1px solid #eee; border-radius: 6px; overflow: hidden; background: #fff; }
.sig-img        { width: 100%; display: block; }
.sig-canvas-wrap { border: 1px solid #ddd; border-radius: 6px; overflow: hidden; background: #fff; touch-action: none; }
.sig-canvas     { width: 100%; height: 180px; display: block; }

/* ──────────────────────────────────────
   Kanban / Queue Board
────────────────────────────────────── */
.board-wrap  { overflow-x: auto; padding-bottom: 16px; }
.kanban      { display: flex; gap: 14px; align-items: flex-start; min-width: max-content; }
.kanban__col { width: 240px; flex-shrink: 0; background: #eef0f3; border-radius: 10px; padding: 12px; }
.kanban__col--done { background: #f0f4f0; }
.kanban__col-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 2px solid transparent; }
.kanban__col-header--queue { border-bottom-color: #aac4e8; }
.kanban__col-header--team  { border-bottom-color: #1a1a2e; }
.kanban__col-header--done  { border-bottom-color: #27ae60; }
.kanban__col-title  { font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: #444; }
.kanban__col-count  { background: #fff; color: #888; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 10px; }
.kanban__cards      { display: flex; flex-direction: column; gap: 8px; min-height: 60px; }

.kcard          { background: #fff; border-radius: 7px; padding: 11px 12px; box-shadow: 0 1px 3px rgba(0,0,0,.07); cursor: grab; border-left: 3px solid #ddd; user-select: none; }
.kcard--urgent  { border-left-color: #e94560; }
.kcard--ghost   { opacity: .35; background: #e0e4ea; }
.kcard:active   { cursor: grabbing; }
.kcard__top     { display: flex; justify-content: space-between; align-items: flex-start; gap: 6px; margin-bottom: 5px; }
.kcard__type    { font-size: 11px; color: #888; text-transform: uppercase; letter-spacing: .4px; font-weight: 600; }
.kcard__urgent  { font-size: 10px; font-weight: 700; color: #e94560; text-transform: uppercase; letter-spacing: .5px; flex-shrink: 0; }
.kcard__building { font-size: 13px; font-weight: 600; color: #222; margin-bottom: 4px; }
.kcard__assigned { font-size: 12px; color: #666; margin-bottom: 3px; }
.kcard__due     { font-size: 11px; color: #aaa; }
.kcard__due--overdue { color: #e94560; font-weight: 600; }
.kcard__actions { display: flex; gap: 8px; margin-top: 8px; padding-top: 8px; border-top: 1px solid #f0f0f0; }
.kcard__actions a, .kcard__delete { font-size: 12px; color: #888; text-decoration: none; background: none; border: none; cursor: pointer; padding: 0; }
.kcard__actions a:hover { color: #1a1a2e; }
.kcard__delete:hover    { color: #c0392b; }

/* ──────────────────────────────────────
   Jobs List (office card view)
────────────────────────────────────── */
.job-card-list { display: flex; flex-direction: column; gap: 10px; }

.job-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
    border-left: 4px solid #ddd;
    display: flex;
    align-items: stretch;
    gap: 0;
    overflow: hidden;
}
.job-card--urgent { border-left-color: #e94560; }

.job-card__main {
    flex: 1;
    padding: 14px 16px;
    min-width: 0;
    color: inherit;
    text-decoration: none;
    display: block;
}
.job-card__main:hover { background: #f7f8fa; }
.job-card__top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 4px;
}
.job-card__building { font-weight: 700; font-size: 15px; color: #1a1a2e; }
.job-card__type     { font-size: 13px; color: #666; margin-bottom: 8px; }
.job-card__meta     { display: flex; flex-wrap: wrap; gap: 12px; }
.job-card__meta-item { font-size: 12px; color: #555; display: flex; align-items: center; gap: 4px; }
.job-card__meta-label { font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: #bbb; font-weight: 600; }
.job-card__due--overdue { color: #e94560; font-weight: 600; }

.job-card__actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px;
    border-left: 1px solid #f0f0f0;
    background: #fafafa;
    justify-content: center;
    flex-shrink: 0;
}

@media (max-width: 576px) {
    .job-card { flex-direction: column; }
    .job-card__actions {
        flex-direction: row;
        border-left: none;
        border-top: 1px solid #f0f0f0;
        padding: 10px 14px;
    }
}

/* ──────────────────────────────────────
   Migrate Page
────────────────────────────────────── */
.migrate-row--success { background: #d4edda; }
.migrate-row--skipped { background: #fff3cd; }
.migrate-row--error   { background: #f8d7da; }
.migrate-table td:first-child { font-family: monospace; }
.migrate-status { text-transform: uppercase; font-size: 13px; font-weight: 600; }

/* ──────────────────────────────────────
   Seen by
────────────────────────────────────── */
.seen-by-list { display: flex; flex-direction: column; gap: 6px; }
.seen-by-item { display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.seen-by-name { font-weight: 600; color: #333; }
.seen-by-time { color: #aaa; font-size: 12px; }

/* ──────────────────────────────────────
   My Jobs
────────────────────────────────────── */
.my-jobs-section { margin-bottom: 24px; }
.my-jobs-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #888;
    padding: 0 4px 8px;
    border-bottom: 2px solid #e9ecef;
    margin-bottom: 10px;
}
.my-jobs-section-header--overdue { color: #c0392b; border-bottom-color: #fadbd8; }
.my-jobs-section-header--today   { color: #e67e22; border-bottom-color: #fdebd0; }
.my-jobs-section-header--done    { color: #aaa;    border-bottom-color: #eee; }
.my-jobs-section-header--unassigned { color: #8e44ad; border-bottom-color: #e8daef; }
.my-jobs-count {
    background: #e9ecef;
    color: #555;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 20px;
}

/* ──────────────────────────────────────
   Recurring Jobs
────────────────────────────────────── */
.recur-options { display: flex; flex-direction: column; gap: 8px; }

.recur-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border: 1.5px solid #dee2e6;
    border-radius: 8px;
    cursor: pointer;
    font-weight: normal;
    transition: border-color .15s, background .15s;
}
.recur-option:has(input[type="radio"]:checked) { border-color: #1a1a2e; background: #f8f9fb; }
.recur-option input[type="radio"] { margin-top: 3px; flex-shrink: 0; accent-color: #1a1a2e; }

.recur-option-body  { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.recur-option-text  { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 500; flex-wrap: wrap; }
.recur-option-hint  { font-size: 12px; color: #aaa; }

.recur-inline-num {
    width: 60px;
    padding: 3px 6px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    text-align: center;
    background: #fff;
}
.recur-inline-select {
    padding: 3px 8px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
    cursor: pointer;
}

.recur-preview {
    font-size: 13px;
    color: #555;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #1a1a2e;
    min-height: 34px;
}

/* ──────────────────────────────────────
   Calendar
────────────────────────────────────── */
.cal-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: #dee2e6;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
    min-width: 560px;
}

.cal-header {
    background: #f8f9fa;
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #888;
    padding: 8px 4px;
}

.cal-cell {
    background: #fff;
    min-height: 110px;
    padding: 6px;
    vertical-align: top;
}
.cal-cell--empty   { background: #f8f9fa; min-height: 110px; }
.cal-cell--today   { background: #eff6ff; }
.cal-cell--overdue { background: #fff8f8; }

.cal-day-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 600;
    color: #888;
    margin-bottom: 4px;
}
.cal-day-num--today { background: #1a1a2e; color: #fff; }

.cal-pill {
    display: block;
    font-size: 11px;
    line-height: 1.3;
    padding: 2px 6px;
    border-radius: 4px;
    margin-bottom: 3px;
    background: #e9ecef;
    color: #333;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-left: 3px solid #adb5bd;
    transition: opacity .15s;
}
.cal-pill:hover         { opacity: .8; color: #333; }
.cal-pill--urgent       { background: #fdecea; border-left-color: #e94560; color: #c0392b; }
.cal-pill--urgent:hover { color: #c0392b; }
.cal-pill--done         { background: #f0faf4; border-left-color: #27ae60; color: #27ae60; opacity: .75; }
.cal-pill--done:hover   { opacity: 1; color: #27ae60; }
.cal-pill--created      { border-left-color: #ced4da; color: #666; }
.cal-pill-dot           { margin-right: 2px; }

.cal-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
    align-items: center;
    font-size: 12px;
    color: #888;
}
.cal-legend-item { display: flex; align-items: center; gap: 5px; }
.cal-legend .cal-pill { margin: 0; pointer-events: none; }

/* ──────────────────────────────────────
   Comments thread
────────────────────────────────────── */
.comments-thread { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.comment-item { background: #f8f9fa; border-radius: 6px; padding: 10px 14px; }
.comment-meta { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.comment-author { font-weight: 600; font-size: 13px; }
.comment-time { font-size: 12px; color: #888; }
.comment-body { font-size: 14px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.comment-form textarea { width: 100%; border: 1px solid #dee2e6; border-radius: 6px; padding: 8px 12px; font-size: 14px; resize: vertical; }
.comment-form textarea:focus { outline: none; border-color: #1a1a2e; box-shadow: 0 0 0 3px rgba(26,26,46,.08); }

/* ──────────────────────────────────────
   History / audit trail
────────────────────────────────────── */
.history-timeline { display: flex; flex-direction: column; gap: 0; }
.history-item { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid #f1f3f5; }
.history-item:last-child { border-bottom: none; }
.history-dot { flex-shrink: 0; width: 10px; height: 10px; border-radius: 50%; background: #ced4da; margin-top: 4px; }
.history-dot--created  { background: #1a1a2e; }
.history-dot--assigned { background: #0d6efd; }
.history-dot--warn     { background: #ffc107; }
.history-dot--status   { background: #6c757d; }
.history-dot--done     { background: #27ae60; }
.history-dot--wa       { background: #25d366; }
.history-action { font-size: 13px; font-weight: 500; }
.history-meta   { font-size: 12px; color: #888; margin-top: 1px; }

/* ──────────────────────────────────────
   Checkbox list (recurring assignees)
────────────────────────────────────── */
.checkbox-group-list { display: flex; flex-direction: column; gap: 6px; }

/* ──────────────────────────────────────
   Responsive
────────────────────────────────────── */
@media (max-width: 767px) {
    .view-grid        { grid-template-columns: 1fr; }
    .view-fields-grid { grid-template-columns: 1fr; }
    .detail-grid      { grid-template-columns: 1fr; }
}
@media (min-width: 768px) {
    .menu-toggle { display: none; }
    .user-name   { display: block; }
    .app-body    { align-items: flex-start; }
    .app-sidebar {
        position: sticky; top: 56px;
        height: calc(100vh - 56px);
        overflow-y: auto;
        transform: none; flex-shrink: 0;
    }
    .app-main {
        padding: 32px 28px;
        overflow-y: visible;
        overflow-x: visible;
    }
    .sidebar-overlay { display: none !important; }
    .view-grid { grid-template-columns: 340px 1fr; }
}
