/* ===== PRICIMA DESIGN TOKENS — EIC CRM ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { font-family: 'Neue Haas Grotesk Display Pro','Helvetica Neue',Arial,sans-serif; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; background: #e6e6e6; color: #111827; }
::selection { background: #d9f99d; color: #09090b; }
a { text-decoration: none; color: inherit; }

.ms { font-family: 'Material Symbols Rounded'; font-weight: normal; font-style: normal; line-height: 1; text-rendering: optimizeLegibility; display: inline-block; user-select: none; }

/* ===== LAYOUT ===== */
.app { display: flex; width: 100%; min-width: 1280px; height: 100vh; background: #e6e6e6; overflow: hidden; }

/* ===== SIDEBAR ===== */
.sidebar { width: 264px; flex: none; height: 100%; background: #f4f4f5; border-right: 1px solid #e4e4e7; display: flex; flex-direction: column; padding: 22px 16px; }
.sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 8px 22px; }
.sidebar-brand { font-size: 19px; font-weight: 700; letter-spacing: .16em; color: #09090b; }
.sidebar-toggle { width: 30px; height: 30px; border-radius: 9px; border: 1px solid #e4e4e7; background: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.sidebar-new { cursor: pointer; border: none; width: 100%; display: flex; align-items: center; justify-content: center; gap: 7px; background: #d9f99d; color: #09090b; font-family: inherit; font-size: 14px; font-weight: 500; padding: 11px 16px; border-radius: 12px; box-shadow: 0 1px 4px -2px rgba(82,102,29,.35); margin-bottom: 22px; transition: background .15s; }
.sidebar-new:hover { background: #bef264; }
.nav { display: flex; flex-direction: column; gap: 3px; flex: 1; overflow-y: auto; }
.nav-section { font-size: 11px; font-weight: 600; letter-spacing: .1em; color: #a1a1aa; padding: 12px 12px 5px; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 11px; color: #52525b; font-size: 14px; font-weight: 450; cursor: pointer; text-decoration: none; transition: background .1s, color .1s; }
.nav-item:hover { background: #ebebed; color: #18181b; }
.nav-item.active { background: #fff; color: #09090b; font-weight: 500; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.nav-item .ms { font-size: 21px; color: #71717a; flex: none; }
.nav-item.active .ms { color: #09090b; }
.nav-item .nav-label { flex: 1; }
.nav-badge { font-family: 'Manrope', sans-serif; font-size: 11px; font-weight: 600; color: #3f3f46; background: #e4e4e7; border-radius: 99px; padding: 2px 8px; }
.nav-badge-danger { background: #fee2e2; color: #b91c1c; }
.sidebar-footer { margin-top: auto; padding-top: 16px; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 11px; color: #71717a; font-size: 13px; cursor: pointer; transition: background .1s; }
.sidebar-footer:hover { background: #ebebed; }
.sidebar-footer .ms { font-size: 20px; }

/* ===== SIDEBAR COLLAPSE ===== */
.sidebar { transition: width .2s ease; overflow: hidden; }
.sidebar-toggle { cursor: pointer; flex: none; }
.sidebar-toggle .ms { transition: transform .0s; }

.sidebar.collapsed { width: 68px; padding: 22px 10px; }
.sidebar.collapsed .sidebar-brand { display: none; }
.sidebar.collapsed .sb-label { display: none; }
.sidebar.collapsed .nav-label { display: none; }
.sidebar.collapsed .nav-badge { display: none; }
.sidebar.collapsed .nav-section { display: none; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 10px; gap: 0; }
.sidebar.collapsed .nav-item .ms { margin: 0; }
.sidebar.collapsed .sidebar-new { justify-content: center; padding: 10px; gap: 0; width: 100%; }
.sidebar.collapsed .sidebar-footer { justify-content: center; padding: 10px; gap: 0; }
.sidebar.collapsed .sb-logout { display: none; }
.sidebar.collapsed .sidebar-head { justify-content: center; padding-bottom: 18px; }

/* ===== MAIN ===== */
.main { flex: 1; min-width: 0; height: 100%; background: #fff; display: flex; flex-direction: column; }
.main-header { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 22px 32px 18px; border-bottom: 1px solid #f1f1f3; flex: none; }
.header-left { display: flex; align-items: baseline; gap: 12px; }
.page-title { font-size: 26px; font-weight: 600; letter-spacing: -.01em; color: #09090b; }
.page-subtitle { font-size: 13px; color: #9ca3af; }
.count-chip { font-family: 'Manrope', sans-serif; font-size: 12px; font-weight: 600; color: #6b7280; background: #f1f1f3; border-radius: 99px; padding: 3px 10px; }
.header-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.content { flex: 1; overflow-y: auto; padding: 24px 32px; }
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #9ca3af; margin-bottom: 20px; }
.breadcrumb a { color: #9ca3af; transition: color .1s; }
.breadcrumb a:hover { color: #52525b; }
.breadcrumb .ms { font-size: 16px; }

/* ===== BUTTONS ===== */
.btn-primary { cursor: pointer; border: none; display: inline-flex; align-items: center; gap: 6px; background: #d9f99d; color: #09090b; font-family: inherit; font-size: 14px; font-weight: 500; padding: 10px 16px; border-radius: 12px; box-shadow: 0 1px 4px -2px rgba(82,102,29,.3); transition: background .15s; white-space: nowrap; }
.btn-primary:hover { background: #bef264; }
.btn-dark { cursor: pointer; border: none; display: inline-flex; align-items: center; gap: 6px; background: #18181b; color: #fafafa; font-family: inherit; font-size: 14px; font-weight: 500; padding: 10px 16px; border-radius: 12px; transition: background .15s; white-space: nowrap; }
.btn-dark:hover { background: #09090b; }
.btn-ghost { cursor: pointer; background: #fff; color: #1f2937; border: 1px solid #e4e4e7; display: inline-flex; align-items: center; gap: 6px; font-family: inherit; font-size: 14px; font-weight: 500; padding: 10px 16px; border-radius: 12px; transition: all .15s; white-space: nowrap; }
.btn-ghost:hover { background: #f9fafb; border-color: #d4d4d8; }
.btn-icon { cursor: pointer; width: 40px; height: 40px; border-radius: 12px; border: 1px solid #e4e4e7; background: #fff; display: inline-flex; align-items: center; justify-content: center; transition: all .15s; flex: none; }
.btn-icon:hover { background: #f9fafb; border-color: #d4d4d8; }
.btn-ghost .ms, .btn-primary .ms, .btn-dark .ms { font-size: 18px; }

/* ===== SEARCH ===== */
.search-wrap { display: flex; align-items: center; gap: 8px; border: 1px solid #e4e4e7; border-radius: 10px; padding: 9px 12px; background: #f9fafb; min-width: 240px; }
.search-wrap .ms { font-size: 18px; color: #9ca3af; flex: none; }
.search-wrap input { border: none; background: transparent; font-family: inherit; font-size: 14px; color: #111827; outline: none; width: 100%; }
.search-wrap input::placeholder { color: #9ca3af; }

/* ===== BADGES ===== */
.badge { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 600; padding: 4px 9px; border-radius: 8px; white-space: nowrap; }
.badge-success { background: #dcfce7; color: #166534; }
.badge-danger { background: #fee2e2; color: #b91c1c; }
.badge-info { background: #dbeafe; color: #2563eb; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-gray { background: #f4f4f5; color: #52525b; }
.badge-dark { background: #18181b; color: #f4f4f5; }

/* ===== KPI CARDS ===== */
.kpi-strip { display: grid; gap: 16px; margin-bottom: 24px; }
.kpi-4 { grid-template-columns: repeat(4, 1fr); }
.kpi-3 { grid-template-columns: repeat(3, 1fr); }
.kpi-card { background: #f9fafb; border: 1px solid #e4e4e7; border-radius: 16px; padding: 20px 22px; position: relative; }
.kpi-card.accent { background: #f1fae3; border-color: #e6f3d0; }
.kpi-card.danger { background: #fff5f5; border-color: #fecaca; }
.kpi-card.warning { background: #fffbeb; border-color: #fde68a; }
.kpi-label { font-size: 13px; color: #52525b; margin-bottom: 8px; }
.kpi-value { font-family: 'Manrope', sans-serif; font-size: 30px; font-weight: 600; color: #09090b; letter-spacing: -.01em; }
.kpi-value-danger { color: #b91c1c; }
.kpi-value-warning { color: #92400e; }
.kpi-value-success { color: #166534; }
.kpi-sub { font-size: 12px; color: #9ca3af; margin-top: 4px; }
.kpi-badge { position: absolute; top: 16px; right: 16px; }

/* ===== FILTER CHIPS ===== */
.filter-row { display: flex; gap: 8px; margin-bottom: 20px; align-items: center; flex-wrap: wrap; }
.filter-label { font-size: 12px; font-weight: 500; color: #9ca3af; flex: none; }
.chip { cursor: pointer; display: inline-flex; align-items: center; gap: 4px; border: 1px solid #e4e4e7; border-radius: 99px; padding: 5px 14px; font-size: 12px; font-weight: 500; color: #52525b; background: #fff; transition: all .15s; user-select: none; }
.chip:hover { border-color: #d4d4d8; background: #f9fafb; }
.chip.active { background: #09090b; color: #f9fafb; border-color: #09090b; }
.chip.danger { background: #fee2e2; color: #b91c1c; border-color: #fca5a5; }
.chip.warning { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.chip.success { background: #dcfce7; color: #166534; border-color: #86efac; }

/* ===== TABLE ===== */
.table-card { border: 1px solid #e4e4e7; border-radius: 16px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.03); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th { padding: 11px 16px; text-align: left; font-size: 11px; font-weight: 600; letter-spacing: .08em; color: #9ca3af; border-bottom: 1px solid #f1f1f3; background: #fafafa; white-space: nowrap; }
thead th:first-child { padding-left: 20px; }
tbody tr { border-bottom: 1px solid #f1f1f3; transition: background .1s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover td { background: #f9fafb; }
tbody tr.clickable { cursor: pointer; }
tbody td { padding: 14px 16px; font-size: 14px; color: #1f2937; vertical-align: middle; }
tbody td:first-child { padding-left: 20px; }
.td-name { font-weight: 500; color: #09090b; }
.td-secondary { font-size: 12px; color: #9ca3af; margin-top: 2px; }
.td-mono { font-family: 'Manrope', sans-serif; font-size: 13px; }
.td-num { font-family: 'Manrope', sans-serif; font-size: 14px; font-weight: 500; text-align: center; }
.td-muted { color: #9ca3af; font-size: 13px; }
.table-footer { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-top: 1px solid #f1f1f3; background: #fafafa; }
.table-footer-text { font-family: 'Manrope', sans-serif; font-size: 13px; color: #9ca3af; }
.empty-state { text-align: center; padding: 48px 20px; color: #9ca3af; }
.empty-state .ms { font-size: 40px; display: block; margin-bottom: 12px; color: #d4d4d8; }
.empty-state p { font-size: 14px; }

/* ===== TABS ===== */
.tabs { display: flex; gap: 0; border-bottom: 1px solid #f1f1f3; padding: 0 32px; flex: none; overflow-x: auto; }
.tab { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 500; color: #9ca3af; padding: 14px 4px; margin-right: 24px; border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; transition: color .1s; }
.tab:hover { color: #52525b; }
.tab.active { color: #09090b; border-bottom-color: #09090b; }
.tab .ms { font-size: 18px; }
.tab .tab-count { font-family: 'Manrope', sans-serif; font-size: 11px; font-weight: 600; background: #f1f1f3; color: #52525b; border-radius: 99px; padding: 2px 7px; }
.tab.active .tab-count { background: #09090b; color: #f9fafb; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ===== SECTION CARD ===== */
.section-card { background: #fff; border: 1px solid #e4e4e7; border-radius: 16px; margin-bottom: 16px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.03); }
.section-card-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid #f1f1f3; }
.section-card-title { font-size: 14px; font-weight: 600; color: #09090b; display: flex; align-items: center; gap: 8px; }
.section-card-title .ms { font-size: 18px; color: #9ca3af; }
.section-card-body { padding: 16px 20px; }

/* ===== FORM ===== */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 12px; font-weight: 500; color: #374151; margin-bottom: 6px; }
.form-input { width: 100%; font-family: inherit; font-size: 14px; color: #111827; border: 1px solid #e4e4e7; border-radius: 10px; padding: 10px 12px; outline: none; background: #fff; transition: border-color .15s, box-shadow .15s; }
.form-input:focus { border-color: #bef264; box-shadow: 0 0 0 3px rgba(190,242,100,.25); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* ===== MODAL ===== */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 100; align-items: center; justify-content: center; backdrop-filter: blur(2px); }
.modal-overlay.show { display: flex; }
.modal { background: #fff; border-radius: 20px; width: 540px; max-width: 92vw; padding: 28px; box-shadow: 0 20px 60px rgba(0,0,0,.2); max-height: 90vh; overflow-y: auto; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.modal-title { font-size: 20px; font-weight: 600; color: #09090b; }
.modal-close { cursor: pointer; color: #9ca3af; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; padding-top: 20px; border-top: 1px solid #f1f1f3; flex-wrap: wrap; }
.btn-cancel { cursor: pointer; background: transparent; color: #6b7280; border: none; font-family: inherit; font-size: 14px; font-weight: 500; padding: 10px 14px; border-radius: 12px; transition: all .15s; }
.btn-cancel:hover { background: #f4f4f5; color: #18181b; }

/* ===== TIMELINE ===== */
.timeline { display: flex; flex-direction: column; gap: 0; }
.timeline-item { display: flex; gap: 16px; padding: 14px 0; border-bottom: 1px solid #f9f9f9; }
.timeline-item:last-child { border-bottom: none; }
.timeline-dot { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex: none; margin-top: 2px; }
.timeline-dot-system { background: #f1f5f9; }
.timeline-dot-user { background: #f1fae3; }
.timeline-dot-warning { background: #fff5f5; }
.timeline-dot .ms { font-size: 16px; color: #9ca3af; }
.timeline-dot-user .ms { color: #166534; }
.timeline-dot-warning .ms { color: #b91c1c; }
.timeline-body { flex: 1; }
.timeline-text { font-size: 14px; color: #1f2937; line-height: 1.5; }
.timeline-meta { font-family: 'Manrope', sans-serif; font-size: 12px; color: #9ca3af; margin-top: 3px; }

/* ===== DEVICE ROW STATUS ===== */
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.status-dot-ok { background: #22c55e; }
.status-dot-soon { background: #f59e0b; }
.status-dot-overdue { background: #ef4444; }
tr.row-overdue td { background: #fff5f5 !important; }
tr.row-overdue:hover td { background: #fee2e2 !important; }
tr.row-soon td { background: #fffbeb !important; }
tr.row-soon:hover td { background: #fef3c7 !important; }

/* ===== KANBAN ===== */
.kanban { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 16px; }
.kanban-col { flex: none; width: 260px; display: flex; flex-direction: column; gap: 10px; }
.kanban-col-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-radius: 12px; background: #f4f4f5; margin-bottom: 4px; }
.kanban-col-title { font-size: 12px; font-weight: 600; letter-spacing: .06em; color: #52525b; }
.kanban-col-count { font-family: 'Manrope', sans-serif; font-size: 11px; font-weight: 700; color: #fff; border-radius: 99px; padding: 2px 8px; }
.kanban-card { background: #fff; border: 1px solid #e4e4e7; border-radius: 14px; padding: 16px; cursor: pointer; transition: all .15s; box-shadow: 0 1px 3px rgba(0,0,0,.04); }
.kanban-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.09); border-color: #d4d4d8; transform: translateY(-1px); }
.kanban-card-customer { font-size: 13px; font-weight: 600; color: #09090b; margin-bottom: 4px; }
.kanban-card-type { font-size: 12px; color: #6b7280; margin-bottom: 12px; line-height: 1.4; }
.kanban-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kanban-card-amount { font-family: 'Manrope', sans-serif; font-size: 14px; font-weight: 600; color: #09090b; }
.kanban-inspector { display: flex; align-items: center; gap: 5px; font-size: 12px; color: #9ca3af; }
.kanban-inspector .ms { font-size: 15px; }
.kanban-date { display: flex; align-items: center; gap: 4px; font-family: 'Manrope', sans-serif; font-size: 11px; color: #9ca3af; margin-top: 8px; }
.kanban-date .ms { font-size: 13px; }
.kanban-add { cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 11px; border: 1.5px dashed #d4d4d8; border-radius: 14px; color: #a1a1aa; font-size: 13px; transition: all .15s; }
.kanban-add:hover { border-color: #bef264; color: #52525b; background: #f9fafb; }
.kanban-add .ms { font-size: 18px; }

/* ===== CONTACT CARD ===== */
.contact-card { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid #f1f1f3; }
.contact-card:last-child { border-bottom: none; }
.contact-avatar { width: 40px; height: 40px; border-radius: 50%; background: #f1fae3; display: flex; align-items: center; justify-content: center; flex: none; }
.contact-avatar .ms { font-size: 20px; color: #166534; }
.contact-name { font-size: 14px; font-weight: 500; color: #09090b; }
.contact-role { font-size: 12px; color: #9ca3af; margin-top: 2px; }
.contact-links { display: flex; gap: 8px; margin-left: auto; }
.contact-link { display: flex; align-items: center; gap: 5px; font-size: 13px; color: #6b7280; text-decoration: none; transition: color .1s; }
.contact-link:hover { color: #09090b; }
.contact-link .ms { font-size: 17px; }
