:root {
    --brand-primary: #0ea5e9;
    --brand-primary-dark: #0284c7;
    --brand-secondary: #14b8a6;
    --brand-dark: #0f766e;
    --surface: #ffffff;
    --line: #bae6fd;
    --text-muted: #0f766e;
    --page-bg: #ecfeff;
    --bs-primary: #0ea5e9;
    --bs-primary-rgb: 14, 165, 233;
}

* {
    font-family: "Roboto", sans-serif;
}

body {
    background:
        radial-gradient(circle at top right, #e0f2fe 0%, transparent 45%),
        radial-gradient(circle at bottom left, #ccfbf1 0%, transparent 35%),
        var(--page-bg);
    font-family: "Roboto", sans-serif;
}

select,
option,
optgroup {
    font-family: "Roboto", sans-serif !important;
}

a {
    color: var(--brand-primary);
}

.btn-primary {
    background: linear-gradient(90deg, var(--brand-primary), var(--brand-primary-dark));
    border: none;
}

.btn-primary:hover,
.btn-primary:focus {
    background: linear-gradient(90deg, var(--brand-primary-dark), var(--brand-primary));
}

.btn-outline-primary {
    border-color: var(--brand-primary);
    color: var(--brand-primary);
}

.btn-outline-primary:hover {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
}

/* Keep button styling consistent across the entire app, even when
   templates use different Bootstrap variants like success/danger/secondary. */
.btn-primary,
.btn-warning,
.btn-info,
.btn-success,
.btn-danger,
.btn-secondary {
    background: linear-gradient(90deg, var(--brand-primary), var(--brand-primary-dark));
    border-color: var(--brand-primary-dark);
    color: #fff;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-warning:hover,
.btn-warning:focus,
.btn-info:hover,
.btn-info:focus,
.btn-success:hover,
.btn-success:focus,
.btn-danger:hover,
.btn-danger:focus,
.btn-secondary:hover,
.btn-secondary:focus {
    background: linear-gradient(90deg, var(--brand-primary-dark), #0369a1);
    border-color: #0369a1;
    color: #fff;
}

.btn-outline-primary,
.btn-outline-warning,
.btn-outline-info,
.btn-outline-success,
.btn-outline-danger,
.btn-outline-secondary {
    border-color: var(--brand-primary);
    color: var(--brand-primary);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-warning:hover,
.btn-outline-warning:focus,
.btn-outline-info:hover,
.btn-outline-info:focus,
.btn-outline-success:hover,
.btn-outline-success:focus,
.btn-outline-danger:hover,
.btn-outline-danger:focus,
.btn-outline-secondary:hover,
.btn-outline-secondary:focus {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
    color: #fff;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 0.18rem rgba(14, 165, 233, 0.18);
}

.app-shell {
    min-height: 100vh;
    display: flex;
}

.app-sidebar {
    width: 250px;
    background: linear-gradient(180deg, #7dd3fc 0%, #0ea5e9 45%, #14b8a6 100%);
    color: #083344;
    padding: 1rem;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    border-right: 1px solid #67e8f9;
}

.app-brand {
    color: #082f49;
    margin-bottom: 0.9rem;
    padding: 0.2rem 0.2rem 0.55rem;
    border-bottom: 1px dashed rgba(8, 47, 73, 0.25);
}

.app-brand-title {
    font-weight: 800;
    font-size: 1.05rem;
    letter-spacing: 0.04em;
}

.app-brand-subtitle {
    font-size: 0.76rem;
    opacity: 0.85;
}

.app-sidebar .nav-link {
    color: #083344;
    border-radius: 0.5rem;
    padding: 0.48rem 0.6rem;
    font-size: 0.93rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.app-sidebar .nav-link:hover {
    background: rgba(240, 253, 250, 0.82);
    color: #082f49;
    transform: translateX(2px);
}

.app-sidebar .nav-link.active {
    background: transparent;
    color: #083344;
    box-shadow: none;
}

.sidebar-group {
    width: 100%;
}

.sidebar-group > summary {
    list-style: none;
    cursor: pointer;
}

.sidebar-group > summary::-webkit-details-marker {
    display: none;
}

.sidebar-subnav {
    padding-left: 0.7rem;
}

.sidebar-subnav .nav-link {
    font-size: 0.88rem;
    padding-top: 0.36rem;
    padding-bottom: 0.36rem;
}

.sidebar-caret {
    font-size: 0.8rem;
    transition: transform 0.2s ease;
}

.sidebar-group[open] .sidebar-caret {
    transform: rotate(180deg);
}

.app-main {
    flex: 1;
    min-width: 0;
}

.app-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(6px);
    border-bottom: 1px solid #bae6fd;
    box-shadow: 0 4px 16px rgba(14, 165, 233, 0.08);
    padding: 0.75rem 1rem;
}

.topbar-user-pill {
    color: #0f766e;
    font-weight: 700;
    background: linear-gradient(90deg, #ecfeff, #ccfbf1);
    border: 1px solid #99f6e4;
    border-radius: 999px;
    padding: 0.3rem 0.75rem;
    box-shadow: 0 4px 12px rgba(20, 184, 166, 0.12);
}

.app-content {
    padding: 1rem;
}

.card {
    border-radius: 0.75rem;
}

.stat-card {
    background: linear-gradient(135deg, var(--brand-primary-dark), var(--brand-secondary));
    color: #fff;
}

.table th,
.table td {
    vertical-align: middle;
}

.dashboard-card .card-body {
    min-height: 112px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.dashboard-card {
    background: linear-gradient(135deg, #0ea5e9, #14b8a6 55%, #0f766e);
    color: #fff;
    border-radius: 12px;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 14px 28px rgba(14, 116, 144, 0.26);
}

.dashboard-card h6 {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 0.35rem;
}

.dashboard-card h3 {
    margin-bottom: 0;
    font-size: 28px;
    font-weight: bold;
}

.dashboard-subcard .card-body {
    min-height: 72px;
    display: flex;
    align-items: center;
}

.dashboard-subcard {
    border-radius: 10px;
    font-size: 16px;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.dashboard-subcard-orange-1 {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
}

.dashboard-subcard-orange-2 {
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
}

.dashboard-subcard-orange-3 {
    background: linear-gradient(135deg, #34d399, #10b981);
}

.dashboard-subcard-orange-4 {
    background: linear-gradient(135deg, #fb7185, #ef4444);
}

.chart-wrapper {
    height: 220px;
}

.chart-wrapper-sm {
    height: 150px;
}

.chart-wrapper canvas {
    width: 100% !important;
    height: 100% !important;
}

.daily-work-card {
    background: transparent;
    border: 0;
    box-shadow: none !important;
}

.daily-work-card .card-header {
    background: transparent;
    border-bottom: 0;
    padding-bottom: 0.35rem;
}

.daily-work-card .card-body {
    padding-top: 0.25rem;
}

.quick-links-card {
    border: 1px solid #a7f3d0;
    box-shadow: 0 10px 24px rgba(15, 118, 110, 0.14);
}

.quick-links-card .card-header {
    color: #ffffff;
    background: linear-gradient(90deg, #0ea5e9, #14b8a6);
    border-bottom: 0;
}

.quick-link-btn {
    background: linear-gradient(90deg, #0ea5e9, #0284c7);
    border: 1px solid #0284c7;
    color: #fff;
}

.quick-link-btn:hover,
.quick-link-btn:focus {
    background: linear-gradient(90deg, #0284c7, #0369a1);
    border-color: #0369a1;
    color: #fff;
}

.table {
    font-size: 14px;
}

.table td,
.table th {
    vertical-align: middle;
    padding: 10px;
}

.table thead {
    background: linear-gradient(90deg, #0ea5e9, #14b8a6);
    color: #fff;
}

.table tbody tr:hover {
    background: #ecfeff;
}

.card-header {
    font-weight: 600;
    font-size: 16px;
    background: linear-gradient(90deg, #ecfeff, #e0f2fe);
    border-bottom: 1px solid var(--line);
}

.customer-form-wrap {
    animation: customerFormFadeIn 0.45s ease-out;
}

.customer-form-card {
    overflow: hidden;
    border-radius: 1rem;
    min-height: auto;
}

.customer-form-header {
    border: 0;
    color: #fff;
    padding: 0.85rem 1.1rem;
    background: linear-gradient(120deg, var(--brand-dark) 0%, var(--brand-primary-dark) 55%, var(--brand-secondary) 100%);
}

.customer-form-header h4 {
    font-weight: 700;
}

.customer-form-subtitle {
    font-size: 0.82rem;
    opacity: 0.92;
}

.customer-form-section {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #e5e7eb;
    border-radius: 0.65rem;
    padding: 0.7rem 0.75rem;
}

.customer-form-section-title {
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    margin-bottom: 0.45rem;
    color: #0f172a;
}

.customer-form-card .form-control,
.customer-form-card .form-select {
    border-radius: 0.5rem;
    border-color: #d1d5db;
    min-height: 38px;
    padding-top: 0.38rem;
    padding-bottom: 0.38rem;
    font-size: 0.92rem;
}

.customer-form-card textarea.form-control {
    min-height: 38px;
    resize: none;
}

.compact-customer-form .form-label {
    font-size: 0.82rem;
    margin-bottom: 0.2rem;
    font-weight: 600;
}

.compact-customer-form .form-text {
    font-size: 0.75rem;
    margin-top: 0.2rem;
}

.compact-customer-form .btn {
    padding-top: 0.38rem;
    padding-bottom: 0.38rem;
}

.customer-form-card .form-control:focus,
.customer-form-card .form-select:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 0.18rem rgba(14, 165, 233, 0.18);
}

.app-form-wrap {
    animation: customerFormFadeIn 0.45s ease-out;
}

.app-form-card {
    overflow: hidden;
    border-radius: 1rem;
    min-height: auto;
}

.app-form-header {
    border: 0;
    color: #fff;
    padding: 0.85rem 1.1rem;
    background: linear-gradient(120deg, var(--brand-dark) 0%, var(--brand-primary-dark) 55%, var(--brand-secondary) 100%);
}

.app-form-header h4 {
    font-weight: 700;
}

.app-form-subtitle {
    font-size: 0.82rem;
    opacity: 0.92;
}

.app-form-section {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #e5e7eb;
    border-radius: 0.65rem;
    padding: 0.7rem 0.75rem;
}

.app-form-section-title {
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    margin-bottom: 0.45rem;
    color: #0f172a;
}

.app-form-card .form-control,
.app-form-card .form-select {
    border-radius: 0.5rem;
    border-color: #d1d5db;
    min-height: 38px;
    padding-top: 0.38rem;
    padding-bottom: 0.38rem;
    font-size: 0.92rem;
}

.app-form-card textarea.form-control {
    min-height: 38px;
    resize: none;
}

.compact-app-form .form-label {
    font-size: 0.82rem;
    margin-bottom: 0.2rem;
    font-weight: 600;
}

.compact-app-form .form-text {
    font-size: 0.75rem;
    margin-top: 0.2rem;
}

.compact-app-form .btn {
    padding-top: 0.38rem;
    padding-bottom: 0.38rem;
}

.app-form-card .form-control:focus,
.app-form-card .form-select:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 0.18rem rgba(14, 165, 233, 0.18);
}

.customer-filter-wrap {
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0;
}

.customer-filter-form .form-label {
    font-size: 0.74rem;
    margin-bottom: 0.2rem;
    font-weight: 600;
}

.customer-filter-form .form-control,
.customer-filter-form .form-select {
    min-height: 32px;
    padding-top: 0.2rem;
    padding-bottom: 0.2rem;
    font-size: 0.82rem;
}

.customer-filter-form .btn {
    padding-top: 0.3rem;
    padding-bottom: 0.3rem;
    font-size: 0.82rem;
}

@keyframes customerFormFadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .app-shell {
        display: block;
    }
    .app-sidebar {
        width: 100%;
        height: auto;
        position: relative;
        border-right: 0;
        border-bottom: 1px solid #67e8f9;
    }
    .customer-form-card {
        min-height: auto;
    }
    .customer-form-header {
        padding: 1.1rem 1rem;
    }
    .customer-form-section {
        padding: 0.65rem;
    }
}
