/* ── Font ── */
* { font-family: 'Somar', sans-serif; }

/* ── Stats Cards ── */
.stat-card {
    background: var(--card-bg, #fff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 14px;
    padding: 1.1rem 1.4rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: box-shadow 0.2s, border-color 0.2s, background 0.2s;
}
.stat-card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,.06);
    border-color: var(--border-hover, #cbd5e1);
}
.stat-card.bg-blue { background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%); border-color: #bfdbfe; }
.stat-card.bg-green { background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%); border-color: #bbf7d0; }
.stat-card.bg-sky { background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%); border-color: #bae6fd; }
.stat-card.bg-orange { background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%); border-color: #fed7aa; }
.dark .stat-card.bg-blue { background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%); border-color: #3b82f6; }
.dark .stat-card.bg-green { background: linear-gradient(135deg, #14532d 0%, #166534 100%); border-color: #22c55e; }
.dark .stat-card.bg-sky { background: linear-gradient(135deg, #0c4a6e 0%, #0369a1 100%); border-color: #0ea5e9; }
.dark .stat-card.bg-orange { background: linear-gradient(135deg, #7c2d12 0%, #c2410c 100%); border-color: #f97316; }
.stat-icon {
    width: 42px; height: 42px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}
.stat-value { font-size: 1.45rem; font-weight: 700; line-height: 1; }
.stat-label { font-size: 0.75rem; margin-top: 3px; }

/* ── Table wrapper ── */
.projects-card {
    background: var(--card-bg, #fff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 16px;
    overflow: hidden;
}

/* ── Table toolbar ── */
.table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color, #e2e8f0);
    gap: 1rem;
    flex-wrap: wrap;
}

/* ── DataTable overrides ── */
.data-table thead tr {
    border-bottom: 1.5px solid var(--border-color, #e2e8f0);
}
.data-table thead th {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--th-color, #94a3b8);
    padding: 0.85rem 1.1rem;
    white-space: nowrap;
    border-bottom: none;
}
.data-table tbody tr {
    border-bottom: 1px solid var(--row-border, #f1f5f9);
    transition: background 0.15s;
}
.data-table tbody tr:last-child { border-bottom: none; }
.data-table tbody tr:hover { background: var(--row-hover, #f8fafc); }
.data-table tbody td {
    padding: 0.9rem 1.1rem;
    vertical-align: middle;
    font-size: 0.875rem;
}

/* ── Status badges ── */
.status-badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 10px 3px 9px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
}
.status-badge::before {
    content: ''; width: 6px; height: 6px;
    border-radius: 50%; display: inline-block; flex-shrink: 0;
}
.badge-active    { background:#dcfce7; color:#166534; }
.badge-active::before    { background:#22c55e; }
.badge-pending   { background:#fef9c3; color:#854d0e; }
.badge-pending::before   { background:#eab308; }
.badge-completed { background:#dbeafe; color:#1e40af; }
.badge-completed::before { background:#3b82f6; }
.badge-paused    { background:#f1f5f9; color:#475569; }
.badge-paused::before    { background:#94a3b8; }
.badge-cancelled { background:#fee2e2; color:#991b1b; }
.badge-cancelled::before { background:#ef4444; }

/* ── Action buttons ── */
.action-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 30px; height: 30px; border-radius: 8px;
    font-size: 13px;
    border: 1px solid transparent;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    cursor: pointer; text-decoration: none;
    flex-shrink: 0;
}
.action-btn-view  { color: #64748b; background: #f8fafc; border-color: #e2e8f0; }
.action-btn-view:hover  { background: #eff6ff; border-color: #bfdbfe; color: #2563eb; }
.action-btn-edit  { color: #64748b; background: #f8fafc; border-color: #e2e8f0; }
.action-btn-edit:hover  { background: #f0fdf4; border-color: #bbf7d0; color: #16a34a; }
.action-btn-delete { color: #64748b; background: #f8fafc; border-color: #e2e8f0; }
.action-btn-delete:hover { background: #fff1f2; border-color: #fecdd3; color: #e11d48; }

/* Prevent action buttons from wrapping/overlapping */
.actions-col { white-space: nowrap; }

/* ── Checkbox ── */
.row-checkbox,
.select-all {
    width: 15px; height: 15px;
    border-radius: 4px;
    border: 1.5px solid #cbd5e1;
    cursor: pointer;
    accent-color: #0ea5e9;
}

/* ── Search input ── */
.dt-search-input {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.45rem 2.25rem 0.45rem 0.9rem;
    font-size: 0.85rem;
    outline: none;
    background: #f8fafc;
    transition: border-color 0.15s, box-shadow 0.15s;
    min-width: 200px;
}
.dt-search-input:focus {
    border-color: #7dd3fc;
    box-shadow: 0 0 0 3px rgba(14,165,233,.1);
    background: #fff;
}
.dt-search-wrap {position: relative;text-align: right;}
.dt-search-wrap .search-icon {
    position: absolute;
    inset-inline-start: 0.65rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 14px;
    pointer-events: none;
    /* right: 89%; */
}

/* ── Length select ── */
.dt-length-select {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.42rem 0.75rem;
    font-size: 0.82rem;
    outline: none;
    background: #f8fafc;
    color: #334155;
    cursor: pointer;
}

/* ── Pagination ── */
.dataTables_paginate .paginate_button {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 32px; height: 32px; padding: 0 8px;
    border-radius: 8px; font-size: 0.82rem;
    border: 1px solid transparent !important;
    cursor: pointer; margin: 0 2px;
    transition: background 0.15s, border-color 0.15s;
}
.dataTables_paginate .paginate_button:hover:not(.disabled) {
    background: #f1f5f9 !important; border-color: #e2e8f0 !important; color: #0f172a !important;
}
.dataTables_paginate .paginate_button.current {
    background: #0ea5e9 !important; border-color: #0ea5e9 !important;
    color: #fff !important; font-weight: 600;
}
.dataTables_paginate .paginate_button.disabled { opacity: .4; cursor: not-allowed; }

/* ── Info text ── */
.dataTables_info { font-size: 0.78rem; color: #94a3b8; }

/* ── Bulk delete bar ── */
#bulk-bar {
    display: none;
    align-items: center;
    gap: 0.75rem;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 10px;
    padding: 0.75rem 1.25rem;
    font-size: 0.85rem;
    color: #9a3412;
    margin-bottom: 1rem;
    animation: slideDown .2s ease;
    width: 100%;
    box-sizing: border-box;
}
#bulk-bar.show { display: flex; }
@keyframes slideDown {
    from { opacity:0; transform: translateY(-6px); }
    to   { opacity:1; transform: translateY(0); }
}

/* ── Dark mode ── */
.dark .stat-card   { --card-bg:#1e293b; --border-color:#334155; --border-hover:#475569; }
.dark .stat-label  { color: #94a3b8; }
.dark .projects-card { --card-bg:#1e293b; --border-color:#334155; }
.dark .data-table thead th { --th-color:#475569; color:#475569; }
.dark .data-table tbody tr { --row-border:#1e293b; --row-hover:#1a2a3a; }
.dark .data-table tbody td { color: #cbd5e1; }
.dark .action-btn-view,
.dark .action-btn-edit,
.dark .action-btn-delete { background:#0f172a; border-color:#334155; color:#94a3b8; }
.dark .dt-search-input,
.dark .dt-length-select { background:#0f172a; border-color:#334155; color:#cbd5e1; }
.dark .dt-search-input:focus { border-color:#0ea5e9; background:#0f172a; }
.dark .dataTables_paginate .paginate_button:hover:not(.disabled) { background:#1e293b !important; border-color:#334155 !important; color:#e2e8f0 !important; }
.dark .table-toolbar { border-bottom-color:#334155; }
.dark #bulk-bar { background:#431407; border-color:#7c2d12; color:#fed7aa; }
.dark .badge-active    { background:#14532d; color:#86efac; }
.dark .badge-pending   { background:#422006; color:#fde68a; }
.dark .badge-completed { background:#1e3a8a; color:#93c5fd; }
.dark .badge-paused    { background:#1e293b; color:#94a3b8; }
.dark .badge-cancelled { background:#450a0a; color:#fca5a5; }
.dark .row-checkbox, .dark .select-all { border-color:#475569; }

/* ── Form Layout ── */
.form-card {
    background: var(--card-bg, #fff);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 16px;
    overflow: hidden;
}
.dark .form-card { --card-bg:#1e293b; --border:#334155; }

.form-card-header {
    padding: 1.25rem 1.75rem;
    border-bottom: 1px solid var(--border, #e2e8f0);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.header-icon {
    width: 36px; height: 36px;
    border-radius: 9px;
    background: #eff6ff;
    display: flex; align-items: center; justify-content: center;
    color: #3b82f6; font-size: 15px; flex-shrink: 0;
}
.dark .header-icon { background: #1e3a8a; color: #93c5fd; }

/* ── Sections ── */
.form-section {
    padding: 1.5rem 1.75rem;
    border-bottom: 1px solid var(--border, #e2e8f0);
}
.form-section:last-of-type { border-bottom: none; }

.section-label {
    display: flex; align-items: center; gap: 7px;
    font-size: 0.85rem; font-weight: 700;
    letter-spacing: 0.07em; text-transform: uppercase;
    color: #94a3b8;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px dashed #f1f5f9;
}
.dark .section-label { color: #475569; border-bottom-color: #334155; }
.section-label-icon {
    width: 22px; height: 22px; border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px;
}

/* ── Field ── */
.field-group { display: flex; flex-direction: column; gap: 6px; }
.field-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: #475569;
}
.dark .field-label { color: #94a3b8; }
.field-label .req { color: #f43f5e; margin-right: 2px; }

.input-wrap { position: relative; }
.input-icon {
    position: absolute;
    inset-inline-end: 14px;
    top: 50%; transform: translateY(-50%);
    color: #cbd5e1; font-size: 13px;
    pointer-events: none;
    transition: color 0.15s;
}
.input-icon-top {
    position: absolute;
    inset-inline-end: 14px;
    top: 14px;
    color: #cbd5e1; font-size: 13px;
    pointer-events: none;
}

/* base input */
.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.5rem 2.5rem 0.5rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.875rem;
    background: #f8fafc;
    color: #0f172a;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
    -webkit-appearance: none; appearance: none;
}
.form-textarea { padding: 0.5rem 1rem; resize: none; }
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: #7dd3fc;
    box-shadow: 0 0 0 3px rgba(14,165,233,.1);
    background: #fff;
}
.form-input::placeholder,
.form-textarea::placeholder { color: #cbd5e1; }
.form-input.is-error,
.form-select.is-error { border-color: #fca5a5; background: #fff1f2; }
.field-error {
    font-size: 0.75rem; color: #e11d48;
    display: flex; align-items: center; gap: 4px;
}

.dark .form-input,
.dark .form-select,
.dark .form-textarea {
    background: #0f172a; border-color: #334155; color: #e2e8f0;
}
.dark .form-input:focus,
.dark .form-select:focus,
.dark .form-textarea:focus {
    border-color: #0ea5e9; background: #0f172a;
    box-shadow: 0 0 0 3px rgba(14,165,233,.12);
}
.dark .form-input::placeholder,
.dark .form-textarea::placeholder { color: #334155; }

/* select arrow */
.select-arrow {
    position: absolute;
    inset-inline-start: 12px;
    top: 50%; transform: translateY(-50%);
    color: #cbd5e1; font-size: 11px;
    pointer-events: none;
}

/* ── Status pills selector ── */
.status-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.status-pill input[type="radio"] { display: none; }
.status-pill label {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    border: 1.5px solid #e2e8f0;
    font-size: 0.78rem; font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    background: #f8fafc;
    color: #64748b;
}
.status-pill label::before {
    content: ''; width: 6px; height: 6px;
    border-radius: 50%; flex-shrink: 0;
}
/* active */
.status-pill.s-active input:checked ~ label,
.status-pill.s-active label:hover   { background:#dcfce7; border-color:#86efac; color:#166534; }
.status-pill.s-active label::before { background:#22c55e; }
/* pending */
.status-pill.s-pending input:checked ~ label,
.status-pill.s-pending label:hover  { background:#fef9c3; border-color:#fde047; color:#854d0e; }
.status-pill.s-pending label::before{ background:#eab308; }
/* completed */
.status-pill.s-completed input:checked ~ label,
.status-pill.s-completed label:hover{ background:#dbeafe; border-color:#93c5fd; color:#1e40af; }
.status-pill.s-completed label::before{ background:#3b82f6; }
/* paused */
.status-pill.s-paused input:checked ~ label,
.status-pill.s-paused label:hover   { background:#f1f5f9; border-color:#cbd5e1; color:#475569; }
.status-pill.s-paused label::before { background:#94a3b8; }
/* cancelled */
.status-pill.s-cancelled input:checked ~ label,
.status-pill.s-cancelled label:hover{ background:#fee2e2; border-color:#fca5a5; color:#991b1b; }
.status-pill.s-cancelled label::before{ background:#ef4444; }

.dark .status-pill label { background:#0f172a; border-color:#334155; color:#64748b; }

/* ── Value display ── */
.value-suffix {
    position: absolute;
    inset-inline-start: 12px;
    top: 50%; transform: translateY(-50%);
    font-size: 0.75rem; font-weight: 600;
    color: #94a3b8; pointer-events: none;
}
.form-input.has-suffix { padding-inline-start: 3rem; }

/* ── File Upload ── */
.file-upload-area {
    border: 2px dashed #cbd5e1;
    border-radius: 0.75rem;
    padding: 2rem;
    min-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    background: #f8fafc;
    cursor: pointer;
}
.file-upload-area.is-dragging {
    border-color: #0ea5e9;
    background: #f0f9ff;
}
.file-upload-area.has-file {
    border-style: solid;
    border-color: #e2e8f0;
    background: #fff;
}
.file-upload-area.has-error {
    border-color: #ef4444;
    background: #fef2f2;
}
.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}
.image-preview-wrapper {
    position: relative;
    width: 100%;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    overflow: hidden;
}
.image-preview {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.file-preview-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    opacity: 0;
    transition: opacity 0.2s;
}
.image-preview-wrapper:hover .file-preview-overlay {
    opacity: 1;
}
.btn-overlay {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    background: white;
    border-radius: 50%;
    color: #64748b;
    transition: all 0.2s;
}
.btn-overlay:hover {
    background: #f1f5f9;
    color: #0ea5e9;
}
.btn-overlay--danger:hover {
    background: #fef2f2;
    color: #ef4444;
}
.file-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
}
.file-card__icon {
    flex-shrink: 0;
}
.file-card__info {
    flex: 1;
    min-width: 0;
}
.file-card__name {
    font-weight: 500;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.file-card__meta {
    color: #64748b;
}
.file-card__actions {
    display: flex;
    gap: 0.5rem;
}
.btn-file-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    color: #64748b;
    transition: all 0.2s;
}
.btn-file-action:hover {
    background: #f1f5f9;
    color: #0ea5e9;
}
.btn-file-action--danger:hover {
    background: #fef2f2;
    color: #ef4444;
    border-color: #fecaca;
}
.multi-files-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
}
.file-card--compact {
    padding: 0.5rem 0.75rem;
}
.btn-add-more {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #f0f9ff;
    color: #0ea5e9;
    border: 1px dashed #0ea5e9;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
}
.btn-add-more:hover {
    background: #e0f2fe;
}

/* ── Actions footer ── */
.form-footer {
    padding: 1.1rem 1.75rem;
    border-top: 1px solid var(--border, #e2e8f0);
    display: flex; align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.btn-cancel {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 0.6rem 1.25rem;
    border-radius: 9px;
    font-size: 0.9rem; font-weight: 600;
    color: #ef4444;
    border: 1px solid #fecaca;
    background: #fef2f2;
    transition: all 0.15s;
    text-decoration: none;
}
.btn-cancel:hover { background: #fee2e2; border-color: #fca5a5; color: #dc2626; }
.btn-save {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 0.65rem 1.5rem;
    border-radius: 9px;
    font-size: 0.9rem; font-weight: 600;
    color: #fff;
    background: #22c55e;
    border: 1px solid #16a34a;
    transition: all 0.15s;
    cursor: pointer;
    box-shadow: 0 1px 6px rgba(34,197,94,.3);
}
.btn-save:hover { background: #16a34a; }
.btn-save:active { transform: scale(.98); }
.dark .btn-cancel { background:#450a0a; border-color:#7f1d1d; color:#fca5a5; }
.dark .btn-cancel:hover { background:#7f1d1d; }
.data-table thead th {
    text-align: right;
}

table.dataTable thead>tr>th.sorting:before, table.dataTable thead>tr>th.sorting:after, table.dataTable thead>tr>th.sorting_asc:before, table.dataTable thead>tr>th.sorting_asc:after, table.dataTable thead>tr>th.sorting_desc:before, table.dataTable thead>tr>th.sorting_desc:after, table.dataTable thead>tr>th.sorting_asc_disabled:before, table.dataTable thead>tr>th.sorting_asc_disabled:after, table.dataTable thead>tr>th.sorting_desc_disabled:before, table.dataTable thead>tr>th.sorting_desc_disabled:after, table.dataTable thead>tr>td.sorting:before, table.dataTable thead>tr>td.sorting:after, table.dataTable thead>tr>td.sorting_asc:before, table.dataTable thead>tr>td.sorting_asc:after, table.dataTable thead>tr>td.sorting_desc:before, table.dataTable thead>tr>td.sorting_desc:after, table.dataTable thead>tr>td.sorting_asc_disabled:before, table.dataTable thead>tr>td.sorting_asc_disabled:after, table.dataTable thead>tr>td.sorting_desc_disabled:before, table.dataTable thead>tr>td.sorting_desc_disabled:after {
    left: 10px;
    right:unset;
}

/* ── SweetAlert Popup Size Reduction ── */
.swal2-popup {
    font-size: 0.85rem !important;
    padding: 1rem !important;
    width: 32em !important;
    max-width: 90vw !important;
}
.swal2-title {
    font-size: 1.1rem !important;
    margin: 0 0 0.5rem 0 !important;
}
.swal2-html-container {
    font-size: 0.9rem !important;
    padding: 0.5rem 0 !important;
}
.swal2-actions {
    margin: 0.5rem auto 0 !important;
}
.swal2-confirm,
.swal2-cancel {
    padding: 0.5rem 1rem !important;
    font-size: 0.85rem !important;
}
.swal2-icon {
    width: 3em !important;
    height: 3em !important;
    font-size: 1.5em !important;
}
.swal2-icon .swal2-icon-content {
    font-size: 1.5em !important;
}
.swal2-toast {
    padding: 0.6rem 0.8rem !important;
    font-size: 0.85rem !important;
    min-width: 300px !important;
    max-width: 400px !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.75rem !important;
}
.swal2-toast .swal2-title {
    font-size: 0.9rem !important;
    margin: 0 !important;
    font-weight: 600 !important;
}
.swal2-toast .swal2-html-container {
    font-size: 0.85rem !important;
    padding: 0 !important;
    margin: 0 !important;
}
.swal2-toast .swal2-icon {
    width: 2em !important;
    height: 2em !important;
    font-size: 1.2em !important;
    margin: 0 !important;
}
.swal2-toast .swal2-icon .swal2-icon-content {
    font-size: 1.2em !important;
}/* ── Font ── */
* { font-family: 'Somar', sans-serif; }

/* ── Stats Cards ── */
.stat-card {
    background: var(--card-bg, #fff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 14px;
    padding: 1.1rem 1.4rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: box-shadow 0.2s, border-color 0.2s, background 0.2s;
}
.stat-card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,.06);
    border-color: var(--border-hover, #cbd5e1);
}
.stat-card.bg-blue { background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%); border-color: #bfdbfe; }
.stat-card.bg-green { background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%); border-color: #bbf7d0; }
.stat-card.bg-sky { background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%); border-color: #bae6fd; }
.stat-card.bg-orange { background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%); border-color: #fed7aa; }
.dark .stat-card.bg-blue { background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%); border-color: #3b82f6; }
.dark .stat-card.bg-green { background: linear-gradient(135deg, #14532d 0%, #166534 100%); border-color: #22c55e; }
.dark .stat-card.bg-sky { background: linear-gradient(135deg, #0c4a6e 0%, #0369a1 100%); border-color: #0ea5e9; }
.dark .stat-card.bg-orange { background: linear-gradient(135deg, #7c2d12 0%, #c2410c 100%); border-color: #f97316; }
.stat-icon {
    width: 42px; height: 42px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}
.stat-value { font-size: 1.45rem; font-weight: 700; line-height: 1; }
.stat-label { font-size: 0.75rem; margin-top: 3px; }

/* ── Table wrapper ── */
.projects-card {
    background: var(--card-bg, #fff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 16px;
    overflow: hidden;
}

/* ── Table toolbar ── */
.table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color, #e2e8f0);
    gap: 1rem;
    flex-wrap: wrap;
}

/* ── DataTable overrides ── */
.data-table thead tr {
    border-bottom: 1.5px solid var(--border-color, #e2e8f0);
}
.data-table thead th {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--th-color, #94a3b8);
    padding: 0.85rem 1.1rem;
    white-space: nowrap;
    border-bottom: none;
}
.data-table tbody tr {
    border-bottom: 1px solid var(--row-border, #f1f5f9);
    transition: background 0.15s;
}
.data-table tbody tr:last-child { border-bottom: none; }
.data-table tbody tr:hover { background: var(--row-hover, #f8fafc); }
.data-table tbody td {
    padding: 0.9rem 1.1rem;
    vertical-align: middle;
    font-size: 0.875rem;
}

/* ── Status badges ── */
.status-badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 10px 3px 9px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
}
.status-badge::before {
    content: ''; width: 6px; height: 6px;
    border-radius: 50%; display: inline-block; flex-shrink: 0;
}
.badge-active    { background:#dcfce7; color:#166534; }
.badge-active::before    { background:#22c55e; }
.badge-pending   { background:#fef9c3; color:#854d0e; }
.badge-pending::before   { background:#eab308; }
.badge-completed { background:#dbeafe; color:#1e40af; }
.badge-completed::before { background:#3b82f6; }
.badge-paused    { background:#f1f5f9; color:#475569; }
.badge-paused::before    { background:#94a3b8; }
.badge-cancelled { background:#fee2e2; color:#991b1b; }
.badge-cancelled::before { background:#ef4444; }

/* ── Action buttons ── */
.action-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 30px; height: 30px; border-radius: 8px;
    font-size: 13px;
    border: 1px solid transparent;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    cursor: pointer; text-decoration: none;
    flex-shrink: 0;
}
.action-btn-view  { color: #64748b; background: #f8fafc; border-color: #e2e8f0; }
.action-btn-view:hover  { background: #eff6ff; border-color: #bfdbfe; color: #2563eb; }
.action-btn-edit  { color: #64748b; background: #f8fafc; border-color: #e2e8f0; }
.action-btn-edit:hover  { background: #f0fdf4; border-color: #bbf7d0; color: #16a34a; }
.action-btn-delete { color: #64748b; background: #f8fafc; border-color: #e2e8f0; }
.action-btn-delete:hover { background: #fff1f2; border-color: #fecdd3; color: #e11d48; }

/* Prevent action buttons from wrapping/overlapping */
.actions-col { white-space: nowrap; }

/* ── Checkbox ── */
.row-checkbox,
.select-all {
    width: 15px; height: 15px;
    border-radius: 4px;
    border: 1.5px solid #cbd5e1;
    cursor: pointer;
    accent-color: #0ea5e9;
}

/* ── Search input ── */
.dt-search-input {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.45rem 2.25rem 0.45rem 0.9rem;
    font-size: 0.85rem;
    outline: none;
    background: #f8fafc;
    transition: border-color 0.15s, box-shadow 0.15s;
    min-width: 200px;
}
.dt-search-input:focus {
    border-color: #7dd3fc;
    box-shadow: 0 0 0 3px rgba(14,165,233,.1);
    background: #fff;
}
.dt-search-wrap {position: relative;text-align: right;}
.dt-search-wrap .search-icon {
    position: absolute;
    inset-inline-start: 0.65rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 14px;
    pointer-events: none;
    /* right: 89%; */
}

/* ── Length select ── */
.dt-length-select {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.42rem 0.75rem;
    font-size: 0.82rem;
    outline: none;
    background: #f8fafc;
    color: #334155;
    cursor: pointer;
}

/* ── Pagination ── */
.dataTables_paginate .paginate_button {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 32px; height: 32px; padding: 0 8px;
    border-radius: 8px; font-size: 0.82rem;
    border: 1px solid transparent !important;
    cursor: pointer; margin: 0 2px;
    transition: background 0.15s, border-color 0.15s;
}
.dataTables_paginate .paginate_button:hover:not(.disabled) {
    background: #f1f5f9 !important; border-color: #e2e8f0 !important; color: #0f172a !important;
}
.dataTables_paginate .paginate_button.current {
    background: #0ea5e9 !important; border-color: #0ea5e9 !important;
    color: #fff !important; font-weight: 600;
}
.dataTables_paginate .paginate_button.disabled { opacity: .4; cursor: not-allowed; }

/* ── Info text ── */
.dataTables_info { font-size: 0.78rem; color: #94a3b8; }

/* ── Bulk delete bar ── */
#bulk-bar {
    display: none;
    align-items: center;
    gap: 0.75rem;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 10px;
    padding: 0.75rem 1.25rem;
    font-size: 0.85rem;
    color: #9a3412;
    margin-bottom: 1rem;
    animation: slideDown .2s ease;
    width: 100%;
    box-sizing: border-box;
}
#bulk-bar.show { display: flex; }
@keyframes slideDown {
    from { opacity:0; transform: translateY(-6px); }
    to   { opacity:1; transform: translateY(0); }
}

/* ── Dark mode ── */
.dark .stat-card   { --card-bg:#1e293b; --border-color:#334155; --border-hover:#475569; }
.dark .stat-label  { color: #94a3b8; }
.dark .projects-card { --card-bg:#1e293b; --border-color:#334155; }
.dark .data-table thead th { --th-color:#475569; color:#475569; }
.dark .data-table tbody tr { --row-border:#1e293b; --row-hover:#1a2a3a; }
.dark .data-table tbody td { color: #cbd5e1; }
.dark .action-btn-view,
.dark .action-btn-edit,
.dark .action-btn-delete { background:#0f172a; border-color:#334155; color:#94a3b8; }
.dark .dt-search-input,
.dark .dt-length-select { background:#0f172a; border-color:#334155; color:#cbd5e1; }
.dark .dt-search-input:focus { border-color:#0ea5e9; background:#0f172a; }
.dark .dataTables_paginate .paginate_button:hover:not(.disabled) { background:#1e293b !important; border-color:#334155 !important; color:#e2e8f0 !important; }
.dark .table-toolbar { border-bottom-color:#334155; }
.dark #bulk-bar { background:#431407; border-color:#7c2d12; color:#fed7aa; }
.dark .badge-active    { background:#14532d; color:#86efac; }
.dark .badge-pending   { background:#422006; color:#fde68a; }
.dark .badge-completed { background:#1e3a8a; color:#93c5fd; }
.dark .badge-paused    { background:#1e293b; color:#94a3b8; }
.dark .badge-cancelled { background:#450a0a; color:#fca5a5; }
.dark .row-checkbox, .dark .select-all { border-color:#475569; }

/* ── Form Layout ── */
.form-card {
    background: var(--card-bg, #fff);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 16px;
    overflow: hidden;
}
.dark .form-card { --card-bg:#1e293b; --border:#334155; }

.form-card-header {
    padding: 1.25rem 1.75rem;
    border-bottom: 1px solid var(--border, #e2e8f0);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.header-icon {
    width: 36px; height: 36px;
    border-radius: 9px;
    background: #eff6ff;
    display: flex; align-items: center; justify-content: center;
    color: #3b82f6; font-size: 15px; flex-shrink: 0;
}
.dark .header-icon { background: #1e3a8a; color: #93c5fd; }

/* ── Sections ── */
.form-section {
    padding: 1.5rem 1.75rem;
    border-bottom: 1px solid var(--border, #e2e8f0);
}
.form-section:last-of-type { border-bottom: none; }

.section-label {
    display: flex; align-items: center; gap: 7px;
    font-size: 0.85rem; font-weight: 700;
    letter-spacing: 0.07em; text-transform: uppercase;
    color: #94a3b8;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px dashed #f1f5f9;
}
.dark .section-label { color: #475569; border-bottom-color: #334155; }
.section-label-icon {
    width: 22px; height: 22px; border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px;
}

/* ── Field ── */
.field-group { display: flex; flex-direction: column; gap: 6px; }
.field-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: #475569;
}
.dark .field-label { color: #94a3b8; }
.field-label .req { color: #f43f5e; margin-right: 2px; }

.input-wrap { position: relative; }
.input-icon {
    position: absolute;
    inset-inline-end: 14px;
    top: 50%; transform: translateY(-50%);
    color: #cbd5e1; font-size: 13px;
    pointer-events: none;
    transition: color 0.15s;
}
.input-icon-top {
    position: absolute;
    inset-inline-end: 14px;
    top: 14px;
    color: #cbd5e1; font-size: 13px;
    pointer-events: none;
}

/* base input */
.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.5rem 1rem 0.5rem 0.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.875rem;
    background: #f8fafc;
    color: #0f172a;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
    -webkit-appearance: none;
    appearance: none;
}
.form-textarea { padding: 0.5rem 1rem; resize: none; }
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: #7dd3fc;
    box-shadow: 0 0 0 3px rgba(14,165,233,.1);
    background: #fff;
}
.form-input::placeholder,
.form-textarea::placeholder { color: #cbd5e1; }
.form-input.is-error,
.form-select.is-error { border-color: #fca5a5; background: #fff1f2; }
.field-error {
    font-size: 0.75rem; color: #e11d48;
    display: flex; align-items: center; gap: 4px;
}

.dark .form-input,
.dark .form-select,
.dark .form-textarea {
    background: #0f172a; border-color: #334155; color: #e2e8f0;
}
.dark .form-input:focus,
.dark .form-select:focus,
.dark .form-textarea:focus {
    border-color: #0ea5e9; background: #0f172a;
    box-shadow: 0 0 0 3px rgba(14,165,233,.12);
}
.dark .form-input::placeholder,
.dark .form-textarea::placeholder { color: #334155; }

/* select arrow */
.select-arrow {
    position: absolute;
    inset-inline-start: 12px;
    top: 50%; transform: translateY(-50%);
    color: #cbd5e1; font-size: 11px;
    pointer-events: none;
}

/* ── Status pills selector ── */
.status-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.status-pill input[type="radio"] { display: none; }
.status-pill label {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    border: 1.5px solid #e2e8f0;
    font-size: 0.78rem; font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    background: #f8fafc;
    color: #64748b;
}
.status-pill label::before {
    content: ''; width: 6px; height: 6px;
    border-radius: 50%; flex-shrink: 0;
}
/* active */
.status-pill.s-active input:checked ~ label,
.status-pill.s-active label:hover   { background:#dcfce7; border-color:#86efac; color:#166534; }
.status-pill.s-active label::before { background:#22c55e; }
/* pending */
.status-pill.s-pending input:checked ~ label,
.status-pill.s-pending label:hover  { background:#fef9c3; border-color:#fde047; color:#854d0e; }
.status-pill.s-pending label::before{ background:#eab308; }
/* completed */
.status-pill.s-completed input:checked ~ label,
.status-pill.s-completed label:hover{ background:#dbeafe; border-color:#93c5fd; color:#1e40af; }
.status-pill.s-completed label::before{ background:#3b82f6; }
/* paused */
.status-pill.s-paused input:checked ~ label,
.status-pill.s-paused label:hover   { background:#f1f5f9; border-color:#cbd5e1; color:#475569; }
.status-pill.s-paused label::before { background:#94a3b8; }
/* cancelled */
.status-pill.s-cancelled input:checked ~ label,
.status-pill.s-cancelled label:hover{ background:#fee2e2; border-color:#fca5a5; color:#991b1b; }
.status-pill.s-cancelled label::before{ background:#ef4444; }

.dark .status-pill label { background:#0f172a; border-color:#334155; color:#64748b; }

/* ── Value display ── */
.value-suffix {
    position: absolute;
    inset-inline-start: 12px;
    top: 50%; transform: translateY(-50%);
    font-size: 0.75rem; font-weight: 600;
    color: #94a3b8; pointer-events: none;
}
.form-input.has-suffix { padding-inline-start: 3rem; }

/* ── File Upload ── */
.file-upload-area {
    border: 2px dashed #cbd5e1;
    border-radius: 0.75rem;
    padding: 2rem;
    min-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    background: #f8fafc;
    cursor: pointer;
}
.file-upload-area.is-dragging {
    border-color: #0ea5e9;
    background: #f0f9ff;
}
.file-upload-area.has-file {
    border-style: solid;
    border-color: #e2e8f0;
    background: #fff;
}
.file-upload-area.has-error {
    border-color: #ef4444;
    background: #fef2f2;
}
.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}
.image-preview-wrapper {
    position: relative;
    width: 100%;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    overflow: hidden;
}
.image-preview {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.file-preview-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    opacity: 0;
    transition: opacity 0.2s;
}
.image-preview-wrapper:hover .file-preview-overlay {
    opacity: 1;
}
.btn-overlay {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    background: white;
    border-radius: 50%;
    color: #64748b;
    transition: all 0.2s;
}
.btn-overlay:hover {
    background: #f1f5f9;
    color: #0ea5e9;
}
.btn-overlay--danger:hover {
    background: #fef2f2;
    color: #ef4444;
}
.file-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
}
.file-card__icon {
    flex-shrink: 0;
}
.file-card__info {
    flex: 1;
    min-width: 0;
}
.file-card__name {
    font-weight: 500;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.file-card__meta {
    color: #64748b;
}
.file-card__actions {
    display: flex;
    gap: 0.5rem;
}
.btn-file-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    color: #64748b;
    transition: all 0.2s;
}
.btn-file-action:hover {
    background: #f1f5f9;
    color: #0ea5e9;
}
.btn-file-action--danger:hover {
    background: #fef2f2;
    color: #ef4444;
    border-color: #fecaca;
}
.multi-files-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
}
.file-card--compact {
    padding: 0.5rem 0.75rem;
}
.btn-add-more {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #f0f9ff;
    color: #0ea5e9;
    border: 1px dashed #0ea5e9;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
}
.btn-add-more:hover {
    background: #e0f2fe;
}

/* ── Actions footer ── */
.form-footer {
    padding: 1.1rem 1.75rem;
    border-top: 1px solid var(--border, #e2e8f0);
    display: flex; align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.btn-cancel {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 0.6rem 1.25rem;
    border-radius: 9px;
    font-size: 0.9rem; font-weight: 600;
    color: #ef4444;
    border: 1px solid #fecaca;
    background: #fef2f2;
    transition: all 0.15s;
    text-decoration: none;
}
.btn-cancel:hover { background: #fee2e2; border-color: #fca5a5; color: #dc2626; }
.btn-save {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 0.65rem 1.5rem;
    border-radius: 9px;
    font-size: 0.9rem; font-weight: 600;
    color: #fff;
    background: #22c55e;
    border: 1px solid #16a34a;
    transition: all 0.15s;
    cursor: pointer;
    box-shadow: 0 1px 6px rgba(34,197,94,.3);
}
.btn-save:hover { background: #16a34a; }
.btn-save:active { transform: scale(.98); }
.dark .btn-cancel { background:#450a0a; border-color:#7f1d1d; color:#fca5a5; }
.dark .btn-cancel:hover { background:#7f1d1d; }
.data-table thead th {
    text-align: right;
}

table.dataTable thead>tr>th.sorting:before, table.dataTable thead>tr>th.sorting:after, table.dataTable thead>tr>th.sorting_asc:before, table.dataTable thead>tr>th.sorting_asc:after, table.dataTable thead>tr>th.sorting_desc:before, table.dataTable thead>tr>th.sorting_desc:after, table.dataTable thead>tr>th.sorting_asc_disabled:before, table.dataTable thead>tr>th.sorting_asc_disabled:after, table.dataTable thead>tr>th.sorting_desc_disabled:before, table.dataTable thead>tr>th.sorting_desc_disabled:after, table.dataTable thead>tr>td.sorting:before, table.dataTable thead>tr>td.sorting:after, table.dataTable thead>tr>td.sorting_asc:before, table.dataTable thead>tr>td.sorting_asc:after, table.dataTable thead>tr>td.sorting_desc:before, table.dataTable thead>tr>td.sorting_desc:after, table.dataTable thead>tr>td.sorting_asc_disabled:before, table.dataTable thead>tr>td.sorting_asc_disabled:after, table.dataTable thead>tr>td.sorting_desc_disabled:before, table.dataTable thead>tr>td.sorting_desc_disabled:after {
    left: 10px;
    right:unset;
}

/* ── SweetAlert Popup Size Reduction ── */
.swal2-popup {
    font-size: 0.85rem !important;
    padding: 1rem !important;
    width: 32em !important;
    max-width: 90vw !important;
}
.swal2-title {
    font-size: 1.1rem !important;
    margin: 0 0 0.5rem 0 !important;
}
.swal2-html-container {
    font-size: 0.9rem !important;
    padding: 0.5rem 0 !important;
}
.swal2-actions {
    margin: 0.5rem auto 0 !important;
}
.swal2-confirm,
.swal2-cancel {
    padding: 0.5rem 1rem !important;
    font-size: 0.85rem !important;
}
.swal2-icon {
    width: 3em !important;
    height: 3em !important;
    font-size: 1.5em !important;
}
.swal2-icon .swal2-icon-content {
    font-size: 1.5em !important;
}
.swal2-toast {
    padding: 0.6rem 0.8rem !important;
    font-size: 0.85rem !important;
    min-width: 300px !important;
    max-width: 400px !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.75rem !important;
}
.swal2-toast .swal2-title {
    font-size: 0.9rem !important;
    margin: 0 !important;
    font-weight: 600 !important;
}
.swal2-toast .swal2-html-container {
    font-size: 0.85rem !important;
    padding: 0 !important;
    margin: 0 !important;
}
.swal2-toast .swal2-icon {
    width: 2em !important;
    height: 2em !important;
    font-size: 1.2em !important;
    margin: 0 !important;
}
.swal2-toast .swal2-icon .swal2-icon-content {
    font-size: 1.2em !important;
}