/* ---------- Project Tracker dashboard styles ---------- */
.pt-root, .pt-auth-card {
    --pt-bg: #f7f7fb;
    --pt-surface: #ffffff;
    --pt-border: #e6e7ee;
    --pt-text: #1c1d24;
    --pt-muted: #6b6f80;
    --pt-primary: #5b5cf6;
    --pt-primary-hover: #4a4ce8;
    --pt-danger: #e34d4d;
    --pt-radius: 10px;
    --pt-shadow: 0 1px 2px rgba(20, 20, 40, 0.04), 0 4px 14px rgba(20, 20, 40, 0.05);
    color: var(--pt-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.45;
    box-sizing: border-box;
}
.pt-root *, .pt-root *::before, .pt-root *::after,
.pt-auth-card *, .pt-auth-card *::before, .pt-auth-card *::after { box-sizing: border-box; }

/* Auth */
.pt-auth-card {
    max-width: 420px;
    margin: 24px auto;
    padding: 28px;
    background: var(--pt-surface);
    border: 1px solid var(--pt-border);
    border-radius: 16px;
    box-shadow: var(--pt-shadow);
}
.pt-auth-title { margin: 0 0 18px; font-size: 22px; font-weight: 700; }
.pt-divider { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--pt-muted); font-size: 12px; }
.pt-divider::before, .pt-divider::after { content: ''; height: 1px; background: var(--pt-border); flex: 1; }

/* Form primitives */
.pt-form { display: flex; flex-direction: column; gap: 12px; }
.pt-form-card { background: var(--pt-surface); border: 1px solid var(--pt-border); border-radius: 14px; padding: 24px; box-shadow: var(--pt-shadow); }
.pt-field { display: flex; flex-direction: column; gap: 6px; }
.pt-field > span { font-size: 12px; color: var(--pt-muted); font-weight: 500; }
.pt-input {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--pt-border);
    border-radius: 8px;
    background: #fff;
    font: inherit;
    color: inherit;
    transition: border-color .15s, box-shadow .15s;
}
.pt-input:focus { outline: none; border-color: var(--pt-primary); box-shadow: 0 0 0 3px rgba(91,92,246,.18); }
textarea.pt-input { resize: vertical; min-height: 90px; }

.pt-btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 9px 14px; border-radius: 8px; border: 1px solid transparent;
    font: inherit; font-weight: 500; cursor: pointer;
    transition: background .15s, border-color .15s, color .15s, transform .05s;
    text-decoration: none;
}
.pt-btn:active { transform: translateY(1px); }
.pt-btn[disabled] { opacity: .5; cursor: not-allowed; }
.pt-btn-primary { background: var(--pt-primary); color: #fff; }
.pt-btn-primary:hover { background: var(--pt-primary-hover); }
.pt-btn-ghost { background: transparent; border-color: var(--pt-border); color: var(--pt-text); }
.pt-btn-ghost:hover { background: #f0f1f8; }
.pt-btn-danger { background: transparent; border-color: var(--pt-border); color: var(--pt-danger); }
.pt-btn-danger:hover { background: #fdecec; border-color: #f3bcbc; }
.pt-btn-google {
    background: #fff; border-color: var(--pt-border); color: #1c1d24;
    font-weight: 500; padding: 10px 14px;
}
.pt-btn-google:hover { background: #f8f8fb; }

.pt-form-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 6px; }
.pt-form-msg { font-size: 13px; color: var(--pt-muted); min-height: 18px; }
.pt-form-msg.pt-success { color: #1f7a4d; }
.pt-form-msg.pt-error { color: var(--pt-danger); }

/* Shell */
.pt-shell {
    background: var(--pt-bg);
    border: 1px solid var(--pt-border);
    border-radius: 16px;
    overflow: hidden;
    min-height: 720px;
    display: flex;
    flex-direction: column;
}
.pt-topbar {
    display: flex; align-items: center; gap: 16px;
    padding: 14px 20px;
    background: var(--pt-surface);
    border-bottom: 1px solid var(--pt-border);
}
.pt-brand { display: flex; align-items: center; gap: 10px; }
.pt-brand-mark {
    width: 32px; height: 32px; border-radius: 8px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center;
    font-size: 13px;
}
.pt-brand-name { font-weight: 600; }
.pt-topbar-spacer { flex: 1; }

.pt-user-menu {
    position: relative;
    display: flex; align-items: center; gap: 10px;
    padding: 4px 6px 4px 4px; border-radius: 999px;
    cursor: pointer;
}
.pt-user-menu:hover, .pt-user-menu:focus { background: #f0f1f8; outline: none; }
.pt-user-meta { line-height: 1.15; }
.pt-user-name { font-weight: 600; font-size: 13px; }
.pt-user-role { color: var(--pt-muted); font-size: 11px; }
.pt-user-email { color: var(--pt-muted); font-size: 12px; }
.pt-avatar { width: 32px; height: 32px; border-radius: 999px; object-fit: cover; background: #ddd; }
.pt-avatar-sm { width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; background: #e0e2ee; color: #555; font-weight: 600; }
.pt-avatar-lg { width: 64px; height: 64px; }

.pt-user-dropdown {
    position: absolute; top: calc(100% + 6px); right: 0;
    background: var(--pt-surface);
    border: 1px solid var(--pt-border); border-radius: 12px;
    box-shadow: var(--pt-shadow);
    min-width: 220px; padding: 6px;
    opacity: 0; visibility: hidden; transform: translateY(-4px);
    transition: all .15s;
    z-index: 20;
}
.pt-user-menu:hover .pt-user-dropdown,
.pt-user-menu:focus-within .pt-user-dropdown {
    opacity: 1; visibility: visible; transform: translateY(0);
}
.pt-dropdown-head { padding: 10px; border-bottom: 1px solid var(--pt-border); margin-bottom: 4px; }
.pt-dropdown-item {
    display: block; width: 100%; text-align: left;
    background: transparent; border: 0; cursor: pointer;
    padding: 8px 10px; border-radius: 6px; font: inherit; color: inherit;
    text-decoration: none;
}
.pt-dropdown-item:hover { background: #f3f4fa; }

.pt-body { display: flex; flex: 1; min-height: 0; }
.pt-sidebar {
    width: 200px; padding: 18px 12px;
    background: var(--pt-surface);
    border-right: 1px solid var(--pt-border);
    display: flex; flex-direction: column; gap: 4px;
}
.pt-nav-item {
    text-align: left; padding: 9px 12px;
    background: transparent; border: 0; border-radius: 8px;
    font: inherit; color: var(--pt-muted);
    cursor: pointer;
}
.pt-nav-item:hover { background: #f3f4fa; color: var(--pt-text); }
.pt-nav-item.is-active { background: #ecedfb; color: var(--pt-primary); font-weight: 600; }

.pt-main { flex: 1; padding: 24px 28px; overflow: auto; }
.pt-page { display: flex; flex-direction: column; gap: 22px; }
.pt-page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.pt-page-title { margin: 4px 0 4px; font-size: 22px; font-weight: 700; }
.pt-page-subtitle { margin: 0; color: var(--pt-muted); font-size: 13px; }
.pt-link { background: transparent; border: 0; cursor: pointer; color: var(--pt-primary); font: inherit; padding: 0; }

/* Stat cards */
.pt-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 14px;
}
.pt-stat-card {
    background: var(--pt-surface);
    border: 1px solid var(--pt-border); border-radius: 14px;
    padding: 18px 18px 16px;
    box-shadow: var(--pt-shadow);
    border-top: 3px solid var(--pt-border);
}
.pt-stat-value { font-size: 26px; font-weight: 700; }
.pt-stat-label { color: var(--pt-muted); font-size: 12px; margin-top: 2px; }
.pt-card-accent-blue   { border-top-color: #6366f1; }
.pt-card-accent-violet { border-top-color: #8b5cf6; }
.pt-card-accent-green  { border-top-color: #22a06b; }
.pt-card-accent-orange { border-top-color: #ef8b3a; }
.pt-card-accent-red    { border-top-color: #e34d4d; }
.pt-card-accent-cyan   { border-top-color: #0aa5b8; }

/* Section */
.pt-section { background: var(--pt-surface); border: 1px solid var(--pt-border); border-radius: 14px; padding: 20px; box-shadow: var(--pt-shadow); }
.pt-section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.pt-section-title { margin: 0; font-size: 15px; font-weight: 600; }

/* Filters */
.pt-filters { display: flex; flex-wrap: wrap; gap: 10px; }
.pt-filters .pt-input { width: auto; min-width: 160px; }

/* Table */
.pt-table-wrap { background: var(--pt-surface); border: 1px solid var(--pt-border); border-radius: 14px; overflow: auto; box-shadow: var(--pt-shadow); }
.pt-table { width: 100%; border-collapse: collapse; }
.pt-table th, .pt-table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--pt-border); vertical-align: middle; }
.pt-table thead th { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--pt-muted); background: #fafbff; }
.pt-th-sortable { cursor: pointer; user-select: none; }
.pt-th-sortable:hover { color: var(--pt-text); }
.pt-table tbody tr:hover { background: #fafbff; }
.pt-cell-strong { font-weight: 600; }
.pt-cell-sub { color: var(--pt-muted); font-size: 12px; }
.pt-muted { color: var(--pt-muted); }
.pt-actions-cell { display: flex; gap: 6px; justify-content: flex-end; }

.pt-pagination { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 10px; }

/* Badges */
.pt-badge {
    display: inline-flex; align-items: center;
    padding: 3px 9px; border-radius: 999px;
    font-size: 11px; font-weight: 600; letter-spacing: .02em;
    background: #eef0fa; color: #444;
    white-space: nowrap;
}
.pt-badge-gray   { background: #eef0f5; color: #555; }
.pt-badge-blue   { background: #e2e8ff; color: #3a40b5; }
.pt-badge-cyan   { background: #d6f1f5; color: #086a78; }
.pt-badge-violet { background: #ece1ff; color: #5d2bb0; }
.pt-badge-amber  { background: #fff0c9; color: #8a5a00; }
.pt-badge-orange { background: #ffe0c9; color: #a14d10; }
.pt-badge-green  { background: #d4f3e0; color: #1c6f3d; }

.pt-deadline {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 7px; border-radius: 6px;
    font-size: 11px; font-weight: 600;
}
.pt-deadline-ok { background: #e9f5ee; color: #1c6f3d; }
.pt-deadline-urgent { background: #fff0c9; color: #8a5a00; }
.pt-deadline-overdue { background: #fde0e0; color: #a02828; }
.pt-deadline-none { background: #eef0f5; color: var(--pt-muted); }

/* Cards */
.pt-card-list {
    display: grid; gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.pt-mini-card {
    background: var(--pt-surface);
    border: 1px solid var(--pt-border);
    border-radius: 12px;
    padding: 14px;
    display: flex; flex-direction: column; gap: 8px;
}
.pt-mini-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pt-mini-client { font-weight: 600; }
.pt-mini-meta { color: var(--pt-muted); font-size: 12px; display: flex; gap: 6px; align-items: center; }
.pt-dot { color: #bbb; }

/* Teams */
.pt-team-grid {
    display: grid; gap: 14px;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.pt-team-card {
    background: var(--pt-surface);
    border: 1px solid var(--pt-border);
    border-radius: 14px;
    padding: 18px;
    display: flex; flex-direction: column; gap: 12px;
    box-shadow: var(--pt-shadow);
}
.pt-team-card-head { display: flex; align-items: center; justify-content: space-between; }
.pt-team-name { margin: 0; font-size: 16px; font-weight: 600; }
.pt-team-leaders { color: var(--pt-text); font-size: 13px; display: flex; flex-direction: column; gap: 2px; }
.pt-team-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.pt-member-list { display: flex; flex-direction: column; gap: 8px; }
.pt-member { display: flex; align-items: center; gap: 12px; padding: 10px; border: 1px solid var(--pt-border); border-radius: 10px; }
.pt-member > div:nth-child(2) { flex: 1; }

/* Profile */
.pt-profile-head { display: flex; align-items: center; gap: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--pt-border); margin-bottom: 8px; }

/* Empty */
.pt-empty {
    background: var(--pt-surface); border: 1px dashed var(--pt-border);
    border-radius: 12px; padding: 36px;
    text-align: center; color: var(--pt-muted);
}

/* Modal */
.pt-modal-backdrop {
    position: fixed; inset: 0;
    background: rgba(20,20,40,.45);
    display: flex; align-items: flex-start; justify-content: center;
    padding: 60px 20px;
    z-index: 9999;
    overflow: auto;
}
.pt-modal {
    background: var(--pt-surface);
    border-radius: 16px;
    width: 100%; max-width: 520px;
    box-shadow: 0 20px 60px rgba(20,20,40,.25);
    overflow: hidden;
}
.pt-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--pt-border); }
.pt-modal-head h3 { margin: 0; font-size: 16px; font-weight: 600; }
.pt-modal-close { background: transparent; border: 0; font-size: 22px; cursor: pointer; color: var(--pt-muted); line-height: 1; }
.pt-modal .pt-form { padding: 18px 20px 20px; }

/* Responsive */
@media (max-width: 720px) {
    .pt-body { flex-direction: column; }
    .pt-sidebar { width: 100%; flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--pt-border); }
    .pt-main { padding: 18px; }
    .pt-page-head { flex-direction: column; align-items: stretch; }
    .pt-user-meta { display: none; }
}

/* ---- Project view modal ---- */
.pt-mini-card-clickable { cursor: pointer; transition: transform .08s ease, box-shadow .12s ease; }
.pt-mini-card-clickable:hover { transform: translateY(-1px); box-shadow: 0 6px 18px -10px rgba(0,0,0,.25); }
.pt-modal-wide { max-width: 720px; }
.pt-detail-body { display: flex; flex-direction: column; gap: 18px; padding: 18px 20px 20px; }
.pt-detail-grid { display: grid; grid-template-columns: 1fr; gap: 0; border: 1px solid var(--pt-border); border-radius: 10px; overflow: hidden; }
.pt-detail-row { display: grid; grid-template-columns: 180px 1fr; gap: 16px; padding: 10px 14px; border-bottom: 1px solid var(--pt-border); background: var(--pt-bg-soft, #fafbfc); align-items: start; }
.pt-detail-row:last-child { border-bottom: 0; }
.pt-detail-label { color: var(--pt-text-muted); font-size: 13px; }
.pt-detail-value { color: var(--pt-text); font-size: 14px; word-break: break-word; }
.pt-detail-section-title { margin: 0 0 8px; }
.pt-ext-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.pt-ext-list li { padding: 10px 12px; border: 1px solid var(--pt-border); border-radius: 8px; background: #fff; }
.pt-detail-actions { justify-content: flex-end; }
.pt-link { color: var(--pt-primary, #2563eb); text-decoration: underline; word-break: break-all; }

/* ---- Avatar uploader ---- */
.pt-avatar-card { display: flex; flex-direction: column; gap: 14px; }
.pt-avatar-controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pt-file-input { position: absolute; left: -9999px; opacity: 0; width: 0; height: 0; }
.pt-avatar-controls label { cursor: pointer; }

@media (max-width: 640px) {
    .pt-detail-row { grid-template-columns: 1fr; gap: 4px; }
    .pt-detail-label { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
}

/* ---- Users / role management ---- */
.pt-users-table .pt-user-cell { display: flex; align-items: center; gap: 10px; }
.pt-role-change { display: flex; flex-direction: column; gap: 4px; min-width: 200px; }
.pt-role-select { padding: 6px 10px; }
.pt-role-select:disabled { opacity: .55; cursor: not-allowed; }
