/* ═══════════════════════════════════════════════
   FIELDVIO CRM — Modern SaaS Design System
   Font: Inter
   Deep navy/teal sidebar · warm white content
   ═══════════════════════════════════════════════ */

:root {
    --brand-teal: #0D7377;
    --brand-teal-dark: #0A5E61;
    --brand-teal-light: #3DA5A8;
    --brand-gold: #E8734A;
    --brand-gold-dark: #D4623C;
    --brand-bg: #F5F3F0;
    --brand-red: #E17055;
    --brand-text: #2D2A26;
    --brand-text-muted: #7A756E;
    --brand-border: #E8E4DF;
    --brand-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.06);
    --brand-radius: 12px;
    --brand-radius-lg: 16px;
    --sidebar-bg: linear-gradient(165deg, #162447 0%, #0D7377 100%);
    --sidebar-text: rgba(255,255,255,0.85);
    --sidebar-text-muted: rgba(255,255,255,0.4);
    --sidebar-hover: rgba(255,255,255,0.08);
    --sidebar-active: rgba(255,255,255,0.15);
}

body {
    background-color: var(--brand-bg);
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: var(--brand-text);
    font-size: 15px;
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--brand-text);
}

/* ── Navbar ── */
.bg-brand {
    background-color: var(--brand-teal) !important;
    box-shadow: 0 1px 8px rgba(13,115,119,0.15);
}
.text-gold {
    color: var(--brand-gold) !important;
}
.bg-gold {
    background-color: var(--brand-gold) !important;
}
.navbar {
    padding: 8px 0;
}
.navbar-brand {
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: -0.01em;
}
.navbar-dark .nav-link {
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    font-size: 0.9rem;
    padding: 8px 14px !important;
    border-radius: 8px;
    transition: all 0.2s;
}
.navbar-dark .nav-link:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}
.navbar-dark .nav-link.active {
    color: white;
    font-weight: 600;
    background: rgba(255,255,255,0.15);
}
.dropdown-menu {
    border: 1px solid var(--brand-border);
    border-radius: var(--brand-radius);
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    padding: 6px;
}
.dropdown-item {
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.9rem;
}
.dropdown-item:hover {
    background-color: var(--brand-bg);
}

/* ── Cards ── */
.card {
    border: 1px solid var(--brand-border);
    border-radius: var(--brand-radius-lg);
    box-shadow: var(--brand-shadow);
    overflow: hidden;
    background: white;
}
.card-header-brand {
    background-color: #FAF8F6;
    color: var(--brand-text);
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    padding: 12px 18px;
    border-radius: 0 !important;
    border-bottom: 1px solid var(--brand-border);
}
.card-body {
    padding: 18px;
}

/* ── Buttons ── */
.btn {
    border-radius: var(--brand-radius);
    font-weight: 600;
    font-size: 0.875rem;
    padding: 8px 20px;
    transition: all 0.2s;
    letter-spacing: 0.01em;
}
.btn-sm {
    padding: 6px 14px;
    font-size: 0.8rem;
    border-radius: 10px;
}
.btn-brand {
    background-color: var(--brand-teal);
    color: white;
    border: none;
}
.btn-brand:hover {
    background-color: var(--brand-teal-dark);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(13,115,119,0.25);
}
.btn-gold {
    background-color: var(--brand-gold);
    color: white;
    border: none;
    font-weight: 700;
}
.btn-gold:hover {
    background-color: var(--brand-gold-dark);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(232,115,74,0.35);
}
.btn-danger-brand {
    background-color: var(--brand-red);
    color: white;
    border: none;
}
.btn-danger-brand:hover {
    background-color: #C5513C;
    color: white;
}
.btn-outline-secondary {
    border-radius: var(--brand-radius);
}
.btn-outline-danger {
    border-radius: var(--brand-radius);
}

/* ── Forms ── */
.form-control, .form-select {
    border: 1.5px solid var(--brand-border);
    border-radius: 10px;
    padding: 9px 14px;
    font-size: 0.9rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    color: var(--brand-text);
    background: white;
}
.form-control:focus, .form-select:focus {
    border-color: var(--brand-teal);
    box-shadow: 0 0 0 3px rgba(13, 115, 119, 0.12);
}
.form-label {
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--brand-text-muted);
    margin-bottom: 4px;
}
.form-control-sm, .form-select-sm {
    padding: 6px 10px;
    font-size: 0.82rem;
    border-radius: 8px;
}

/* ── Badges ── */
.badge {
    font-weight: 600;
    font-size: 0.72rem;
    letter-spacing: 0.3px;
    padding: 5px 10px;
    border-radius: 20px;
}

/* Status badges — soft pill style */
.badge-pending { background: rgba(156,163,175,0.15); color: #6B7280; }
.badge-assigned { background: rgba(13,115,119,0.12); color: #0D7377; }
.badge-in_progress { background: rgba(37,99,235,0.12); color: #2563EB; }
.badge-completed { background: rgba(34,197,94,0.12); color: #16A34A; }
.badge-cancelled { background: rgba(225,112,85,0.12); color: #C5513C; }
.badge-accepted { background: rgba(37,99,235,0.12); color: #2563EB; }
.badge-on_my_way { background: rgba(124,58,237,0.12); color: #7C3AED; }
.badge-arrived { background: rgba(8,145,178,0.12); color: #0891B2; }

/* Priority badges */
.badge-low { background: rgba(107,114,128,0.12); color: #6B7280; }
.badge-normal { background: rgba(59,130,246,0.12); color: #3B82F6; }
.badge-high { background: rgba(245,158,11,0.12); color: #D97706; }
.badge-urgent { background: rgba(239,68,68,0.12); color: #EF4444; }

/* Invoice badges */
.badge-draft { background: rgba(156,163,175,0.15); color: #6B7280; }
.badge-sent { background: rgba(37,99,235,0.12); color: #2563EB; }
.badge-partial { background: rgba(245,158,11,0.12); color: #D97706; }
.badge-paid { background: rgba(34,197,94,0.12); color: #16A34A; }
.badge-overdue { background: rgba(220,38,38,0.12); color: #DC2626; }

/* ── Tables ── */
.table {
    font-size: 0.9rem;
}
.table thead th {
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--brand-text-muted);
    border-bottom: 2px solid var(--brand-border);
    padding: 10px 12px;
}
.table-brand thead th {
    background-color: #FAF8F6;
    color: var(--brand-text-muted);
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    border-bottom: 1px solid var(--brand-border);
}
.table-brand tbody tr:nth-child(even) {
    background-color: #FAFAF8;
}
.table-brand tbody tr:hover {
    background-color: #F0EDEA;
}
.table-hover tbody tr:hover {
    background-color: #F0EDEA;
}

/* ── Search ── */
.search-input {
    border: 2px solid var(--brand-border);
    border-radius: 10px;
}
.search-input:focus {
    border-color: var(--brand-teal);
    box-shadow: 0 0 0 3px rgba(13, 115, 119, 0.1);
}

/* ── Metric Cards ── */
.metric-card {
    border-left: none;
    border-radius: var(--brand-radius-lg);
    transition: all 0.2s;
    background: white;
    border: 1px solid var(--brand-border);
}
.metric-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}
.metric-card .metric-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--brand-text);
    letter-spacing: -0.03em;
}
.metric-card .metric-label {
    font-size: 0.75rem;
    color: var(--brand-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 600;
}

/* ── Alerts ── */
.alert {
    border-radius: var(--brand-radius);
    border: none;
    font-size: 0.9rem;
    font-weight: 500;
}

/* ── Nav Pills (status tabs) ── */
.nav-pills .nav-link {
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 6px 16px;
    color: var(--brand-text-muted);
    transition: all 0.2s;
}
.nav-pills .nav-link.active {
    background-color: var(--brand-teal);
    color: white;
}
.nav-pills .nav-link:hover:not(.active) {
    background-color: rgba(13, 115, 119, 0.08);
    color: var(--brand-teal);
}

/* ── List Groups ── */
.list-group-item {
    border-color: var(--brand-border);
    font-size: 0.9rem;
}
.list-group-item-action:hover {
    background-color: #F0EDEA;
}

/* ── Pagination ── */
.page-link {
    border-radius: 8px !important;
    margin: 0 2px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--brand-teal);
    border: 1px solid var(--brand-border);
}
.page-item.active .page-link {
    background-color: var(--brand-teal);
    border-color: var(--brand-teal);
}

/* ── Breadcrumbs ── */
.breadcrumb {
    font-size: 0.85rem;
    background: transparent;
    padding: 0;
    margin-bottom: 0;
}
.breadcrumb-item a {
    color: var(--brand-teal);
    text-decoration: none;
    font-weight: 500;
}
.breadcrumb-item a:hover {
    color: var(--brand-gold);
}

/* ── Tech Status Buttons ── */
.btn-accepted {
    background-color: #2563EB;
    color: white;
    border: none;
}
.btn-accepted:hover {
    background-color: #1d4ed8;
    color: white;
}
.btn-on-my-way {
    background-color: #7C3AED;
    color: white;
    border: none;
}
.btn-on-my-way:hover {
    background-color: #6d28d9;
    color: white;
}
.btn-arrived {
    background-color: #0891B2;
    color: white;
    border: none;
}
.btn-arrived:hover {
    background-color: #0e7490;
    color: white;
}

/* ── Notification Badge ── */
.notify-badge {
    font-size: 0.65rem;
    padding: 2px 5px;
    animation: pulse-badge 2s infinite;
}
@keyframes pulse-badge {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.2); }
}

/* ── Tech Job Card ── */
.tech-job-card {
    transition: all 0.2s;
    border-radius: var(--brand-radius-lg);
}
.tech-job-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

/* ── Mobile ── */
@media (max-width: 768px) {
    body {
        font-size: 14px;
    }
    .table-responsive-stack thead { display: none; }
    .table-responsive-stack tbody tr {
        display: block;
        margin-bottom: 10px;
        background: white;
        border: 1px solid var(--brand-border);
        border-radius: var(--brand-radius);
        padding: 12px;
    }
    .table-responsive-stack tbody td {
        display: flex;
        justify-content: space-between;
        padding: 4px 0;
        border: none;
    }
    .table-responsive-stack tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--brand-teal);
        font-size: 0.8rem;
        text-transform: uppercase;
    }
    .metric-card .metric-value {
        font-size: 1.5rem;
    }
    .card {
        border-radius: var(--brand-radius);
    }
    .btn {
        padding: 8px 16px;
    }
}

/* ── Print ── */
@media print {
    .no-print { display: none !important; }
    .navbar, .alert { display: none !important; }
    body { background: white !important; }
}

/* ── Call Center Tab Navigation ── */
.cc-tabs { border-bottom: 2px solid var(--brand-border); gap: 0; flex-wrap: wrap; }
.cc-tabs .nav-link { font-weight: 600; font-size: .85rem; color: var(--brand-text-muted); border: none; border-bottom: 2px solid transparent; margin-bottom: -2px; padding: .5rem .75rem; white-space: nowrap; }
.cc-tabs .nav-link:hover { color: var(--brand-teal); }
.cc-tabs .nav-link.active { color: var(--brand-teal); border-bottom-color: var(--brand-teal); }
