/* ===================================================
   Cre8ive Monk — Portal & Admin Stylesheet
   =================================================== */

/* ===== PORTAL LAYOUT ===== */
.portal-body {
    padding-top: 64px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.portal-wrap {
    display: flex;
    flex: 1;
    max-width: 1280px;
    width: 100%;
    margin: 0 auto;
    padding: 0 1.5rem;
    gap: 2rem;
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: 220px;
    flex-shrink: 0;
    padding: 2rem 0;
}

.sidebar-label {
    font-size: 0.65rem;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: var(--text-subtle);
    font-weight: 500;
    margin: 0 0 0.75rem 0.75rem;
}

.sidebar-nav { list-style: none; }

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.65rem 0.75rem;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 400;
    text-decoration: none;
    transition: background var(--transition), color var(--transition);
    margin-bottom: 2px;
}
.sidebar-nav a:hover {
    background: var(--surface);
    color: var(--text);
    opacity: 1;
}
.sidebar-nav a.active {
    background: rgba(0,212,255,0.08);
    color: var(--accent);
    font-weight: 500;
}

.sidebar-nav .nav-icon { font-size: 1rem; }

.sidebar-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 1rem 0;
}

/* ===== MAIN CONTENT ===== */
.portal-main {
    flex: 1;
    padding: 2rem 0 3rem;
    min-width: 0;
}

.portal-header {
    margin-bottom: 2rem;
}
.portal-header h1 {
    font-size: 1.75rem;
    margin-bottom: 0.25rem;
}
.portal-header p { color: var(--text-muted); font-size: 0.95rem; }

/* ===== AUTH PAGES (login/register) ===== */
.auth-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
    background: var(--bg);
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.5rem;
}

.auth-logo {
    text-align: center;
    margin-bottom: 2rem;
}
.auth-logo .logo {
    font-size: 1rem;
    letter-spacing: 5px;
}
.auth-logo p {
    color: var(--text-subtle);
    font-size: 0.8rem;
    margin-top: 0.4rem;
}

.auth-title {
    font-size: 1.4rem;
    margin-bottom: 0.25rem;
}
.auth-sub {
    color: var(--text-muted);
    font-size: 0.88rem;
    margin-bottom: 2rem;
}
.auth-footer {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ===== DASHBOARD CARDS ===== */
.dash-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.dash-stat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
}
.dash-stat-label {
    font-size: 0.72rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-subtle);
    margin-bottom: 0.5rem;
}
.dash-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
}
.dash-stat-value.accent { color: var(--accent); }

.dash-quick-links {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* ===== PROJECT STATUS TIMELINE ===== */
.status-timeline {
    display: flex;
    align-items: flex-start;
    gap: 0;
    margin: 2rem 0;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.timeline-step {
    flex: 1;
    min-width: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    text-align: center;
}
.timeline-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 14px;
    left: calc(50% + 14px);
    right: calc(-50% + 14px);
    height: 2px;
    background: var(--border);
}
.timeline-step.done:not(:last-child)::after,
.timeline-step.active:not(:last-child)::after {
    background: linear-gradient(90deg, var(--accent), var(--border));
}

.timeline-dot {
    width: 28px; height: 28px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: var(--text-subtle);
    margin-bottom: 0.6rem;
    position: relative;
    z-index: 1;
    transition: all var(--transition);
}
.timeline-step.done  .timeline-dot {
    background: var(--accent);
    border-color: var(--accent);
    color: #060d1a;
    font-weight: 700;
}
.timeline-step.active .timeline-dot {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(0,212,255,0.15);
    color: var(--accent);
}

.timeline-label {
    font-size: 0.65rem;
    color: var(--text-subtle);
    text-align: center;
    line-height: 1.3;
    padding: 0 4px;
}
.timeline-step.active .timeline-label { color: var(--accent); font-weight: 500; }
.timeline-step.done   .timeline-label { color: var(--text-muted); }

/* ===== PROGRESS BAR ===== */
.progress-wrap {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}
.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}
.progress-label { font-size: 0.8rem; color: var(--text-muted); }
.progress-pct   { font-size: 1.1rem; font-weight: 700; color: var(--accent); }

.progress-bar-track {
    height: 8px;
    background: rgba(255,255,255,0.05);
    border-radius: 4px;
    overflow: hidden;
}
.progress-bar-fill {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, #00d4ff, #0095b3);
    transition: width 600ms ease;
}

/* ===== PACKAGE BADGE (portal) ===== */
.badge {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding: 0.25rem 0.7rem;
    border-radius: 20px;
}
.badge-starter  { background: rgba(255,255,255,0.06); color: var(--text-muted); }
.badge-business { background: rgba(0,212,255,0.12); color: var(--accent); border: 1px solid var(--border-accent); }
.badge-custom   { background: rgba(180,100,255,0.12); color: #c084fc; }

.badge-paid     { background: rgba(0,212,255,0.1); color: var(--accent); }
.badge-pending  { background: rgba(255,200,0,0.1);  color: #ffd700; }
.badge-refunded { background: var(--error-bg);       color: var(--error); }

/* ===== MESSAGES ===== */
.message-thread {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-bottom: 2rem;
    max-height: 520px;
    overflow-y: auto;
    padding-right: 0.5rem;
}
.message-thread::-webkit-scrollbar { width: 4px; }
.message-thread::-webkit-scrollbar-track { background: transparent; }
.message-thread::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.message-bubble {
    max-width: 75%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem 1.25rem;
}
.message-bubble.mine {
    align-self: flex-end;
    background: rgba(0,212,255,0.08);
    border-color: var(--border-accent);
}

.message-meta {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.4rem;
}
.message-sender { font-size: 0.78rem; font-weight: 600; color: var(--text); }
.message-time   { font-size: 0.7rem; color: var(--text-subtle); }
.message-body   { font-size: 0.92rem; color: var(--text-muted); line-height: 1.6; }
.message-read   { font-size: 0.68rem; color: var(--accent); text-align: right; margin-top: 0.4rem; }

.msg-del-btn {
    background: none;
    border: none;
    color: var(--text-subtle);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0.2rem 0.35rem;
    border-radius: 4px;
    line-height: 1;
    transition: color var(--transition), background var(--transition);
}
.msg-del-btn:hover { color: var(--error); background: var(--error-bg); }

.message-compose {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
}
.message-compose textarea {
    resize: none;
    min-height: 90px;
}

/* ===== FILES ===== */
.file-list { display: flex; flex-direction: column; gap: 0.75rem; }

.file-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: border-color var(--transition);
}
.file-item:hover { border-color: var(--border-accent); }

.file-icon { font-size: 1.5rem; flex-shrink: 0; }

.file-info { flex: 1; min-width: 0; }
.file-name {
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.file-meta { font-size: 0.75rem; color: var(--text-subtle); margin-top: 0.2rem; }

.file-upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 2.5rem;
    text-align: center;
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition);
}
.file-upload-zone:hover,
.file-upload-zone.drag-over {
    border-color: var(--accent);
    background: rgba(0,212,255,0.03);
}
.file-upload-zone p { color: var(--text-muted); font-size: 0.9rem; margin-top: 0.5rem; }
.file-upload-zone small { color: var(--text-subtle); font-size: 0.78rem; display: block; margin-top: 0.3rem; }

/* ===== INVOICES TABLE ===== */
.data-table {
    width: 100%;
    border-collapse: collapse;
}
.data-table th,
.data-table td {
    padding: 1rem 1.25rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 0.88rem;
}
.data-table th {
    font-size: 0.72rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-subtle);
    font-weight: 500;
    background: var(--surface);
}
.data-table tbody tr:hover td { background: rgba(255,255,255,0.015); }
.data-table .amount { font-weight: 600; color: var(--text); }

/* ===== ADMIN STATS ===== */
.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 2.5rem;
}
.admin-stat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
}
.admin-stat-label {
    font-size: 0.72rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-subtle);
    margin-bottom: 0.5rem;
}
.admin-stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
    font-family: var(--font-display);
    line-height: 1;
}

/* ===== ADMIN PROJECT EDIT ===== */
.progress-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: rgba(255,255,255,0.08);
    border-radius: 3px;
    outline: none;
    margin-top: 0.5rem;
}
.progress-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
}
.progress-slider::-moz-range-thumb {
    width: 18px; height: 18px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    border: none;
}
.slider-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent);
    display: inline-block;
    min-width: 3ch;
}

/* ===== ACTIVITY FEED ===== */
.activity-feed { display: flex; flex-direction: column; gap: 0; }

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
}
.activity-item:last-child { border-bottom: none; }

.activity-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--accent);
    margin-top: 6px;
    flex-shrink: 0;
}
.activity-text { font-size: 0.88rem; color: var(--text-muted); line-height: 1.5; }
.activity-text strong { color: var(--text); font-weight: 500; }
.activity-time { font-size: 0.72rem; color: var(--text-subtle); margin-top: 0.2rem; }

/* ===== UNREAD BADGE ===== */
.unread-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--accent);
    color: #060d1a;
    font-size: 0.68rem;
    font-weight: 700;
    width: 18px; height: 18px;
    border-radius: 50%;
}

/* ===== BRIEF BUILDER ===== */
.brief-progress {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem 2rem;
}

.brief-steps-bar {
    display: flex;
    align-items: center;
    margin-bottom: 0.75rem;
}

.brief-step-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-subtle);
    flex-shrink: 0;
    transition: all var(--transition);
    position: relative;
    z-index: 1;
    cursor: default;
}

.brief-step-dot.active {
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 0 0 4px rgba(0,212,255,0.15);
}

.brief-step-dot.done {
    background: var(--accent);
    border-color: var(--accent);
    color: #060d1a;
}

.brief-step-line {
    flex: 1;
    height: 2px;
    background: var(--border);
    transition: background var(--transition);
}

.brief-step-line.done {
    background: var(--accent);
}

.brief-step-labels {
    display: flex;
    justify-content: space-between;
}

.brief-step-labels span {
    font-size: 0.68rem;
    color: var(--text-subtle);
    text-align: center;
    flex: 1;
    letter-spacing: 0.5px;
}

.brief-step-labels span:first-child { text-align: left; }
.brief-step-labels span:last-child  { text-align: right; }

.brief-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

/* ===== RADIO OPTIONS ===== */
.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.6rem 1rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    transition: all var(--transition);
    user-select: none;
}

.radio-option:hover {
    border-color: var(--border-accent);
    color: var(--text);
}

.radio-option input[type="radio"] {
    accent-color: var(--accent);
    flex-shrink: 0;
}

.radio-option:has(input:checked) {
    border-color: var(--accent);
    background: rgba(0,212,255,0.07);
    color: var(--accent);
}

/* ===== BRIEF BANNER (dashboard) ===== */
.brief-banner {
    background: linear-gradient(135deg, rgba(0,212,255,0.06), rgba(0,212,255,0.02));
    border: 1px solid var(--border-accent);
    border-radius: var(--radius);
    padding: 1.5rem 2rem;
}

.brief-banner-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.brief-banner-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.25rem;
}

.brief-banner-sub {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* ===== BRIEF ADMIN VIEW ===== */
.brief-admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.brief-admin-section {}

.brief-admin-heading {
    font-size: 0.7rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 1rem;
}

.brief-dl {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.5rem 1.5rem;
    font-size: 0.875rem;
}

.brief-dl dt {
    color: var(--text-subtle);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding-top: 2px;
    white-space: nowrap;
}

.brief-dl dd {
    color: var(--text-muted);
    line-height: 1.5;
}

/* ===== BREADCRUMBS ===== */
.breadcrumbs { margin-bottom: 1.5rem; }
.breadcrumb-list {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
    flex-wrap: wrap;
}
.breadcrumb-item { font-size: 0.85rem; color: var(--text-subtle); }
.breadcrumb-item a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color var(--transition);
}
.breadcrumb-item a:hover { color: var(--accent); opacity: 1; }
.breadcrumb-item.active { color: var(--text); }
.breadcrumb-item:not(:last-child)::after {
    content: '/';
    margin-left: 0.5rem;
    color: var(--text-subtle);
}

/* ===== TABS ===== */
.tab-nav {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 2rem;
    overflow-x: auto;
}

.tab-nav a {
    padding: 0.75rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    transition: all var(--transition);
    margin-bottom: -1px;
    display: inline-block;
}
.tab-nav a:hover { color: var(--text); opacity: 1; }
.tab-nav a.active { color: var(--accent); border-bottom-color: var(--accent); }

.tab-btn {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.75rem 1.25rem;
    cursor: pointer;
    transition: all var(--transition);
    margin-bottom: -1px;
}

.tab-btn:hover { color: var(--text); }

.tab-btn.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* ===== MODAL ===== */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.modal-container {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2rem;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-header h3 { font-size: 1.2rem; }

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    transition: color var(--transition);
}

.modal-close:hover { color: var(--text); }

/* ===== TEMPLATE EDITOR ===== */
.tpl-vars {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.tpl-var-chip {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--accent);
    font-size: 0.75rem;
    font-family: monospace;
    padding: 0.4rem 0.6rem;
    cursor: pointer;
    text-align: left;
    transition: all var(--transition);
}

.tpl-var-chip:hover {
    border-color: var(--accent);
    background: rgba(0,212,255,0.06);
}

.tpl-preview-box {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    font-size: 0.9rem;
}

.tpl-preview-subject {
    font-weight: 600;
    color: var(--text);
    font-size: 1rem;
}

.text-subtle { color: var(--text-subtle); }

/* ===== PROFILE PAGE ===== */
.profile-photo-wrap {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.profile-file-input {
    cursor: pointer;
    padding: 0.6rem 0.75rem;
    font-size: 0.875rem;
}

/* ===== RESPONSIVE PORTAL ===== */
@media (max-width: 768px) {
    .portal-wrap { flex-direction: column; }
    .sidebar {
        width: 100%;
        padding: 1.5rem 0 0;
    }
    .sidebar-nav {
        display: flex;
        flex-wrap: wrap;
        gap: 0.4rem;
    }
    .sidebar-nav li { flex: none; }
    .sidebar-nav a { font-size: 0.8rem; padding: 0.5rem 0.75rem; }
    .status-timeline { gap: 0; }
    .timeline-label { font-size: 0.58rem; }
    .message-bubble { max-width: 90%; }
}
