/* ═══════════════════════════════════════════════════════════════
   Woogirl Project Manager  ·  Global Stylesheet
   Theme: Light gray, clean, professional, desktop-first
   ═══════════════════════════════════════════════════════════════ */

/* ─── Reset & Base ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg:          #e8e8e8;
    --surface:     #ffffff;
    --surface-alt: #f5f5f5;
    --border:      #c8ccd0;
    --border-light:#dde0e3;
    --text:        #2d3748;
    --text-muted:  #718096;
    --primary:     #3d7ab5;
    --primary-dk:  #2f619a;
    --green:       #4a8f4a;
    --green-dk:    #3a7a3a;
    --red:         #b54040;
    --red-dk:      #983030;
    --orange:      #c17b1a;
    --orange-dk:   #a0640e;
    --pink:        #d9507a;
    --tbl-head:    #dde2e7;
    --shadow:      0 2px 8px rgba(0,0,0,.10);
    --shadow-sm:   0 1px 4px rgba(0,0,0,.08);
    --radius:      6px;
    --font:        -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

html, body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.55;
    min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─── Page Wrapper ───────────────────────────────────────────── */
.page-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px 60px;
}

/* ─── Admin Top Bar (index.php only) ─────────────────────────── */
.admin-topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    padding: 18px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
}

.admin-topbar img.logo {
    height: auto;
    max-height: 80px;
    width: auto;
    display: block;
}

.add-project-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    padding: 10px 22px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background .18s;
}
.add-project-btn:hover { background: var(--primary-dk); color: #fff; text-decoration: none; }
.add-project-btn i { font-size: 16px; }

/* ─── Sub-navigation (pages 2, 3, 4) ────────────────────────── */
.subnav {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    padding: 10px 24px;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.subnav-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 20px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: background .15s, color .15s;
    border: 1px solid transparent;
}
.subnav-btn:hover { background: #e8eef5; color: var(--primary); text-decoration: none; }
.subnav-btn.active {
    background: #ddeaf5;
    color: var(--primary);
    border-color: #b8d0e8;
    font-weight: 600;
}

/* ─── Project Identifier Bar ─────────────────────────────────── */
.project-ident-bar {
    background: var(--surface);
    border-bottom: 2px solid var(--border);
    padding: 14px 32px;
    display: flex;
    align-items: center;
    gap: 0;
    flex-wrap: wrap;
    margin-bottom: 28px;
    box-shadow: var(--shadow-sm);
}

.ident-field {
    display: flex;
    flex-direction: column;
    padding: 4px 24px 4px 0;
}
.ident-sep {
    color: var(--border);
    font-size: 22px;
    padding: 0 12px 0 0;
    line-height: 1;
    align-self: center;
}
.ident-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 2px;
}
.ident-value {
    font-size: 17px;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    border-bottom: 1px dashed var(--border);
    min-width: 120px;
    transition: color .15s, border-color .15s;
}
.ident-value:hover { color: var(--primary); border-color: var(--primary); }
.ident-value.editing { border-bottom-color: var(--primary); }

.header-input {
    font-size: 17px;
    font-weight: 600;
    color: var(--primary);
    border: none;
    border-bottom: 2px solid var(--primary);
    outline: none;
    background: transparent;
    width: 100%;
    min-width: 200px;
    padding: 0 2px;
    font-family: var(--font);
}

/* ─── Content Cards ──────────────────────────────────────────── */
.card {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 24px;
    overflow: hidden;
}
.card-header {
    background: var(--tbl-head);
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}
.card-body { padding: 20px; }

/* ─── Main Project Table (index + archive) ───────────────────── */
.project-table {
    width: 100%;
    border-collapse: collapse;
}
.project-table thead th {
    background: var(--tbl-head);
    padding: 10px 14px;
    text-align: left;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-muted);
    font-weight: 700;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
    user-select: none;
}
.project-table thead th.sortable {
    cursor: pointer;
}
.project-table thead th.sortable:hover { color: var(--primary); }
.project-table thead th .sort-arrow { margin-left: 4px; opacity: .5; font-size: 10px; }
.project-table thead th.sort-asc .sort-arrow::after  { content: '▲'; opacity: 1; }
.project-table thead th.sort-desc .sort-arrow::after { content: '▼'; opacity: 1; }
.project-table thead th:not(.sort-asc):not(.sort-desc) .sort-arrow::after { content: '⇅'; }

.project-table tbody tr {
    border-bottom: 1px solid var(--border-light);
    transition: background .12s;
}
.project-table tbody tr:hover { background: #f7f9fb; }
.project-table tbody td {
    padding: 11px 14px;
    vertical-align: middle;
}

/* Drag handle column */
.drag-col { width: 32px; color: #bbb; cursor: grab; font-size: 16px; text-align: center; }
.drag-col:active { cursor: grabbing; }
.sortable-ghost { opacity: .4; background: #ddeaf5 !important; }
.sortable-chosen { background: #eef4fb !important; box-shadow: 0 2px 12px rgba(61,122,181,.15); }

/* ─── Action Buttons ─────────────────────────────────────────── */
.action-btns { display: flex; gap: 8px; align-items: center; }

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px; height: 32px;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    transition: background .15s, transform .1s;
}
.btn-icon:hover { transform: scale(1.08); }
.btn-icon:active { transform: scale(.96); }

.btn-edit    { background: #e8eef5; color: var(--primary); }
.btn-edit:hover { background: #d4e4f4; }
.btn-archive { background: #e8f4e8; color: var(--green); }
.btn-archive:hover { background: #d4ead4; }
.btn-unarchive { background: #fff4e5; color: var(--orange); }
.btn-unarchive:hover { background: #fde8c8; }
.btn-delete  { background: #fdecea; color: var(--red); }
.btn-delete:hover { background: #fad4d4; }

/* Text action buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 18px;
    border-radius: var(--radius);
    border: 1px solid transparent;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s, border-color .15s;
    white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dk); color: #fff; text-decoration: none; }
.btn-outline { background: #fff; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover { background: #eef4fb; text-decoration: none; }
.btn-danger  { background: var(--red); color: #fff; }
.btn-danger:hover { background: var(--red-dk); color: #fff; }
.btn-green   { background: var(--green); color: #fff; }
.btn-green:hover { background: var(--green-dk); color: #fff; }

/* ─── Pitch / Mailing Tables ─────────────────────────────────── */
.data-table {
    width: 100%;
    border-collapse: collapse;
}
.data-table thead th {
    background: var(--tbl-head);
    padding: 9px 12px;
    text-align: left;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-muted);
    font-weight: 700;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}
.data-table tbody tr {
    border-bottom: 1px solid var(--border-light);
    transition: background .12s;
}
.data-table tbody tr:hover { background: #f9fafb; }
.data-table tbody td {
    padding: 9px 12px;
    vertical-align: top;
}
.data-table .drag-col { vertical-align: middle; }

/* Editable cells */
.editable-cell {
    cursor: pointer;
    min-width: 80px;
    min-height: 24px;
    border-radius: 3px;
    transition: background .12s;
    position: relative;
}
.editable-cell:hover { background: #eef4fb; }
.editable-cell.editing { background: #f0f7ff; }
.editable-cell .placeholder { color: var(--text-muted); font-style: italic; font-size: 12px; }

.cell-input, .cell-textarea {
    width: 100%;
    border: 1px solid var(--primary);
    border-radius: 3px;
    padding: 4px 7px;
    font-family: var(--font);
    font-size: 13px;
    color: var(--text);
    background: #fff;
    outline: none;
    box-shadow: 0 0 0 2px rgba(61,122,181,.15);
    resize: vertical;
}
.cell-input[type="date"] { min-width: 140px; }

/* ─── File List ───────────────────────────────────────────────── */
.file-list { list-style: none; }
.file-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-bottom: 1px solid var(--border-light);
    transition: background .12s;
}
.file-list li:last-child { border-bottom: none; }
.file-list li:hover { background: #f7f9fb; }
.file-icon { color: var(--text-muted); font-size: 15px; flex-shrink: 0; }
.file-name { flex: 1; font-weight: 500; color: var(--primary); cursor: pointer; }
.file-name:hover { text-decoration: underline; }
.file-size { color: var(--text-muted); font-size: 12px; flex-shrink: 0; }
.file-date { color: var(--text-muted); font-size: 12px; flex-shrink: 0; min-width: 90px; }

/* ─── Drop Zone ───────────────────────────────────────────────── */
.drop-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    background: var(--surface-alt);
    padding: 36px 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color .18s, background .18s;
    color: var(--text-muted);
}
.drop-zone:hover, .drop-zone.dragover {
    border-color: var(--primary);
    background: #eef4fb;
    color: var(--primary);
}
.drop-zone i { font-size: 32px; margin-bottom: 10px; display: block; }
.drop-zone p  { font-size: 14px; margin: 0; }
.drop-zone small { font-size: 12px; }
#file-input { display: none; }

/* Upload progress */
.upload-progress {
    margin-top: 12px;
    display: none;
}
.progress-bar-wrap {
    background: var(--border-light);
    border-radius: 20px;
    height: 8px;
    overflow: hidden;
}
.progress-bar {
    height: 100%;
    background: var(--primary);
    width: 0%;
    transition: width .2s;
    border-radius: 20px;
}
.progress-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ─── Big navigation links (Project Summary page) ─────────────── */
.big-nav-links {
    display: flex;
    gap: 16px;
    margin-top: 8px;
}
.big-nav-link {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 22px 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    transition: background .16s, box-shadow .16s, transform .12s;
}
.big-nav-link:hover {
    background: #eef4fb;
    box-shadow: var(--shadow);
    transform: translateY(-2px);
    text-decoration: none;
    color: var(--primary-dk);
}
.big-nav-link i { font-size: 22px; }

/* ─── Section Titles ─────────────────────────────────────────── */
.section-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-muted);
    margin: 0 0 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ─── Page title ─────────────────────────────────────────────── */
.page-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}
.page-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ─── Archive link (inconspicuous) ───────────────────────────── */
.archive-link-small {
    font-size: 12px;
    color: var(--text-muted);
    text-decoration: none;
    opacity: .6;
    transition: opacity .15s;
}
.archive-link-small:hover { opacity: 1; color: var(--text-muted); text-decoration: underline; }

/* ─── Empty state ─────────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}
.empty-state i { font-size: 40px; margin-bottom: 14px; display: block; opacity: .35; }
.empty-state p { font-size: 14px; }

/* ─── Add row button ─────────────────────────────────────────── */
.add-row-wrap {
    padding: 14px 16px;
    border-top: 1px solid var(--border-light);
}

/* ─── Modal / Confirm Dialog ─────────────────────────────────── */
.modal-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal {
    background: var(--surface);
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0,0,0,.22);
    padding: 32px;
    max-width: 420px;
    width: 90%;
}
.modal h3 { margin: 0 0 12px; font-size: 18px; color: var(--text); }
.modal p  { color: var(--text-muted); font-size: 14px; margin-bottom: 24px; line-height: 1.6; }
.modal p strong { color: var(--red); }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* ─── Top bar for inner pages ─────────────────────────────────── */
.inner-page-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin: 24px 0 20px;
}

/* ─── Utility ────────────────────────────────────────────────── */
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.flex-end { display: flex; justify-content: flex-end; }
.text-muted { color: var(--text-muted); font-size: 12px; }
.no-wrap { white-space: nowrap; }
.bold { font-weight: 700; }

/* ─── Toast notification ─────────────────────────────────────── */
#toast {
    position: fixed;
    bottom: 28px;
    right: 28px;
    background: #2d3748;
    color: #fff;
    padding: 12px 22px;
    border-radius: 6px;
    font-size: 13px;
    box-shadow: 0 4px 16px rgba(0,0,0,.25);
    display: none;
    z-index: 9999;
    animation: slideUp .25s ease;
}
@keyframes slideUp {
    from { transform: translateY(12px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}
#toast.toast-error { background: var(--red); }
