/* ============================================================
   PREMIUM CLEAN THEME — TDM Roofing Admin Panel
   ============================================================ */

/* ------------------------------
   COLOR VARIABLES
------------------------------ */
:root {
    --bg-body: #f3f4f6;
    --bg-card: #ffffff;
    --bg-header: #111827;
    --bg-tab: #e5e7eb;
    --bg-tab-active: #2563eb;

    --text-main: #111827;
    --text-muted: #6b7280;
    --text-invert: #ffffff;

    --border-soft: #e5e7eb;


.modal-header {
    padding: 12px 16px !important;
    align-items: center !important;
}

.modal-header .icon-btn {
    margin-top: 0 !important;
    transform: translateY(0) !important;
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}


    --btn-primary-bg: #2563eb;
    --btn-primary-hover: #1d4ed8;
    --btn-danger-bg: #dc2626;

    --shadow-soft: 0 2px 10px rgba(0,0,0,0.15);
}

/* ------------------------------
   DARK THEME OVERRIDES
------------------------------ */
body[data-theme="dark"] {
    --bg-body: #020617;
    --bg-card: #020617;
    --bg-header: #020617;
    --bg-tab: #111827;
    --bg-tab-active: #2563eb;

    --text-main: #e5e7ef;
    --text-muted: #9ca3af;
    --text-invert: #f9fafb;

    --border-soft: #1f2937;

    --btn-primary-bg: #2563eb;
    --btn-primary-hover: #1d4ed8;
    --btn-danger-bg: #ef4444;

    --shadow-soft: 0 10px 40px rgba(0,0,0,0.6);
}

/* ------------------------------
   GLOBAL
------------------------------ */
body {
    background: var(--bg-body);
    color: var(--text-main);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* ------------------------------
   HEADER
------------------------------ */
header {
    background: var(--bg-header);
    color: var(--text-invert);
    padding: 14px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(148,163,184,0.3);
}

#themeToggle {
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(148,163,184,0.6);
    background: transparent;
    color: var(--text-invert);
    font-size: 13px;
    cursor: pointer;
}

/* ------------------------------
   CONTAINER / CARDS
------------------------------ */
.container {
    max-width: 1200px;
    margin: 18px auto;
    background: var(--bg-card);
    padding: 18px;
    border-radius: 18px;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(148,163,184,0.25);
}

/* ------------------------------
   INPUTS
------------------------------ */
label {
    font-weight: 500;
    margin-top: 10px;
    display: block;
    font-size: 13px;
    color: var(--text-muted);
}

input, select, textarea {
    width: 100%;
    padding: 9px 11px;
    margin-top: 4px;
    border-radius: 10px;
    border: 1px solid var(--border-soft);
    font-size: 14px;
    background: rgba(15,23,42,0.02);
    color: var(--text-main);
}

/* ------------------------------
   BUTTONS
------------------------------ */
button {
    padding: 9px 14px;
    border: none;
    border-radius: 999px;
    background: var(--btn-primary-bg);
    color: #fff;
    cursor: pointer;
    margin-top: 12px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 8px 20px rgba(37,99,235,0.35);
    transition: 0.2s;
}

button:hover {
    background: var(--btn-primary-hover);
    transform: translateY(-1px);
}

button.danger {
    background: var(--btn-danger-bg);
}

/* ------------------------------
   ICON BUTTONS (FINAL VERSION)
------------------------------ */
.icon-btn {
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 8px;
    font-size: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    vertical-align: middle;
    margin: 0 2px;
    background: var(--btn-primary-bg);
    color: white;
}

.icon-btn.danger {
    background: var(--btn-danger-bg);
}

/* ------------------------------
   TABS
------------------------------ */
.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
}

.tab {
    padding: 10px 18px;
    background: var(--bg-tab);
    border-radius: 999px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    transition: 0.25s;
    border: 1px solid rgba(148,163,184,0.6);
}

.tab.active {
    background: var(--bg-tab-active);
    color: #fff;
}

/* ------------------------------
   TABLES
------------------------------ */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 13px;
    border-radius: 14px;
    overflow: hidden;
}

th, td {
    padding: 9px 10px;
    border: 1px solid var(--border-soft);
}

th {
    background: rgba(148,163,184,0.12);
    font-weight: 600;
}

/* ------------------------------
   WORKERS TABLE FIX
------------------------------ */
.workers-table th:last-child,
.workers-table td:last-child {
    text-align: center;
}

/* Owner — 3 кнопки */
body[data-role="owner"] .workers-table th:last-child,
body[data-role="owner"] .workers-table td:last-child {
    width: 150px;
    min-width: 150px;
}

/* Foreman — 1 кнопка */
body[data-role="foreman"] .workers-table th:last-child,
body[data-role="foreman"] .workers-table td:last-child {
    width: 110px;
    min-width: 110px;
}

/* ------------------------------
   MOBILE
------------------------------ */
@media (max-width: 768px) {
    .icon-btn {
        width: 26px;
        height: 26px;
        font-size: 15px;
    }

    body[data-role="owner"] .workers-table td:last-child {
        width: 120px;
        min-width: 120px;
    }

    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}


/* ============================================================
   JOB SITES — PREMIUM FIX
   ============================================================ */

/* Actions column */
.jobsites-table th:last-child,
.jobsites-table td:last-child {
    text-align: center;
}

/* Owner — 4 кнопки (Edit, Foremen, Workers, Delete) */
body[data-role="owner"] .jobsites-table th:last-child,
body[data-role="owner"] .jobsites-table td:last-child {
    width: 200px;
    min-width: 200px;
    max-width: 200px;
}

/* Foreman — 1 кнопка (View only) */
body[data-role="foreman"] .jobsites-table th:last-child,
body[data-role="foreman"] .jobsites-table td:last-child {
    width: 110px;
    min-width: 110px;
    max-width: 110px;
}

/* Mobile */
@media (max-width: 768px) {
    .jobsites-table th:last-child,
    .jobsites-table td:last-child {
        width: 150px;
        min-width: 150px;
    }
}

/* ============================================================
   PREMIUM DARK THEME — MODALS
   ============================================================ */

body[data-theme="dark"] .modal-backdrop {
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
}

body[data-theme="dark"] .modal {
    background: #0f172a; /* темно-синій преміум */
    color: var(--text-main);
    border: 1px solid rgba(37, 99, 235, 0.35); /* синя рамка */
    box-shadow: 0 12px 40px rgba(0,0,0,0.7);
    border-radius: 16px;
}

body[data-theme="dark"] .modal-header {
    background: #1e293b;
    border-bottom: 1px solid rgba(37, 99, 235, 0.35);
    padding: 14px 18px;
    border-radius: 16px 16px 0 0;
}

body[data-theme="dark"] .modal-header h3 {
    color: var(--text-invert);
}

body[data-theme="dark"] .modal input,
body[data-theme="dark"] .modal select,
body[data-theme="dark"] .modal textarea {
    background: #0b1220;
    color: var(--text-main);
    border: 1px solid rgba(148,163,184,0.25);
}

body[data-theme="dark"] .modal input:focus,
body[data-theme="dark"] .modal select:focus,
body[data-theme="dark"] .modal textarea:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37,99,235,0.4);
}

body[data-theme="dark"] .modal-actions button {
    background: #1e40af;
    color: #fff;
    box-shadow: 0 8px 20px rgba(37,99,235,0.35);
}

body[data-theme="dark"] .modal-actions button:hover {
    background: #1d4ed8;
}

body[data-theme="dark"] .modal-actions .danger {
    background: #b91c1c;
    box-shadow: 0 8px 20px rgba(185,28,28,0.35);
}

body[data-theme="dark"] .modal-actions .danger:hover {
    background: #dc2626;
}

.approved-badge {
    color: #22c55e;
    font-weight: 600;
    background: rgba(34,197,94,0.15);
    padding: 4px 10px;
    border-radius: 8px;
    display: inline-block;
}
/* HOURS TABLE — ACTIONS COLUMN */
#tab-hours table th:last-child,
#tab-hours table td:last-child {
    text-align: center;
    width: 110px;
    min-width: 110px;
}
/* DARK THEME — SELECT FIX */
body[data-theme="dark"] select {
    background: #0b1220;
    color: var(--text-main);
    border: 1px solid rgba(148,163,184,0.3);
}

body[data-theme="dark"] select option {
    background: #0b1220;
    color: var(--text-main);
}

/* ============================================================
   LARGE CENTERED MODALS (PREMIUM)
============================================================ */

.modal-large {
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-scroll {
    overflow-y: auto;
    padding-right: 6px;
}

/* Mobile */
@media (max-width: 768px) {
    .modal-large {
        width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }
}
/* PREMIUM ROUND CHECKBOXES */
.premium-checkbox {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 16px;
}

/* нативний чекбокс з яскравою галочкою */
.premium-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #007bff;
    cursor: pointer;
}



/* SOFT GLASS CARD */
.soft-card {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(37, 99, 235, 0.25);
    padding: 14px 18px;
    border-radius: 14px;
    margin-bottom: 18px;
}

/* DARK THEME */
body[data-theme="dark"] .soft-card {
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(37, 99, 235, 0.35);
}
/* LARGE CENTERED MODAL */
.modal-large {
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-scroll {
    overflow-y: auto;
    padding-right: 6px;
}

/* Mobile */
@media (max-width: 768px) {
    .modal-large {
        width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }
}

/* ============================================================
   PDF STYLE REPORT VIEW
============================================================ */

.pdf-report {
    font-family: "Inter", sans-serif;
    padding: 10px 4px;
}

.pdf-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 6px;
}

.pdf-subtitle {
    font-size: 14px;
    opacity: 0.8;
    margin-bottom: 20px;
}

.pdf-section {
    margin-top: 22px;
}

.pdf-section-title {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}

.pdf-line {
    height: 1px;
    background: rgba(255,255,255,0.15);
    margin: 10px 0 14px 0;
}

body[data-theme="light"] .pdf-line {
    background: rgba(0,0,0,0.15);
}

.pdf-list-item {
    margin: 4px 0;
}
/* Базово: велика, але не full-screen */
.modal.modal-large {
    max-width: 900px;
    max-height: 90vh;
    margin: 40px auto;
}

/* На мобайлі — компактніше, не впритул до країв */
@media (max-width: 768px) {
    .modal.modal-large {
        width: 94vw;
        max-height: 85vh;
        margin: 30px auto;
        border-radius: 14px;
    }

    .modal-body.modal-scroll {
        max-height: calc(85vh - 110px); /* хедер + футер */
        overflow-y: auto;
    }
}
/* DARK THEME — FIX LOGIN INPUTS */
body[data-theme="dark"] .login-box input[type="text"],
body[data-theme="dark"] .login-box input[type="email"],
body[data-theme="dark"] .login-box input[type="password"] {
    background: #0b1220 !important;
    color: #f1f5f9 !important;
    border: 1px solid #334155 !important;
}

body[data-theme="dark"] .login-box {
    background: #0f172a !important;
    border: 1px solid #1e293b !important;
    box-shadow: 0 8px 30px rgba(0,0,0,0.6) !important;
}

body[data-theme="dark"] .login-box label {
    color: #cbd5e1 !important;
}

/* FULL WIDTH TILES */
.dash-card.fullwidth {
    grid-column: 1 / -1 !important;
    width: 100%;
}

/* SECTIONS SPACING */
#dashboardSections {
    margin-top: 25px;
    margin-bottom: 25px;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

/* BOTTOM GRID SPACING */
#dashboardCardsBottom {
    margin-top: 25px;
}

/* LIST INSIDE TILE */
.dash-ul {
    margin-top: 10px;
    padding-left: 20px;
    line-height: 1.5;
}

/* TICKET ROWS */
.dash-ticket-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.dash-ticket-row:last-child {
    border-bottom: none;
}

/* FOREMAN INFO */
.dash-foreman-info {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 15px;
}

/* LIGHT THEME FIXES */
body.light .dash-card {
    background: rgba(255,255,255,0.8);
    border: 1px solid rgba(0,0,0,0.1);
    color: #222;
}

body.light .dash-card-title {
    color: #000;
}

body.light .dash-ticket-row {
    border-bottom: 1px solid rgba(0,0,0,0.1);
}
.modal-backdrop {
    display: none;              /* ← головне */
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.wp-modal-backdrop {
    display: none !important;
}
