/* ==========================================================
   CONTRACTOR PRO - Construction SaaS v2.0
   Main Style Sheet
   Reference Design System: Teras Land Contractor Management
   ========================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
    --cp-navy-dark: #0B132B;
    --cp-navy-sidebar: #0F172A;
    --cp-navy-card: #1E293B;
    --cp-primary-blue: #2563EB;
    --cp-primary-blue-hover: #1D4ED8;
    --cp-primary-light: #EFF6FF;
    --cp-bg-body: #F8FAFC;
    --cp-surface-white: #FFFFFF;
    --cp-border: #E2E8F0;
    --cp-border-light: #F1F5F9;
    --cp-text-main: #0F172A;
    --cp-text-muted: #64748B;
    --cp-text-subtle: #94A3B8;
    --cp-success: #10B981;
    --cp-success-light: #ECFDF5;
    --cp-warning: #F59E0B;
    --cp-warning-light: #FFFBEB;
    --cp-danger: #EF4444;
    --cp-danger-light: #FEF2F2;
    --cp-info: #06B6D4;
    --cp-info-light: #ECFEFF;
    --cp-purple: #8B5CF6;
    --cp-purple-light: #F5F3FF;
    --cp-radius-card: 16px;
    --cp-radius-pill: 9999px;
    --cp-shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --cp-shadow-md: 0 4px 20px -2px rgba(0, 0, 0, 0.05);
    --cp-shadow-lg: 0 10px 25px -3px rgba(15, 23, 42, 0.08);
    --cp-sidebar-width: 260px;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--cp-bg-body);
    color: var(--cp-text-main);
    margin: 0;
    padding: 0;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ==========================================================
   APP LAYOUT (Sidebar & Main Content)
   ========================================================== */
.cp-app-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* ----------------- SIDEBAR ----------------- */
.cp-sidebar {
    width: var(--cp-sidebar-width);
    background-color: var(--cp-navy-sidebar);
    color: #94A3B8;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1040;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    transition: transform 0.3s ease-in-out;
}

.cp-brand {
    padding: 24px 20px 20px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.cp-brand-logo {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, #2563EB, #1D4ED8);
    color: #ffffff;
    font-weight: 800;
    font-size: 15px;
    letter-spacing: 0.5px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.35);
}

.cp-brand-title {
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.2px;
    line-height: 1.2;
}

.cp-brand-title span {
    color: #60A5FA;
}

.cp-brand-subtitle {
    font-size: 11px;
    color: #64748B;
    font-weight: 500;
    margin-top: 2px;
}

.cp-sidebar-menu {
    flex-grow: 1;
    overflow-y: auto;
    padding: 16px 14px;
}

.cp-menu-heading {
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.8px;
    color: #475569;
    padding: 12px 10px 6px 10px;
    margin-top: 8px;
}

.cp-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 12px;
    color: #94A3B8;
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    margin-bottom: 3px;
    transition: all 0.2s ease;
}

.cp-nav-item i {
    width: 18px;
    font-size: 15px;
    text-align: center;
}

.cp-nav-item:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.05);
}

.cp-nav-item.active {
    background-color: var(--cp-primary-blue);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
}

.cp-nav-item.active i {
    color: #ffffff;
}

/* User profile snippet inside sidebar bottom */
.cp-sidebar-user {
    padding: 14px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(15, 23, 42, 0.6);
    display: flex;
    align-items: center;
    gap: 12px;
}

.cp-user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #1E293B;
    border: 2px solid #334155;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #93C5FD;
    font-weight: 700;
    font-size: 14px;
    overflow: hidden;
}

.cp-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cp-user-info {
    flex-grow: 1;
    min-width: 0;
}

.cp-user-name {
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.cp-user-badge {
    display: inline-block;
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    background: rgba(37, 99, 235, 0.2);
    color: #60A5FA;
    padding: 1px 8px;
    border-radius: 6px;
    margin-top: 3px;
}

/* ----------------- MAIN CONTENT AREA ----------------- */
.cp-main-wrapper {
    margin-left: var(--cp-sidebar-width);
    flex-grow: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ----------------- TOPBAR ----------------- */
.cp-topbar {
    height: 70px;
    background-color: var(--cp-surface-white);
    border-bottom: 1px solid var(--cp-border);
    padding: 0 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1020;
}

.cp-page-title-wrap h1 {
    font-size: 18px;
    font-weight: 700;
    color: var(--cp-text-main);
    margin: 0;
    line-height: 1.2;
}

.cp-page-subtitle {
    font-size: 12px;
    color: var(--cp-text-muted);
    margin-top: 2px;
}

.cp-topbar-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.cp-status-pill {
    background: #FFFBEB;
    color: #B45309;
    border: 1px solid #FDE68A;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.cp-status-pill.online {
    background: #ECFDF5;
    color: #065F46;
    border-color: #A7F3D0;
}

.cp-status-pill .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: currentColor;
}

.cp-role-tag {
    background: #F1F5F9;
    color: #475569;
    font-size: 12px;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 8px;
    border: 1px solid var(--cp-border);
}

.cp-notif-btn {
    position: relative;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1px solid var(--cp-border);
    background: #ffffff;
    color: var(--cp-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.2s ease;
}

.cp-notif-btn:hover {
    background: #F8FAFC;
    color: var(--cp-primary-blue);
    border-color: #CBD5E1;
}

.cp-notif-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 18px;
    height: 18px;
    background: #EF4444;
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #ffffff;
}

/* ----------------- PAGE BODY ----------------- */
.cp-content-container {
    padding: 24px 28px 48px 28px;
    flex-grow: 1;
}

/* ==========================================================
   HERO DASHBOARD BANNER (Strictly matching screenshot)
   ========================================================== */
.cp-hero-banner {
    background: linear-gradient(135deg, #1E293B 0%, #0F172A 100%);
    border-radius: var(--cp-radius-card);
    padding: 28px 32px;
    color: #ffffff;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.15);
    margin-bottom: 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cp-hero-banner::after {
    content: '';
    position: absolute;
    top: -40px;
    right: -40px;
    width: 220px;
    height: 220px;
    background: radial-gradient(circle, rgba(37,99,235,0.2) 0%, rgba(37,99,235,0) 70%);
    pointer-events: none;
}

.cp-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #34D399;
    font-size: 11.5px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 12px;
}

.cp-hero-badge .dot {
    width: 6px;
    height: 6px;
    background-color: #10B981;
    border-radius: 50%;
    box-shadow: 0 0 6px #10B981;
}

.cp-hero-title {
    font-size: 24px;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 6px 0;
    letter-spacing: -0.3px;
}

.cp-hero-desc {
    color: #94A3B8;
    font-size: 13.5px;
    margin: 0;
    max-width: 580px;
}

.cp-btn-hero {
    background: #2563EB;
    color: #ffffff;
    font-size: 13.5px;
    font-weight: 600;
    padding: 12px 24px;
    border-radius: 12px;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
}

.cp-btn-hero:hover {
    background: #1D4ED8;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.5);
}

/* ==========================================================
   STAT CARDS (Ringkasan Proyek)
   ========================================================== */
.cp-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.cp-section-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--cp-text-main);
    margin: 0;
}

.cp-section-link {
    font-size: 13px;
    font-weight: 600;
    color: var(--cp-primary-blue);
    text-decoration: none;
}

.cp-section-link:hover {
    text-decoration: underline;
}

.cp-stat-card {
    background: var(--cp-surface-white);
    border: 1px solid var(--cp-border);
    border-radius: var(--cp-radius-card);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--cp-shadow-md);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    text-decoration: none;
    color: inherit;
}

.cp-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--cp-shadow-lg);
    border-color: #CBD5E1;
    color: inherit;
}

.cp-stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.cp-stat-icon.blue {
    background: #EFF6FF;
    color: #2563EB;
}

.cp-stat-icon.green {
    background: #ECFDF5;
    color: #10B981;
}

.cp-stat-icon.amber {
    background: #FFFBEB;
    color: #F59E0B;
}

.cp-stat-icon.purple {
    background: #F5F3FF;
    color: #8B5CF6;
}

.cp-stat-label {
    font-size: 12.5px;
    color: var(--cp-text-muted);
    font-weight: 500;
    margin-bottom: 2px;
}

.cp-stat-value {
    font-size: 26px;
    font-weight: 800;
    color: var(--cp-text-main);
    line-height: 1.1;
}

/* ==========================================================
   MENU CEPAT (8 Quick Tiles)
   ========================================================== */
.cp-quick-menu-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 14px;
    margin-bottom: 28px;
}

.cp-quick-tile {
    background: var(--cp-surface-white);
    border: 1px solid var(--cp-border);
    border-radius: var(--cp-radius-card);
    padding: 16px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-decoration: none;
    color: var(--cp-text-main);
    box-shadow: var(--cp-shadow-sm);
    transition: all 0.2s ease;
}

.cp-quick-tile:hover {
    transform: translateY(-2px);
    box-shadow: var(--cp-shadow-md);
    border-color: var(--cp-primary-blue);
    color: var(--cp-primary-blue);
}

.cp-quick-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.cp-quick-icon.i-blue { background: #EFF6FF; color: #2563EB; }
.cp-quick-icon.i-purple { background: #F5F3FF; color: #8B5CF6; }
.cp-quick-icon.i-amber { background: #FFFBEB; color: #D97706; }
.cp-quick-icon.i-emerald { background: #ECFDF5; color: #059669; }
.cp-quick-icon.i-pink { background: #FDF2F8; color: #DB2777; }
.cp-quick-icon.i-rose { background: #FFF1F2; color: #E11D48; }
.cp-quick-icon.i-cyan { background: #ECFEFF; color: #0891B2; }
.cp-quick-icon.i-indigo { background: #EEF2FF; color: #4F46E5; }

.cp-quick-label {
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
}

/* ==========================================================
   PROJECT MONITORING CARDS
   ========================================================== */
.cp-project-card {
    background: var(--cp-surface-white);
    border: 1px solid var(--cp-border);
    border-radius: var(--cp-radius-card);
    padding: 22px 24px;
    box-shadow: var(--cp-shadow-md);
    margin-bottom: 18px;
    transition: all 0.2s ease;
}

.cp-project-card:hover {
    border-color: #CBD5E1;
    box-shadow: var(--cp-shadow-lg);
}

.cp-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.cp-badge-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 700;
}

.cp-badge-status .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.cp-badge-status.berjalan {
    background: #ECFDF5;
    color: #059669;
}

.cp-badge-status.menunggu {
    background: #FFFBEB;
    color: #D97706;
}

.cp-badge-status.selesai {
    background: #EFF6FF;
    color: #2563EB;
}

.cp-badge-status.planning {
    background: #F1F5F9;
    color: #475569;
}

.cp-deadline-text {
    font-size: 12px;
    color: var(--cp-text-muted);
    font-weight: 500;
}

.cp-project-name {
    font-size: 17px;
    font-weight: 700;
    color: var(--cp-text-main);
    margin: 0 0 6px 0;
}

.cp-project-name a {
    color: inherit;
    text-decoration: none;
}

.cp-project-name a:hover {
    color: var(--cp-primary-blue);
}

.cp-project-meta {
    font-size: 12.5px;
    color: var(--cp-text-muted);
    margin-bottom: 16px;
}

.cp-progress-wrap {
    margin-bottom: 18px;
}

.cp-progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 6px;
}

.cp-progress-bar-bg {
    height: 8px;
    background: #E2E8F0;
    border-radius: 4px;
    overflow: hidden;
}

.cp-progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #2563EB, #3B82F6);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.cp-project-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    padding-top: 14px;
    border-top: 1px solid var(--cp-border-light);
}

.cp-pstat-item {
    display: flex;
    flex-direction: column;
}

.cp-pstat-label {
    font-size: 11px;
    color: var(--cp-text-muted);
    font-weight: 500;
    margin-bottom: 2px;
}

.cp-pstat-val {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--cp-text-main);
}

/* ==========================================================
   STANDARD UI COMPONENTS (Tables, Buttons, Forms, Modals)
   ========================================================== */
.cp-card {
    background: var(--cp-surface-white);
    border: 1px solid var(--cp-border);
    border-radius: var(--cp-radius-card);
    padding: 24px;
    box-shadow: var(--cp-shadow-md);
    margin-bottom: 24px;
}

.cp-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.cp-table th {
    background: #F8FAFC;
    color: #475569;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--cp-border);
}

.cp-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--cp-border-light);
    vertical-align: middle;
    font-size: 13.5px;
}

.cp-table tbody tr:hover td {
    background-color: #F8FAFC;
}

.btn-cp-primary {
    background: var(--cp-primary-blue);
    color: #ffffff;
    font-weight: 600;
    padding: 8px 18px;
    border-radius: 10px;
    border: none;
    transition: all 0.2s ease;
}

.btn-cp-primary:hover {
    background: var(--cp-primary-blue-hover);
    color: #ffffff;
}

.btn-cp-light {
    background: #ffffff;
    color: var(--cp-text-main);
    border: 1px solid var(--cp-border);
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.btn-cp-light:hover {
    background: #F8FAFC;
    border-color: #CBD5E1;
}

/* KANBAN BOARD */
.cp-kanban-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    align-items: start;
}

.cp-kanban-col {
    background: #F1F5F9;
    border-radius: 14px;
    padding: 16px;
    min-height: 450px;
}

.cp-kanban-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.cp-kanban-title {
    font-size: 13.5px;
    font-weight: 700;
    color: #334155;
    margin: 0;
}

.cp-kanban-count {
    background: #E2E8F0;
    color: #475569;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
}

.cp-kanban-card {
    background: #ffffff;
    border: 1px solid var(--cp-border);
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 12px;
    box-shadow: var(--cp-shadow-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.cp-kanban-card:hover {
    box-shadow: var(--cp-shadow-md);
    transform: translateY(-2px);
    border-color: #93C5FD;
}

/* Tabs */
.cp-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--cp-border);
    margin-bottom: 24px;
    overflow-x: auto;
}

.cp-tab-link {
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 600;
    color: var(--cp-text-muted);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.cp-tab-link:hover {
    color: var(--cp-primary-blue);
}

.cp-tab-link.active {
    color: var(--cp-primary-blue);
    border-bottom-color: var(--cp-primary-blue);
}
