/* ===== Customer Portal Dashboard — matches Dashboard_Portal.png ===== */
#ccp-app, #ccp-app * { box-sizing: border-box; }
#ccp-app {
    --navy: #0b1b3f;
    --blue: #2f5bff;
    --green: #16a34a;
    --purple: #7c3aed;
    --orange: #f59e0b;
    --red: #ef4444;
    --bg: #f4f6fb;
    --card: #ffffff;
    --border: #eef0f5;
    --text: #1b1f2a;
    --muted: #7a8296;
    font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    display: flex;
    background: var(--bg);
    min-height: 100vh;
    color: var(--text);
}

/* ---------- Sidebar ---------- */
.ccp-sidebar {
    width: 240px;
    background: var(--navy);
    color: #fff;
    padding: 22px 16px;
    flex-shrink: 0;
    min-height: 100vh;
}
.ccp-logo { font-weight: 700; font-size: 18px; padding: 0 8px 24px; }
.ccp-nav { display: flex; flex-direction: column; gap: 4px; }
.ccp-nav a {
    display: flex; align-items: center; gap: 10px;
    color: #c7cde3; text-decoration: none;
    padding: 11px 12px; border-radius: 8px; font-size: 14.5px;
    position: relative;
}
.ccp-nav a span { width: 18px; text-align: center; }
.ccp-nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.ccp-nav a.active { background: var(--blue); color: #fff; font-weight: 600; }
.ccp-badge {
    background: var(--red); color: #fff; font-size: 11px; font-weight: 700;
    border-radius: 999px; padding: 1px 7px; margin-left: auto;
}
.ccp-badge:empty { display: none; }

/* ---------- Main ---------- */
.ccp-main { flex: 1; padding: 28px 32px; max-width: 100%; }
.ccp-topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 26px; }
.ccp-topbar-right { display: flex; align-items: center; gap: 18px; }
.ccp-icon { position: relative; font-size: 18px; color: var(--muted); cursor: pointer; }
.ccp-icon .ccp-badge { position: absolute; top: -6px; right: -10px; margin: 0; }
.ccp-avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.ccp-username { font-weight: 600; font-size: 14.5px; }

.ccp-welcome { font-size: 24px; font-weight: 700; margin: 0 0 4px; }
.ccp-subtitle { color: var(--muted); margin: 0 0 24px; font-size: 14.5px; }
.ccp-loading { color: var(--muted); }

/* ---------- Stat cards ---------- */
.ccp-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; margin-bottom: 22px; }
.ccp-stat-card {
    background: var(--card); border-radius: 14px; padding: 18px;
    display: flex; gap: 14px; align-items: flex-start;
    box-shadow: 0 1px 2px rgba(16,24,40,.04);
}
.ccp-stat-icon {
    width: 44px; height: 44px; border-radius: 12px; display: flex;
    align-items: center; justify-content: center; font-size: 19px; color: #fff; flex-shrink: 0;
}
.ccp-stat-icon.blue { background: var(--blue); }
.ccp-stat-icon.green { background: var(--green); }
.ccp-stat-icon.purple { background: var(--purple); }
.ccp-stat-icon.orange { background: var(--orange); }
.ccp-stat-icon.red { background: var(--red); }
.ccp-stat-num { font-size: 22px; font-weight: 700; line-height: 1; }
.ccp-stat-label { color: var(--muted); font-size: 13px; margin: 4px 0 8px; }
.ccp-stat-link { font-size: 13px; color: var(--blue); text-decoration: none; font-weight: 600; }

/* ---------- Panels (Services / Activity) ---------- */
.ccp-panels { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; margin-bottom: 18px; }
.ccp-panel {
    background: var(--card); border-radius: 14px; padding: 20px;
    box-shadow: 0 1px 2px rgba(16,24,40,.04);
}
.ccp-panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.ccp-panel-head h3 { margin: 0; font-size: 16px; }
.ccp-panel-head a { font-size: 13px; color: var(--blue); text-decoration: none; font-weight: 600; }

.ccp-service-row {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 0; border-bottom: 1px solid var(--border);
}
.ccp-service-row:last-child { border-bottom: none; }
.ccp-service-icon {
    width: 44px; height: 44px; border-radius: 10px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.ccp-service-icon.blue { background: #e7edff; }
.ccp-service-icon.green { background: #e5f8ec; }
.ccp-service-icon.orange { background: #fff1de; }
.ccp-service-info { flex: 1; min-width: 0; }
.ccp-service-info .ccp-title-line { display: flex; align-items: center; gap: 8px; margin-bottom: 2px; }
.ccp-service-info strong { font-size: 14.5px; }
.ccp-service-meta { color: var(--muted); font-size: 12.5px; }
.ccp-pill { font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 999px; }
.ccp-pill.progress { background: #e7edff; color: var(--blue); }
.ccp-pill.active { background: #e5f8ec; color: var(--green); }
.ccp-pill.completed { background: #ece5fd; color: var(--purple); }
.ccp-progress-wrap { width: 150px; flex-shrink: 0; }
.ccp-progress-top { display: flex; justify-content: space-between; font-size: 12.5px; margin-bottom: 6px; }
.ccp-progress-bar { height: 6px; background: var(--border); border-radius: 999px; overflow: hidden; }
.ccp-progress-bar > i { display: block; height: 100%; border-radius: 999px; }
.ccp-btn-outline {
    border: 1px solid var(--blue); color: var(--blue); background: transparent;
    padding: 7px 14px; border-radius: 8px; font-size: 12.5px; font-weight: 600; white-space: nowrap;
}
.ccp-btn-outline.green { border-color: var(--green); color: var(--green); }
.ccp-btn-outline.orange { border-color: var(--orange); color: var(--orange); }

/* Recent Activity */
.ccp-activity-row { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.ccp-activity-row:last-child { border-bottom: none; }
.ccp-activity-dot {
    width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; font-size: 14px; color: #fff;
}
.ccp-activity-text { font-size: 13.5px; }
.ccp-activity-time { color: var(--muted); font-size: 12px; margin-top: 2px; }

/* ---------- Tables ---------- */
.ccp-tables { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.ccp-table-wrap table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.ccp-table-wrap th { text-align: left; color: var(--muted); font-weight: 600; padding: 8px 6px; font-size: 12.5px; }
.ccp-table-wrap td { padding: 12px 6px; border-top: 1px solid var(--border); }
.ccp-status { font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.ccp-status.paid, .ccp-status.completed { background: #e5f8ec; color: var(--green); }
.ccp-status.due, .ccp-status.pending-pay { background: #fdeaea; color: var(--red); }
.ccp-status.in-progress { background: #e7edff; color: var(--blue); }
.ccp-status.pending { background: #fff1de; color: var(--orange); }

/* ---------- List pages (Orders / Services / Invoices) toolbar + pagination ---------- */
.ccp-list-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.ccp-filter { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.ccp-filter label { color: var(--muted); font-weight: 600; }
.ccp-filter select {
    padding: 7px 10px; border: 1px solid #dfe2ea; border-radius: 8px; font-size: 13.5px; background: #fff;
}
.ccp-list-count { color: var(--muted); font-size: 13px; }
.ccp-pagination { display: flex; gap: 6px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }
.ccp-page-btn {
    border: 1px solid var(--border); background: #fff; color: var(--text);
    padding: 6px 12px; border-radius: 8px; font-size: 13px; cursor: pointer;
}
.ccp-page-btn:hover:not(:disabled) { border-color: var(--blue); color: var(--blue); }
.ccp-page-btn.active { background: var(--blue); border-color: var(--blue); color: #fff; font-weight: 600; }
.ccp-page-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ---------- Auth (Login/Register) ---------- */
.ccp-auth-wrap { max-width: 420px; margin: 50px auto; padding: 0 16px; font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
.ccp-auth-logo { display: flex; justify-content: center; margin-bottom: 22px; }
.ccp-auth-logo img { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; }
.ccp-auth-logo-fallback {
    width: 84px; height: 84px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg,#2f5bff,#7c3aed); color: #fff; font-size: 34px; font-weight: 700;
}
.ccp-auth-box {
    background: #fff; padding: 34px 30px; border-radius: 16px; box-shadow: 0 4px 24px rgba(16,24,40,.08);
}
.ccp-auth-box h2 { margin: 0 0 20px; font-size: 21px; text-align: center; font-weight: 700; color: #1b1f2a; }
.ccp-auth-box label { display: block; font-size: 13px; font-weight: 600; margin: 14px 0 6px; color: #444; }
.ccp-auth-box input[type="text"],
.ccp-auth-box input[type="email"],
.ccp-auth-box input[type="password"] {
    width: 100%; padding: 11px 12px; border: 1px solid #dfe2ea; border-radius: 8px; font-size: 14px;
}
.ccp-pw-field { position: relative; }
.ccp-pw-field input { padding-right: 40px !important; }
.ccp-pw-toggle {
    position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
    background: none; border: none; cursor: pointer; font-size: 16px; padding: 6px 8px; opacity: .55;
}
.ccp-pw-toggle:hover { opacity: 1; }

.ccp-auth-row { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; font-size: 13px; }
.ccp-auth-row a { color: #5b4fe8; text-decoration: none; font-weight: 600; }
.ccp-remember { display: flex !important; align-items: center; gap: 7px; font-weight: 500 !important; margin: 0 !important; font-size: 13px; color: #444; }
.ccp-remember input { width: auto !important; }

.ccp-auth-submit {
    width: 100%; margin-top: 22px; background: linear-gradient(135deg,#5b4fe8,#7c3aed); color: #fff; border: none;
    padding: 13px; border-radius: 10px; font-weight: 700; cursor: pointer; font-size: 15px;
}
.ccp-auth-submit:hover { opacity: .92; }
.ccp-auth-switch { text-align: center; margin: 20px 0 0; font-size: 13.5px; color: #666; }
.ccp-auth-switch a { color: #5b4fe8; font-weight: 700; text-decoration: none; }

.ccp-forgot-box input[type="email"] {
    width: 100%; padding: 11px 12px; border: 1px solid #dfe2ea; border-radius: 8px; font-size: 14px;
}

.ccp-msg { font-size: 13px; margin-bottom: 4px; }
.ccp-msg.error { color: #ef4444; }
.ccp-msg.success { color: #16a34a; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
    .ccp-stats { grid-template-columns: repeat(3, 1fr); }
    .ccp-panels, .ccp-tables { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
    #ccp-app { flex-direction: column; }
    .ccp-sidebar { width: 100%; min-height: auto; }
    .ccp-stats { grid-template-columns: repeat(2, 1fr); }
    .ccp-main { padding: 18px; }
}
