.ea-page {
    background: var(--background);
    color: var(--text-primary);
}

.ea-main {
    min-width: 0;
    padding-bottom: 60px;
}

.ea-header {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: flex-start;
    margin-bottom: 20px;
}

.ea-header h1 {
    display: flex;
    align-items: center;
    gap: 11px;
    margin: 0;
    color: var(--text-primary);
    font-size: 1.8rem;
    font-weight: 800;
}

.ea-header h1 i { color: var(--primary); }
.ea-header p { margin: 7px 0 0; color: var(--text-secondary); }

.ea-company-chip {
    flex: 0 0 auto;
    min-width: 210px;
    padding: 12px 15px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(15, 23, 42, .04);
}

.ea-company-chip span {
    display: block;
    margin-bottom: 4px;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .7px;
    text-transform: uppercase;
}

.ea-company-chip strong { color: #0f3b73; font-size: 13px; }
.ea-company-chip i { margin-right: 5px; }

.ea-toolbar {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 12px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 4px 18px rgba(15, 23, 42, .04);
    flex-wrap: wrap;
}

.ea-btn,
.ea-select-button,
.ea-icon-button,
.ea-view-switcher button,
.ea-link-button {
    border: 0;
    font: inherit;
    cursor: pointer;
}

.ea-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 39px;
    padding: 9px 13px;
    color: #334155;
    background: #fff;
    border: 1px solid #dbe2ea;
    border-radius: 9px;
    font-size: 12px;
    font-weight: 750;
    text-decoration: none;
    white-space: nowrap;
    transition: .18s ease;
}

.ea-btn:hover { border-color: #93b4df; color: var(--primary); transform: translateY(-1px); }
.ea-btn:disabled { opacity: .55; cursor: wait; transform: none; }
.ea-btn-primary { color: #fff; background: var(--primary); border-color: var(--primary); }
.ea-btn-primary:hover { color: #fff; background: #1d4ed8; }
.ea-btn-success { color: #fff; background: #15803d; border-color: #15803d; }
.ea-btn-danger { color: #b91c1c; border-color: #fecaca; background: #fff7f7; }

.ea-search {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1 1 230px;
    max-width: 360px;
}

.ea-search i { position: absolute; left: 12px; color: #94a3b8; }
.ea-search input {
    width: 100%;
    height: 39px;
    padding: 8px 12px 8px 34px;
    border: 1px solid #dbe2ea;
    border-radius: 9px;
    background: #f8fafc;
    outline: none;
}
.ea-search input:focus { border-color: #7da7db; box-shadow: 0 0 0 3px rgba(37, 99, 235, .08); }

.ea-filter-count {
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: #ef4444;
    border-radius: 9px;
    font-size: 9px;
}
.ea-filter-count:empty,
.ea-filter-count[data-count="0"] { display: none; }

.ea-select-button {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 39px;
    padding: 0 9px;
    color: #475569;
    background: #fff;
    border: 1px solid #dbe2ea;
    border-radius: 9px;
}
.ea-select-button select { max-width: 145px; border: 0; outline: 0; color: inherit; font-size: 11px; background: transparent; }

.ea-view-switcher {
    display: inline-flex;
    padding: 3px;
    background: #eef3f8;
    border-radius: 10px;
}
.ea-view-switcher button {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    min-height: 32px;
    padding: 6px 9px;
    color: #64748b;
    background: transparent;
    border-radius: 7px;
    font-size: 11px;
    font-weight: 750;
}
.ea-view-switcher button.active { color: #164e8f; background: #fff; box-shadow: 0 2px 7px rgba(15, 23, 42, .09); }

.ea-filters {
    margin-top: 12px;
    padding: 16px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 13px;
}

.ea-filter-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(130px, 1fr));
    gap: 12px;
}

.ea-filter-grid label,
.ea-form-grid label,
.ea-import-mode {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: #475569;
    font-size: 11px;
    font-weight: 750;
}

.ea-filter-grid select,
.ea-form-grid input,
.ea-form-grid select,
.ea-form-grid textarea,
.ea-inline-add input,
.ea-import-mode select,
.ea-section-heading input {
    min-width: 0;
    padding: 9px 10px;
    color: #1e293b;
    background: #fff;
    border: 1px solid #dbe2ea;
    border-radius: 8px;
    outline: none;
    font: inherit;
    font-weight: 500;
}
.ea-form-grid input:focus,
.ea-form-grid select:focus,
.ea-form-grid textarea:focus { border-color: #7da7db; box-shadow: 0 0 0 3px rgba(37, 99, 235, .07); }

.ea-filter-checks {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-top: 14px;
    padding-top: 13px;
    border-top: 1px solid #eef2f6;
    color: #475569;
    font-size: 12px;
}
.ea-filter-checks label { display: flex; gap: 6px; align-items: center; }
.ea-link-button { margin-left: auto; color: #b91c1c; background: transparent; font-size: 11px; font-weight: 750; }

.ea-loading { padding: 45px; text-align: center; color: #64748b; }
.ea-view { display: none; margin-top: 16px; }
.ea-view.active { display: block; }

.ea-group {
    margin-bottom: 14px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 13px;
    box-shadow: 0 3px 14px rgba(15, 23, 42, .035);
    overflow: hidden;
}
.ea-group-header {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 13px 15px;
    color: #1e293b;
    background: #fff;
    border: 0;
    cursor: pointer;
    text-align: left;
}
.ea-group-header:hover { background: #fbfdff; }
.ea-group-color { width: 7px; height: 27px; border-radius: 5px; }
.ea-group.open .ea-group-chevron { transform: rotate(90deg); }
.ea-group-chevron { color: #64748b; transition: .18s; }
.ea-group-name { font-size: 13px; font-weight: 850; letter-spacing: .15px; }
.ea-group-count { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 21px; padding: 0 6px; color: #475569; background: #eef2f7; border-radius: 10px; font-size: 10px; font-weight: 800; }
.ea-group-summary { margin-left: auto; color: #64748b; font-size: 10px; }
.ea-group-body { display: none; border-top: 1px solid #edf1f5; }
.ea-group.open .ea-group-body { display: block; }

.ea-table-scroll { overflow: auto; max-height: 62vh; }
.ea-table { width: max-content; min-width: 100%; border-collapse: separate; border-spacing: 0; font-size: 11px; }
.ea-table th {
    position: sticky;
    top: 0;
    z-index: 4;
    min-width: 125px;
    padding: 9px 10px;
    color: #526174;
    background: #f5f8fb;
    border-bottom: 1px solid #dfe6ee;
    border-right: 1px solid #e8edf3;
    font-size: 9px;
    font-weight: 850;
    letter-spacing: .35px;
    text-transform: uppercase;
    text-align: left;
    resize: horizontal;
    overflow: hidden;
}
.ea-table th:first-child,
.ea-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 3;
    min-width: 210px;
    max-width: 260px;
}
.ea-table th:first-child { z-index: 6; }
.ea-table td {
    height: 47px;
    padding: 6px 10px;
    color: #334155;
    background: #fff;
    border-bottom: 1px solid #edf1f5;
    border-right: 1px solid #f0f3f7;
    vertical-align: middle;
}
.ea-table tr:hover td { background: #f7fbff; }
.ea-table tr:hover td:first-child { background: #f7fbff; }
.ea-row-reference { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.ea-row-reference strong { display: block; color: #0f3b73; font-size: 11px; }
.ea-row-reference small { display: block; margin-top: 2px; color: #94a3b8; font-size: 9px; }
.ea-urgency-dot { flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; box-shadow: 0 0 0 3px rgba(148, 163, 184, .13); }
.urgency-Bassa { background: #60a5fa; }
.urgency-Normale { background: #22c55e; }
.urgency-Alta { background: #f59e0b; }
.urgency-Urgente { background: #ef4444; }

.ea-description { max-width: 300px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ea-chip { display: inline-flex; align-items: center; padding: 4px 8px; border-radius: 999px; font-size: 9px; font-weight: 800; white-space: nowrap; }
.ea-status { color: #854d0e; background: #fef3c7; }
.ea-status-completed { color: #166534; background: #dcfce7; }
.ea-equipment { color: #5b21b6; background: #ede9fe; }
.ea-inline-select,
.ea-inline-input {
    min-width: 115px;
    max-width: 155px;
    padding: 5px 7px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    font: inherit;
    color: #334155;
}
.ea-inline-select:hover,
.ea-inline-input:hover,
.ea-inline-select:focus,
.ea-inline-input:focus { border-color: #c9d8e9; background: #fff; outline: 0; }
.ea-row-actions { position: relative; text-align: center; }
.ea-actions-button { width: 30px; height: 30px; color: #64748b; background: #f3f6f9; border: 0; border-radius: 7px; cursor: pointer; }
.ea-actions-menu {
    position: fixed;
    z-index: 120;
    min-width: 185px;
    max-height: min(360px, 70vh);
    overflow-y: auto;
    padding: 6px;
    background: #fff;
    border: 1px solid #dfe6ee;
    border-radius: 9px;
    box-shadow: 0 14px 35px rgba(15, 23, 42, .18);
}
.ea-actions-menu button { display: flex; width: 100%; gap: 8px; padding: 8px 9px; color: #334155; background: transparent; border: 0; border-radius: 6px; cursor: pointer; font-size: 11px; text-align: left; }
.ea-actions-menu button:hover { background: #f1f5f9; }
.ea-actions-menu .danger { color: #b91c1c; }
.ea-empty { padding: 70px 20px; text-align: center; color: #64748b; background: #fff; border: 1px dashed #cbd5e1; border-radius: 14px; }
.ea-empty i { color: #9eb6d1; font-size: 34px; }
.ea-empty h2 { margin: 14px 0 5px; color: #334155; font-size: 18px; }
.ea-empty p { margin: 0; }

.ea-panel {
    padding: 18px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 13px;
    box-shadow: 0 3px 14px rgba(15, 23, 42, .035);
}
.ea-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 15px; }
.ea-section-heading h2 { margin: 0; color: #1e293b; font-size: 15px; }
.ea-section-heading p { margin: 4px 0 0; color: #8492a4; font-size: 10px; }
.ea-calendar-layout { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(250px, .8fr); gap: 14px; }
.ea-agenda-day { margin-bottom: 16px; }
.ea-agenda-day h3 { margin: 0 0 8px; padding-bottom: 7px; color: #475569; border-bottom: 1px solid #e9eef4; font-size: 11px; text-transform: capitalize; }
.ea-agenda-item,
.ea-mini-item {
    display: grid;
    grid-template-columns: 55px 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 9px 10px;
    margin-bottom: 6px;
    background: #f8fafc;
    border-left: 3px solid #3b82f6;
    border-radius: 7px;
    cursor: pointer;
}
.ea-agenda-item:hover, .ea-mini-item:hover { background: #eff6ff; }
.ea-agenda-item time { color: #0f3b73; font-size: 11px; font-weight: 850; }
.ea-agenda-item strong, .ea-mini-item strong { display: block; color: #24364b; font-size: 11px; }
.ea-agenda-item small, .ea-mini-item small { color: #7b8a9d; font-size: 9px; }
.ea-mini-item { grid-template-columns: 1fr auto; border-left-color: #ef4444; }

.ea-technician-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.ea-technician-card { padding: 17px; background: #fff; border: 1px solid var(--border); border-radius: 13px; }
.ea-technician-card header { display: flex; align-items: center; gap: 10px; margin-bottom: 13px; }
.ea-avatar { width: 38px; height: 38px; display: grid; place-items: center; color: #1d4ed8; background: #dbeafe; border-radius: 50%; font-weight: 850; }
.ea-technician-card h3 { margin: 0; font-size: 13px; }
.ea-technician-card header p { margin: 3px 0 0; color: #8492a4; font-size: 9px; }
.ea-tech-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin-bottom: 12px; }
.ea-tech-stat { padding: 7px 4px; text-align: center; background: #f7f9fc; border-radius: 7px; }
.ea-tech-stat strong { display: block; color: #173b65; font-size: 13px; }
.ea-tech-stat span { color: #8492a4; font-size: 8px; text-transform: uppercase; }

.ea-kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 12px; margin-bottom: 14px; }
.ea-kpi { padding: 17px; background: #fff; border: 1px solid var(--border); border-radius: 12px; }
.ea-kpi i { float: right; width: 32px; height: 32px; display: grid; place-items: center; color: #2563eb; background: #eff6ff; border-radius: 8px; }
.ea-kpi strong { display: block; color: #172a40; font-size: 24px; }
.ea-kpi span { color: #718096; font-size: 10px; font-weight: 700; }
.ea-dashboard-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 14px; }
.ea-distribution-row { display: grid; grid-template-columns: 130px 1fr 30px; gap: 8px; align-items: center; margin-bottom: 9px; font-size: 10px; }
.ea-distribution-bar { height: 7px; background: #edf2f7; border-radius: 5px; overflow: hidden; }
.ea-distribution-bar span { display: block; height: 100%; background: #3b82f6; border-radius: 5px; }

.ea-overlay {
    position: fixed;
    inset: 0;
    z-index: 199;
    background: rgba(15, 23, 42, .35);
    backdrop-filter: blur(1px);
}
.ea-drawer {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 200;
    width: min(760px, 94vw);
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: #f7f9fc;
    box-shadow: -12px 0 40px rgba(15, 23, 42, .18);
    transform: translateX(105%);
    transition: transform .24s ease;
}
.ea-drawer.open { transform: translateX(0); }
.ea-drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 21px;
    color: #fff;
    background: linear-gradient(135deg, #123d6a, #1f5e9d);
}
.ea-drawer-header h2 { margin: 3px 0 0; font-size: 18px; }
.ea-eyebrow { font-size: 9px; font-weight: 850; letter-spacing: 1px; opacity: .75; }
.ea-icon-button { width: 34px; height: 34px; display: grid; place-items: center; color: inherit; background: rgba(255,255,255,.13); border-radius: 8px; }
.ea-drawer > form { display: flex; flex: 1; min-height: 0; flex-direction: column; overflow-y: auto; }
.ea-form-section { margin: 14px 17px 0; padding: 17px; background: #fff; border: 1px solid #e3e9f0; border-radius: 11px; }
.ea-form-section h3 { display: flex; align-items: center; gap: 7px; margin: 0 0 15px; color: #153f6b; font-size: 11px; letter-spacing: .45px; text-transform: uppercase; }
.ea-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.ea-form-grid textarea { resize: vertical; }
.ea-span-2 { grid-column: span 2; }
.ea-checkbox-field { flex-direction: row !important; align-items: center; align-self: end; min-height: 37px; }
.ea-checkbox-field input { min-width: auto; }
.ea-drawer-footer {
    position: sticky;
    bottom: 0;
    display: flex;
    justify-content: flex-end;
    gap: 9px;
    margin-top: 15px;
    padding: 14px 17px;
    background: rgba(255, 255, 255, .96);
    border-top: 1px solid #dfe6ee;
}
.ea-related-tabs { display: flex; gap: 4px; margin-bottom: 12px; border-bottom: 1px solid #e5eaf0; }
.ea-related-tabs button { padding: 8px 10px; color: #64748b; background: transparent; border: 0; border-bottom: 2px solid transparent; cursor: pointer; font-size: 10px; font-weight: 800; }
.ea-related-tabs button.active { color: #1d4ed8; border-color: #2563eb; }
.ea-related-tabs span { padding: 1px 5px; background: #edf2f7; border-radius: 7px; }
.ea-related-panel { display: none; }
.ea-related-panel.active { display: block; }
.ea-related-list { display: grid; gap: 6px; }
.ea-related-item { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 9px 10px; background: #f8fafc; border-radius: 7px; font-size: 10px; }
.ea-related-item strong { color: #334155; }
.ea-related-item small { color: #8492a4; }
.ea-inline-add { display: flex; gap: 7px; margin-top: 9px; }
.ea-inline-add input { flex: 1; }
.ea-timeline { border-left: 2px solid #dbe6f2; margin-left: 6px; padding-left: 16px; }
.ea-timeline-item { position: relative; margin-bottom: 12px; }
.ea-timeline-item::before { content: ""; position: absolute; left: -21px; top: 3px; width: 8px; height: 8px; background: #3b82f6; border: 2px solid #fff; border-radius: 50%; }
.ea-timeline-item strong { display: block; color: #334155; font-size: 10px; }
.ea-timeline-item small { color: #8492a4; font-size: 9px; }

.ea-modal {
    width: min(650px, 92vw);
    max-height: 88vh;
    padding: 0;
    color: #1e293b;
    background: #fff;
    border: 0;
    border-radius: 14px;
    box-shadow: 0 25px 70px rgba(15, 23, 42, .28);
}
.ea-modal::backdrop { background: rgba(15, 23, 42, .43); backdrop-filter: blur(1px); }
.ea-modal header,
.ea-modal footer { display: flex; justify-content: space-between; align-items: center; padding: 15px 18px; }
.ea-modal header { color: #fff; background: linear-gradient(135deg, #123d6a, #1f5e9d); }
.ea-modal header h2 { margin: 3px 0 0; font-size: 17px; }
.ea-modal footer { justify-content: flex-end; gap: 8px; border-top: 1px solid #e7ecf1; }
.ea-modal-body { padding: 18px; max-height: 62vh; overflow-y: auto; }
.ea-dropzone { display: flex; min-height: 145px; flex-direction: column; align-items: center; justify-content: center; gap: 7px; color: #64748b; background: #f8fafc; border: 2px dashed #b9c9dc; border-radius: 11px; cursor: pointer; text-align: center; }
.ea-dropzone:hover { color: #1d4ed8; border-color: #60a5fa; background: #eff6ff; }
.ea-dropzone i { color: #16a34a; font-size: 32px; }
.ea-dropzone strong { color: #334155; font-size: 12px; }
.ea-dropzone span { font-size: 10px; }
.ea-import-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 14px 0; }
.ea-import-stat { padding: 10px; background: #f1f5f9; border-radius: 8px; text-align: center; }
.ea-import-stat strong { display: block; color: #174778; font-size: 18px; }
.ea-import-stat span { color: #718096; font-size: 9px; }
.ea-preview-table { max-height: 240px; overflow: auto; border: 1px solid #e5eaf0; border-radius: 8px; }
.ea-preview-table table { width: 100%; border-collapse: collapse; font-size: 9px; }
.ea-preview-table th { position: sticky; top: 0; padding: 7px; color: #526174; background: #f1f5f9; text-align: left; }
.ea-preview-table td { padding: 7px; border-top: 1px solid #edf1f5; }
.ea-import-mode { margin-top: 13px; }

.ea-toast {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 300;
    max-width: 360px;
    padding: 12px 16px;
    color: #fff;
    background: #1e293b;
    border-radius: 9px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, .24);
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: .2s;
    font-size: 12px;
}
.ea-toast.show { opacity: 1; transform: translateY(0); }
.ea-toast.success { background: #166534; }
.ea-toast.error { background: #991b1b; }

@media (max-width: 1250px) {
    .ea-view-switcher span { display: none; }
    .ea-filter-grid { grid-template-columns: repeat(3, 1fr); }
    .ea-kpi-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 850px) {
    .ea-main { padding: 18px 12px; }
    .ea-header { flex-direction: column; }
    .ea-company-chip { width: 100%; }
    .ea-search { max-width: none; order: 5; flex-basis: 100%; }
    .ea-filter-grid { grid-template-columns: repeat(2, 1fr); }
    .ea-calendar-layout,
    .ea-dashboard-grid { grid-template-columns: 1fr; }
    .ea-table-scroll { overflow: visible; max-height: none; }
    .ea-table, .ea-table tbody { display: block; width: 100%; }
    .ea-table thead { display: none; }
    .ea-table tr {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 7px;
        padding: 12px;
        border-bottom: 1px solid #e5eaf0;
    }
    .ea-table td {
        display: block;
        height: auto;
        padding: 2px;
        border: 0;
        background: transparent !important;
    }
    .ea-table td:first-child { position: static; max-width: none; grid-column: 1 / -1; }
    .ea-table td:nth-child(2),
    .ea-table td:nth-child(5),
    .ea-table td:nth-child(8),
    .ea-table td:nth-child(9),
    .ea-table td:nth-child(11),
    .ea-table td:nth-child(13),
    .ea-table td:nth-child(14) { display: none; }
    .ea-row-actions { grid-column: 2; justify-self: end; }
}

@media (max-width: 560px) {
    .ea-header h1 { font-size: 1.35rem; }
    .ea-toolbar > .ea-btn,
    .ea-select-button { flex: 1 1 45%; }
    .ea-view-switcher { width: 100%; }
    .ea-view-switcher button { flex: 1; justify-content: center; }
    .ea-filter-grid,
    .ea-form-grid { grid-template-columns: 1fr; }
    .ea-span-2 { grid-column: span 1; }
    .ea-filter-checks { flex-wrap: wrap; }
    .ea-link-button { margin-left: 0; width: 100%; text-align: left; }
    .ea-kpi-grid { grid-template-columns: 1fr 1fr; }
    .ea-drawer { width: 100vw; }
    .ea-form-section { margin-inline: 10px; padding: 13px; }
}
