* {
    box-sizing: border-box;
}

:root {
    --brand: #84bd00;
    --brand-600: #6fa100;
    --brand-700: #547a00;
    --brand-soft: #eef7df;
    --ink: #172012;
    --text: #334155;
    --muted: #64748b;
    --line: #dbe3d2;
    --surface: #ffffff;
    --surface-2: #f7faf3;
    --bg: #f3f6ef;
    --danger: #dc2626;
    --warning: #f59e0b;
    --success: #16a34a;
    --info: #2563eb;
    --primary-color: var(--brand);
    --primary-light: var(--brand-soft);
    --primary-dark: var(--brand-700);
    --primary-red: var(--brand);
    --dark-gray: var(--ink);
    --medium-gray: var(--muted);
    --light-gray: var(--surface-2);
    --neutral-dark: var(--text);
    --neutral-medium: var(--muted);
    --neutral-light: var(--line);
    --neutral-lighter: var(--surface-2);
    --white: #fff;
    --radius: 8px;
    --shadow: 0 14px 40px rgba(31, 41, 55, 0.08);
    --shadow-sm: 0 8px 20px rgba(31, 41, 55, 0.06);
}

html {
    direction: rtl;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background: var(--bg);
    font-family: Vazirmatn, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 14px;
    line-height: 1.7;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

.no-scroll {
    overflow: hidden;
}

.crm-app {
    min-height: 100vh;
    display: flex;
    background:
        radial-gradient(circle at 8% 8%, rgba(132, 189, 0, 0.12), transparent 26rem),
        var(--bg);
}

.sidebar {
    width: 280px;
    flex: 0 0 280px;
    min-height: 100vh;
    background: rgba(255, 255, 255, 0.96);
    border-left: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 50;
    transition: width 0.2s ease, transform 0.2s ease;
}

.sidebar.collapsed {
    width: 84px;
    flex-basis: 84px;
}

.sidebar-header {
    height: 74px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    font-weight: 900;
    min-width: 0;
}

.logo-mark,
.auth-brand i,
.login-icon,
.brand-mark,
.user-avatar,
.customer-avatar,
.user-avatar-sm {
    display: grid;
    place-items: center;
    border-radius: var(--radius);
    background: var(--brand-soft);
    color: var(--brand-700);
}

.logo-mark {
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
}

.logo-text,
.menu-text,
.user-meta {
    transition: opacity 0.15s ease, width 0.15s ease;
}

.sidebar.collapsed .logo-text,
.sidebar.collapsed .menu-text {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

.sidebar-nav,
.menu {
    display: grid;
    gap: 6px;
    padding: 14px 10px;
    margin: 0;
    list-style: none;
}

.menu-link {
    min-height: 46px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius);
    color: var(--text);
    border: 1px solid transparent;
    font-weight: 800;
    white-space: nowrap;
}

.menu-link:hover {
    background: var(--brand-soft);
    color: var(--brand-700);
}

.menu-link.active {
    background: var(--brand);
    color: #fff;
    box-shadow: 0 12px 24px rgba(132, 189, 0, 0.22);
}

.menu-icon {
    width: 20px;
    text-align: center;
    flex: 0 0 auto;
}

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

.topbar,
.header {
    min-height: 74px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px 24px;
    background: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(12px);
}

.topbar-title {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.topbar-eyebrow {
    display: block;
    color: var(--brand-700);
    font-size: 0.78rem;
    font-weight: 900;
}

.topbar h1,
.header h2,
.page-header h2 {
    margin: 0;
    color: var(--ink);
    font-size: 1.45rem;
    font-weight: 900;
    line-height: 1.35;
}

.icon-btn {
    width: 40px;
    height: 40px;
    display: inline-grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
}

.icon-btn:hover {
    border-color: var(--brand);
    color: var(--brand-700);
}

.mobile-toggle {
    display: none;
}

.user-menu,
.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.user-avatar {
    width: 42px;
    height: 42px;
    font-weight: 900;
}

.user-meta {
    display: grid;
    min-width: 0;
}

.user-meta strong {
    color: var(--ink);
    line-height: 1.3;
}

.user-meta span {
    color: var(--muted);
    font-size: 0.82rem;
    direction: ltr;
}

.dropdown {
    position: relative;
}

.dropdown-content {
    min-width: 170px;
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    padding: 8px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    z-index: 100;
}

.dropdown:hover .dropdown-content {
    display: grid;
}

.dropdown-content a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    border-radius: var(--radius);
    color: var(--text);
    font-weight: 700;
}

.dropdown-content a:hover {
    background: var(--brand-soft);
    color: var(--brand-700);
}

.content {
    padding: 24px;
}

.content > .content {
    padding: 0;
}

.page-header,
.tab-header,
.form-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.page-actions,
.form-actions,
.filter-actions,
.export-buttons,
.action-buttons,
.customer-card-actions,
.user-card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.stats,
.dashboard-grid,
.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

.stat-card,
.form-container,
.table-container,
.analytics-card,
.profile-panel,
.report-card,
.card,
.customer-card,
.user-card,
.call-item,
.modal-custom,
.modal-custom-deal {
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(219, 227, 210, 0.9);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.stat-card {
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: var(--brand);
}

.stat-card i {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: var(--radius);
    background: var(--brand-soft);
    color: var(--brand-700);
    margin-bottom: 14px;
}

.stat-card h3,
.analytics-card h3,
.form-container h3,
.tab-header h3,
.form-header h3 {
    margin: 0 0 8px;
    color: var(--ink);
    font-size: 1.05rem;
    font-weight: 900;
}

.stat-card p {
    margin: 0;
    color: var(--muted);
    font-size: 1.2rem;
    font-weight: 900;
}

.form-container,
.analytics-card,
.card {
    padding: 22px;
    margin-bottom: 22px;
}

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

.card-header h3,
.card-header h4 {
    margin: 0;
    color: var(--ink);
    font-weight: 900;
}

.card-body {
    padding: 0;
}

.jalali-field {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
}

.jalali-display {
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fbfdf9;
    color: var(--ink);
    padding: 10px 12px;
    text-align: right;
    cursor: pointer;
}

.jalali-display:hover,
.jalali-display:focus {
    border-color: var(--brand);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(132, 189, 0, 0.14);
    outline: 0;
}

.jalali-display i {
    color: var(--brand-700);
}

.jalali-picker {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: min(320px, calc(100vw - 32px));
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
    z-index: 300;
}

.jalali-picker.open {
    display: block;
}

.jalali-picker-header,
.jalali-picker-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.jalali-picker-header {
    margin-bottom: 10px;
}

.jalali-picker-header button {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-2);
    color: var(--text);
    cursor: pointer;
}

.jalali-picker-header button:hover {
    border-color: var(--brand);
    color: var(--brand-700);
}

.jalali-picker-header strong {
    color: var(--ink);
    font-weight: 900;
}

.jalali-weekdays,
.jalali-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}

.jalali-weekdays {
    margin-bottom: 6px;
}

.jalali-weekdays span {
    color: var(--muted);
    text-align: center;
    font-size: 0.82rem;
    font-weight: 900;
}

.jalali-day {
    min-height: 34px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    background: var(--surface-2);
    color: var(--text);
    cursor: pointer;
    font-weight: 800;
}

.jalali-day:hover {
    border-color: var(--brand);
    color: var(--brand-700);
}

.jalali-day.selected {
    background: var(--brand);
    color: #fff;
}

.jalali-time-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 12px 0 0;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fbfdf9;
}

.jalali-time-label {
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 900;
    white-space: nowrap;
}

.jalali-time-controls {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    direction: ltr;
}

.jalali-time-select {
    min-width: 70px;
    min-height: 38px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--ink);
    font-weight: 900;
    text-align: center;
    text-align-last: center;
    cursor: pointer;
}

.jalali-time-select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(132, 189, 0, 0.14);
    outline: 0;
}

.jalali-time-separator {
    color: var(--ink);
    font-weight: 900;
}

.jalali-day.blank {
    background: transparent;
    pointer-events: none;
}

.jalali-picker-footer {
    margin-top: 10px;
    border-top: 1px solid var(--line);
    padding-top: 10px;
}

.dashboard-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
    padding: 24px;
    border: 1px solid rgba(219, 227, 210, 0.9);
    border-radius: var(--radius);
    background:
        linear-gradient(135deg, rgba(132, 189, 0, 0.12), rgba(255, 255, 255, 0.92)),
        var(--surface);
    box-shadow: var(--shadow-sm);
}

.dashboard-hero h2 {
    margin: 4px 0 6px;
    color: var(--ink);
    font-size: 1.8rem;
    font-weight: 900;
}

.dashboard-hero p {
    margin: 0;
    color: var(--muted);
    font-weight: 700;
}

.dashboard-kpis {
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.dashboard-kpi {
    display: block;
    color: inherit;
}

.dashboard-kpi span {
    display: block;
    margin-top: 8px;
    color: var(--muted);
    font-weight: 800;
    font-size: 0.9rem;
}

.dashboard-grid-wide {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.weekly-bars {
    min-height: 220px;
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 12px;
    align-items: end;
}

.weekly-bar-item {
    display: grid;
    gap: 7px;
    justify-items: center;
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 800;
}

.weekly-bar-track {
    width: 100%;
    height: 150px;
    display: flex;
    align-items: end;
    border-radius: var(--radius);
    background: var(--surface-2);
    border: 1px solid var(--line);
    overflow: hidden;
}

.weekly-bar-fill {
    width: 100%;
    min-height: 8px;
    background: linear-gradient(180deg, var(--brand), var(--brand-700));
    border-radius: var(--radius) var(--radius) 0 0;
}

.pipeline-row {
    display: grid;
    gap: 8px;
    margin-bottom: 14px;
}

.pipeline-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.pipeline-meta strong {
    color: var(--ink);
}

.pipeline-meta span {
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 800;
}

.pipeline-track {
    height: 10px;
    border-radius: 999px;
    background: #e5e7eb;
    overflow: hidden;
}

.pipeline-fill {
    height: 100%;
    min-width: 5%;
    border-radius: inherit;
    background: var(--brand);
}

.health-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.health-grid div {
    padding: 15px;
    border-radius: var(--radius);
    background: var(--surface-2);
    border: 1px solid var(--line);
}

.health-grid strong,
.health-grid span {
    display: block;
}

.health-grid strong {
    color: var(--ink);
    font-size: 1.35rem;
    font-weight: 900;
}

.health-grid span {
    color: var(--muted);
    font-weight: 800;
}

.activity-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}

.activity-item:last-child {
    border-bottom: 0;
}

.activity-item strong,
.activity-item span {
    display: block;
}

.activity-item strong {
    color: var(--ink);
    font-weight: 900;
}

.activity-item span {
    color: var(--muted);
    font-size: 0.9rem;
}

.activity-icon {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: var(--radius);
    background: var(--brand-soft);
    color: var(--brand-700);
}

.activity-icon.danger {
    background: #fee2e2;
    color: var(--danger);
}

.dashboard-table {
    box-shadow: none;
    border: 0;
    background: transparent;
}

.dashboard-table table {
    min-width: 560px;
}

.tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 10px;
}

.tab {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-2);
    color: var(--text);
    font-weight: 900;
    cursor: pointer;
}

.tab.active,
.tab:hover {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.form-grid,
.filters-grid,
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label,
.field-group label,
.filter-group label,
.form-label {
    display: block;
    margin-bottom: 7px;
    color: var(--ink);
    font-weight: 900;
}

.form-control,
.field-control,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"],
input[type="date"],
input[type="datetime-local"],
select,
textarea {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fbfdf9;
    color: var(--ink);
    padding: 10px 12px;
    outline: none;
}

textarea {
    min-height: 96px;
}

.form-control:focus,
input:focus,
select:focus,
textarea:focus,
.field-control:focus-within {
    border-color: var(--brand);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(132, 189, 0, 0.14);
}

.field-control {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
}

.field-control input {
    border: 0;
    padding: 0;
    min-height: 50px;
    background: transparent;
    box-shadow: none;
}

.field-control input:focus {
    box-shadow: none;
}

[dir="ltr"],
input[type="email"],
input[type="tel"] {
    direction: ltr;
    text-align: left;
}

.btn,
.login-submit,
.search-btn {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    padding: 9px 14px;
    background: var(--brand);
    color: #fff;
    font-weight: 900;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn:hover,
.login-submit:hover,
.search-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 22px rgba(132, 189, 0, 0.22);
}

.btn-primary,
.btn-success {
    background: var(--brand);
    color: #fff;
}

.btn-secondary {
    background: #475569;
    color: #fff;
}

.btn-danger,
.btn-delete {
    background: var(--danger);
    color: #fff;
}

.btn-warning,
.btn-edit {
    background: var(--warning);
    color: #111827;
}

.btn-info {
    background: var(--info);
    color: #fff;
}

.btn-outline-primary,
.btn-outline,
.btn-link {
    background: #fff;
    color: var(--brand-700);
    border-color: var(--brand);
}

.btn-outline-danger {
    background: #fff;
    color: var(--danger);
    border-color: rgba(220, 38, 38, 0.35);
}

.btn-sm {
    min-height: 34px;
    padding: 6px 9px;
    font-size: 0.86rem;
}

.search-box {
    min-width: min(380px, 100%);
}

.search-input-group,
.input-group,
.date-inputs,
.range-inputs {
    display: flex;
    align-items: stretch;
    gap: 8px;
}

.table-container {
    overflow-x: auto;
    margin-bottom: 18px;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

th,
td {
    padding: 13px 14px;
    border-bottom: 1px solid var(--line);
    text-align: right;
    vertical-align: middle;
}

thead th {
    color: var(--ink);
    background: var(--surface-2);
    font-weight: 900;
    white-space: nowrap;
}

tbody tr:hover {
    background: #fbfdf9;
}

.badge,
.role-badge,
.department-badge,
.status-active,
.status-inactive,
.status-badge,
.filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 0.82rem;
    font-weight: 900;
    line-height: 1.2;
}

.text-muted {
    color: var(--muted) !important;
}

.text-primary {
    color: var(--brand-700) !important;
}

.bg-light {
    background: var(--surface-2) !important;
}

.d-flex {
    display: flex !important;
}

.justify-content-between {
    justify-content: space-between !important;
}

.align-items-center {
    align-items: center !important;
}

.mb-0 {
    margin-bottom: 0 !important;
}

.mb-3 {
    margin-bottom: 1rem !important;
}

.mb-4 {
    margin-bottom: 1.5rem !important;
}

.mt-2 {
    margin-top: 0.5rem !important;
}

.mt-4 {
    margin-top: 1.5rem !important;
}

.badge,
.department-badge {
    background: #eef2ff;
    color: #3730a3;
}

.status-active,
.role-admin,
.filter-tag {
    background: #dcfce7;
    color: #166534;
}

.status-inactive,
.role-user {
    background: #fee2e2;
    color: #991b1b;
}

.role-manager {
    background: #fef3c7;
    color: #92400e;
}

.customer-info,
.user-info,
.customer-card-main,
.user-card-main {
    display: flex;
    align-items: center;
    gap: 10px;
}

.customer-avatar,
.user-avatar-sm {
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    font-weight: 900;
}

.customer-card-view,
.user-card-view {
    display: none;
    gap: 14px;
}

.customer-card,
.user-card,
.profile-panel {
    padding: 16px;
}

.profile-panel h3 {
    margin-top: 0;
    color: var(--ink);
    font-weight: 900;
}

.profile-panel p {
    margin: 0 0 10px;
}

.customer-card-details,
.user-card-details {
    min-width: 0;
}

.customer-card-name,
.user-card-name,
.user-name {
    color: var(--ink);
    font-weight: 900;
}

.customer-card-company,
.customer-card-phone,
.customer-card-email,
.user-card-email,
.user-card-phone,
.customer-card-meta,
.user-card-meta {
    color: var(--muted);
    font-size: 0.9rem;
}

.customer-card-meta,
.user-card-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 14px 0;
}

.alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 15px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    border: 1px solid transparent;
    font-weight: 800;
}

.alert-success {
    background: #f0fdf4;
    color: #166534;
    border-color: #bbf7d0;
}

.alert-error,
.alert-danger {
    background: #fef2f2;
    color: #991b1b;
    border-color: #fecaca;
}

.alert-info,
.alert-light {
    background: #eff6ff;
    color: #1d4ed8;
    border-color: #bfdbfe;
}

.empty-state,
.text-center.py-4 {
    padding: 34px 18px;
    text-align: center;
    color: var(--muted);
    background: #fff;
    border: 1px dashed var(--line);
    border-radius: var(--radius);
}

.empty-state i {
    color: var(--brand-700);
    font-size: 2rem;
    margin-bottom: 10px;
}

.pagination,
.pagination-container nav > div,
.pagination-container nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
}

.page-link,
.pagination a,
.pagination span {
    min-width: 36px;
    min-height: 36px;
    display: inline-grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    color: var(--text);
    padding: 6px 10px;
}

.page-item.active .page-link,
.pagination .active span {
    background: var(--brand);
    color: #fff;
    border-color: var(--brand);
}

.modal-custom,
.modal-custom-deal {
    padding: 16px;
    margin-bottom: 12px;
}

.modal-header {
    border: 0;
    padding: 0 0 10px;
}

.modal-title {
    margin: 0;
    color: var(--ink);
    font-size: 1rem;
    font-weight: 900;
}

.modal-body,
.modal-body-deal {
    color: var(--text);
    padding: 0;
}

.progress-bar,
.hour-bar-container {
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
}

.progress-bar {
    height: 8px;
}

.progress-fill,
.hour-bar {
    background: var(--brand);
}

.auth-body {
    background:
        radial-gradient(circle at 12% 18%, rgba(132, 189, 0, 0.18), transparent 28rem),
        linear-gradient(135deg, #f7faf2 0%, #eef4e8 48%, #ffffff 100%);
}

.auth-app {
    min-height: 100vh;
}

.auth-nav {
    height: 68px;
    display: flex;
    align-items: center;
    padding: 0 28px;
}

.auth-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    font-weight: 900;
}

.auth-brand i {
    width: 40px;
    height: 40px;
}

.auth-main {
    padding: 18px 0 32px;
}

.login-shell {
    width: min(1120px, calc(100% - 32px));
    min-height: calc(100vh - 118px);
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
    align-items: center;
    gap: 28px;
}

.login-brand-panel,
.login-card {
    border: 1px solid rgba(31, 41, 55, 0.08);
    box-shadow: 0 24px 70px rgba(24, 43, 12, 0.12);
}

.login-brand-panel {
    min-height: 560px;
    border-radius: var(--radius);
    padding: 44px;
    color: #fff;
    background:
        linear-gradient(145deg, rgba(22, 43, 11, 0.88), rgba(77, 112, 0, 0.82)),
        url("https://images.unsplash.com/photo-1551434678-e076c223a692?auto=format&fit=crop&w=1400&q=80") center/cover;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    overflow: hidden;
}

.brand-mark {
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.28);
    color: #fff;
    font-size: 1.45rem;
    margin-bottom: auto;
}

.eyebrow {
    margin: 0 0 10px;
    color: #d8ff8a;
    font-weight: 900;
}

.login-brand-panel h1 {
    max-width: 560px;
    margin: 0 0 16px;
    font-size: clamp(2rem, 4vw, 3.4rem);
    line-height: 1.25;
    font-weight: 900;
}

.brand-copy {
    max-width: 520px;
    margin: 0;
    color: rgba(255, 255, 255, 0.84);
    line-height: 2;
    font-size: 1.05rem;
}

.brand-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 34px;
}

.brand-metrics div {
    padding: 16px;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.13);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.brand-metrics strong,
.brand-metrics span {
    display: block;
}

.brand-metrics span {
    color: rgba(255, 255, 255, 0.78);
}

.login-card {
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.96);
    padding: 36px;
}

.login-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 28px;
}

.login-icon {
    width: 48px;
    height: 48px;
}

.login-card h2 {
    margin: 0 0 6px;
    color: var(--ink);
    font-size: 1.5rem;
    font-weight: 900;
}

.login-card p {
    margin: 0;
    color: var(--muted);
}

.login-form {
    display: grid;
    gap: 18px;
}

.field-error,
.error-message,
.invalid-feedback {
    display: block;
    margin-top: 7px;
    color: var(--danger);
    font-size: 0.9rem;
    font-weight: 800;
}

.login-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.remember-option {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.remember-option input {
    width: 16px;
    height: 16px;
    accent-color: var(--brand);
}

.login-options a,
.register-link a {
    color: var(--brand-700);
    font-weight: 900;
}

.login-submit {
    min-height: 54px;
    font-size: 1.02rem;
}

.register-link {
    text-align: center;
}

.status-message {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
    border: 1px solid #bbf7d0;
    border-radius: var(--radius);
    background: #f0fdf4;
    color: #166534;
    padding: 13px 15px;
    font-weight: 800;
}

.app-overlay {
    display: none;
}

@media (max-width: 860px) {
    .crm-app {
        display: block;
    }

    .sidebar {
        position: fixed;
        inset: 0 0 0 auto;
        height: 100vh;
        transform: translateX(100%);
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    .sidebar.collapsed {
        width: 280px;
    }

    .app-overlay.active {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.42);
        z-index: 40;
    }

    .mobile-toggle {
        display: inline-grid;
    }

    .topbar,
    .header {
        padding: 12px 14px;
    }

    .user-meta {
        display: none;
    }

    .content {
        padding: 16px;
    }

    .page-header,
    .tab-header,
    .form-header,
    .dashboard-hero {
        align-items: flex-start;
        flex-direction: column;
    }

    .activity-item {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .activity-item > .btn,
    .activity-item > .badge {
        grid-column: 2;
        justify-self: start;
    }
}

@media (max-width: 720px) {
    .table-container {
        display: none;
    }

    .customer-card-view,
    .user-card-view {
        display: grid;
    }

    .form-container,
    .analytics-card,
    .login-card {
        padding: 20px;
    }
}

@media (max-width: 900px) {
    .login-shell {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .login-brand-panel {
        min-height: 330px;
        padding: 30px;
    }
}

@media (max-width: 560px) {
    .auth-nav {
        padding: 0 16px;
    }

    .login-shell {
        width: min(100% - 20px, 1120px);
        gap: 14px;
    }

    .login-brand-panel {
        min-height: 280px;
        padding: 22px;
    }

    .brand-metrics {
        grid-template-columns: 1fr;
    }

    .search-input-group,
    .input-group,
    .date-inputs,
    .range-inputs {
        flex-direction: column;
    }

    .weekly-bars {
        gap: 7px;
    }

    .weekly-bar-track {
        height: 110px;
    }

    .health-grid {
        grid-template-columns: 1fr;
    }
}
