/* =============================================
   GREEN WASH CRM – Estilos principales
   Mobile-first, diseño moderno
   ============================================= */

:root {
    --green-50:  #f0fdf4;
    --green-100: #dcfce7;
    --green-200: #bbf7d0;
    --green-400: #4ade80;
    --green-500: #22c55e;
    --green-600: #16a34a;
    --green-700: #15803d;
    --green-800: #166534;
    --green-900: #14532d;

    --gray-50:  #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;

    --sidebar-width: 280px;
    --topbar-height: 60px;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,.10), 0 1px 2px rgba(0,0,0,.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
    --shadow-lg: 0 10px 15px rgba(0,0,0,.10), 0 4px 6px rgba(0,0,0,.05);

    --transition: 0.25s cubic-bezier(.4,0,.2,1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; }

body {
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--gray-50);
    color: var(--gray-800);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
img, svg, iframe { max-width: 100%; height: auto; display: block; }

/* ── LAYOUT ─────────────────────────────── */
.app-wrapper { display: flex; flex-direction: column; min-height: 100vh; }

/* ── TOPBAR ──────────────────────────────── */
.topbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--topbar-height);
    background: var(--green-700);
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 12px;
    z-index: 100;
    box-shadow: var(--shadow-md);
}

.hamburger {
    background: none; border: none; cursor: pointer;
    display: flex; flex-direction: column; gap: 5px; padding: 6px;
}
.hamburger span {
    display: block; width: 22px; height: 2px;
    background: #fff; border-radius: 2px;
    transition: var(--transition);
}

.topbar-brand {
    display: flex; align-items: center; gap: 8px;
    flex: 1;
}
.brand-icon { font-size: 1.3rem; }
.brand-name { color: #fff; font-size: 1.1rem; font-weight: 700; letter-spacing: -0.3px; }

.topbar-user {
    display: flex; align-items: center; gap: 8px;
}
.user-avatar {
    width: 34px; height: 34px;
    background: var(--green-500); color: #fff;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-weight: 600; font-size: 0.85rem;
}
.user-name-short { color: #fff; font-size: 0.85rem; display: none; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}
[hidden] {
    display: none !important;
}
/* ── SIDEBAR ──────────────────────────────── */
.sidebar {
    position: fixed;
    top: 0; left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    height: 100dvh;
    background: var(--gray-900);
    transform: translateX(-100%);
    transition: transform var(--transition);
    z-index: 500;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

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

.sidebar-header {
    display: flex; align-items: center; gap: 10px;
    padding: 18px 16px;
    background: var(--green-800);
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
    min-height: var(--topbar-height);
}
.sidebar-close {
    margin-left: auto;
    background: none; border: none; color: #fff;
    font-size: 1rem; cursor: pointer; padding: 4px 8px;
}

.sidebar-user {
    display: flex; align-items: center; gap: 12px;
    padding: 16px;
    background: rgba(255,255,255,.04);
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.user-avatar-lg {
    width: 42px; height: 42px;
    background: var(--green-600); color: #fff;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 1rem; flex-shrink: 0;
}
.user-fullname { color: #fff; font-size: 0.9rem; font-weight: 600; }
.user-role { color: var(--gray-400); font-size: 0.75rem; margin-top: 2px; }

/* NAV LIST */
.nav-list {
    list-style: none;
    padding: 8px 0 calc(120px + env(safe-area-inset-bottom, 0px));
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scroll-padding-bottom: calc(120px + env(safe-area-inset-bottom, 0px));
}

.nav-section-label {
    padding: 14px 16px 4px;
    color: var(--gray-500);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.nav-item a {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 16px;
    color: var(--gray-300);
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 0;
    transition: background var(--transition), color var(--transition);
    position: relative;
}
.nav-item a:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-item.active a {
    background: var(--green-700);
    color: #fff;
}
.nav-item.active a::before {
    content: '';
    position: absolute; left: 0; top: 0; bottom: 0;
    width: 3px; background: var(--green-400);
    border-radius: 0 2px 2px 0;
}

.nav-icon { font-size: 1rem; width: 20px; text-align: center; }

.badge-soon {
    margin-left: auto;
    background: var(--gray-700); color: var(--gray-400);
    font-size: 0.65rem; padding: 2px 7px; border-radius: 99px;
    font-weight: 600;
}

.nav-disabled a { opacity: .5; cursor: not-allowed; pointer-events: none; }

.sidebar-footer {
    padding: 12px 16px calc(22px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid rgba(255,255,255,.08);
    background: var(--gray-900);
    position: sticky;
    bottom: 0;
    z-index: 1;
}
.btn-logout {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 14px;
    width: 100%;
    background: rgba(255,255,255,.06);
    color: var(--gray-300);
    border: 0;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-family: inherit;
    font-weight: 500;
    transition: background var(--transition);
    text-align: left;
    cursor: pointer;
}
.btn-logout:hover { background: rgba(239,68,68,.15); color: #fca5a5; }

.business-date-picker { position: relative; }
.business-date-picker-input { cursor: pointer; }
.business-date-picker-calendar {
    position: fixed;
    z-index: 200;
    width: min(320px, calc(100vw - 16px));
    max-height: min(360px, calc(100vh - 16px));
    overflow-y: auto;
    padding: 12px;
    border: 1px solid var(--gray-300);
    border-radius: 12px;
    background: #fff;
    box-shadow: var(--shadow-md);
}
.business-date-picker-calendar[hidden] { display: none; }
.business-date-picker-header,
.business-date-picker-week,
.business-date-picker-days {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 4px;
    text-align: center;
}
.business-date-picker-header { grid-template-columns: 40px 1fr 40px; align-items: center; margin-bottom: 8px; }
.business-date-picker-calendar button {
    min-height: 36px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--gray-900);
    font: inherit;
}
.business-date-picker-calendar button:enabled { cursor: pointer; }
.business-date-picker-calendar button:enabled:hover { background: var(--green-50); }
.business-date-picker-calendar button:disabled { color: var(--gray-400); cursor: not-allowed; }
.business-date-picker-calendar .business-date-picker-week span { padding: 4px 0; color: var(--gray-500); font-size: 12px; font-weight: 700; }
.business-date-picker-calendar .business-date-picker-day[aria-selected="true"] { background: var(--green-700); color: #fff; font-weight: 700; }

/* OVERLAY */
.overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 150;
    backdrop-filter: blur(1px);
}
.overlay.visible { display: block; }

/* ── MAIN CONTENT ──────────────────────────── */
.main-content {
    margin-top: var(--topbar-height);
    padding: 20px 16px 32px;
    flex: 1;
    min-height: calc(100vh - var(--topbar-height));
}

/* ── PAGE HEADER ──────────────────────────── */
.page-header {
    margin-bottom: 20px;
}
.page-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--gray-900);
    display: flex; align-items: center; gap: 8px;
}
.page-subtitle {
    color: var(--gray-500);
    font-size: 0.85rem;
    margin-top: 2px;
}

/* ── CARDS ──────────────────────────── */
.card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.card-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--gray-100);
    display: flex; align-items: center; gap: 8px;
}
.card-header h3 { font-size: 0.95rem; font-weight: 600; }
.videollamadas-header { flex-wrap: wrap; }
.videollamadas-header-title,
.videollamadas-calendar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}
.videollamadas-header-title { min-width: max-content; }
.videollamadas-calendar-actions {
    margin-left: auto;
    justify-content: flex-end;
}
#googleCalendarStatus {
    color: #475569;
    font-size: 12px;
    text-align: right;
}
#openControlModal { margin-left: 0; }
.card-body { padding: 16px; }

.login-logo-img{
    display: block;
    width: min(90px, 100%);
    max-width: 100%;
    height: auto;
    margin: 0 auto;
}

.login-logo-img2{
    display: block;
    width: 50px;
    max-width: 14vw;
    max-height: 42px;
    height: auto;
    object-fit: contain;
}
/* ── STATS GRID ──────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}
.stat-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
    display: flex; flex-direction: column;
    gap: 4px;
}
.stat-card .stat-icon { font-size: 1.5rem; margin-bottom: 4px; }
.stat-card .stat-value { font-size: 1.6rem; font-weight: 700; color: var(--gray-900); }
.stat-card .stat-label { font-size: 0.75rem; color: var(--gray-500); font-weight: 500; }
.stat-card.green { border-left: 3px solid var(--green-500); }
.stat-card.blue  { border-left: 3px solid #3b82f6; }
.stat-card.orange{ border-left: 3px solid #f97316; }
.stat-card.purple{ border-left: 3px solid #a855f7; }

/* ── EXPEDIENTE CARDS ──────────────────────── */
.exp-list { display: flex; flex-direction: column; gap: 10px; }

.exp-card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 14px 16px;
    display: flex; flex-direction: column; gap: 6px;
    border-left: 4px solid var(--green-400);
    transition: box-shadow var(--transition), transform var(--transition);
    cursor: pointer;
}
.exp-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}
.exp-card.internacional { border-left-color: #3b82f6; }
.exp-card.nacional      { border-left-color: var(--green-500); }

.exp-print-action { margin-top: 4px; }
.print-expediente-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 40px;
    padding: 8px 13px;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    background: #f0fdf4;
    color: #166534;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}
.print-expediente-btn:hover { background: #dcfce7; }
.modal-note-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 10px;
}
.modal-note-actions > .print-expediente-btn,
.modal-note-actions > button {
    flex: 0 1 auto;
    min-width: 0;
    justify-content: center;
    padding: 9px 8px;
    text-align: center;
    white-space: normal;
}

.exp-card-header {
    display: flex; justify-content: space-between; align-items: flex-start;
}
.exp-name { font-weight: 600; font-size: 0.95rem; color: var(--gray-900); }
.exp-date { font-size: 0.72rem; color: var(--gray-400); white-space: nowrap; }

.exp-card-meta {
    display: flex; flex-wrap: wrap; gap: 6px;
    margin-top: 2px;
}
.badge {
    display: inline-flex; align-items: center;
    padding: 2px 8px;
    border-radius: 99px;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
}
.badge-green  { background: var(--green-100); color: var(--green-800); }
.badge-blue   { background: #dbeafe; color: #1e40af; }
.badge-gray   { background: var(--gray-100); color: var(--gray-600); }
.badge-orange { background: #ffedd5; color: #9a3412; }
.badge-purple { background: #f3e8ff; color: #6b21a8; }
.exp-modality-row {
    display: flex;
    align-items: center;
    gap: 7px;
    max-width: 100%;
}
.exp-modality-row .exp-modality {
    width: auto;
    min-width: 0;
    flex: 0 1 auto;
}
.exp-markers {
    position: relative;
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 4px;
}
.exp-active-markers { display: inline-flex; align-items: center; gap: 4px; }
.exp-marker-menu {
    position: absolute;
    z-index: 5;
    top: calc(100% + 5px);
    right: 0;
    display: flex;
    gap: 4px;
    padding: 5px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 5px 14px rgb(15 23 42 / 14%);
}
.exp-marker-add {
    display: inline-grid;
    width: 30px;
    height: 30px;
    padding: 0;
    place-items: center;
    border: 1px dashed #9ca3af;
    border-radius: 8px;
    background: #fff;
    color: #6b7280;
    font: inherit;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
}
.exp-marker-add:hover { border-color: #16834b; color: #16834b; }
.exp-marker-add:focus-visible { outline: 2px solid #16834b; outline-offset: 2px; }
.exp-marker {
    display: inline-grid;
    width: 36px;
    height: 36px;
    padding: 0;
    place-items: center;
    border: 1px solid #d1d5db;
    border-radius: 9px;
    background: #fff;
    color: #9ca3af;
    font: inherit;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
}
.exp-marker:hover { background: #f9fafb; color: #4b5563; }
.exp-marker:focus-visible { outline: 2px solid #16834b; outline-offset: 2px; }
.exp-marker:disabled { cursor: wait; opacity: .6; }
.exp-marker-important.is-active { border-color: #facc15; background: #fef9c3; color: #a16207; }
.exp-marker-call.is-active { border-color: #fca5a5; background: #fef2f2; color: #dc2626; }
.exp-marker-economic.is-active { border-color: #86efac; background: #f0fdf4; color: #15803d; }
.exp-marker:not(.is-active) { color: #6b7280; }
.exp-modality {
    --modality-bg: #f8fafc;
    --modality-border: #cbd5e1;
    --modality-accent: #475569;
    --modality-text: #1e293b;
    --modality-label: #334155;
    display: flex;
    align-items: center;
    gap: 11px;
    width: fit-content;
    max-width: 100%;
    padding: 9px 14px 9px 11px;
    border: 1px solid var(--modality-border);
    border-left: 4px solid var(--modality-accent);
    border-radius: 10px;
    background: var(--modality-bg);
    color: var(--modality-text);
    box-shadow: 0 2px 5px rgb(15 23 42 / 6%);
}
.exp-modality-parking-subterraneo {
    --modality-bg: #eff6ff;
    --modality-border: #bfdbfe;
    --modality-accent: #2563eb;
    --modality-text: #1e3a8a;
    --modality-label: #1d4ed8;
}
.exp-modality-modelo-taller {
    --modality-bg: #fffbeb;
    --modality-border: #fde68a;
    --modality-accent: #d97706;
    --modality-text: #78350f;
    --modality-label: #b45309;
}
.exp-modality-parking-superficie {
    --modality-bg: #ecfdf5;
    --modality-border: #a7f3d0;
    --modality-accent: #059669;
    --modality-text: #064e3b;
    --modality-label: #047857;
}
.exp-modality-parking-lowcost {
    --modality-bg: #f5f3ff;
    --modality-border: #ddd6fe;
    --modality-accent: #7c3aed;
    --modality-text: #4c1d95;
    --modality-label: #6d28d9;
}
.exp-modality-industrial-local {
    --modality-bg: #f1f5f9;
    --modality-border: #cbd5e1;
    --modality-accent: #475569;
    --modality-text: #1e293b;
    --modality-label: #334155;
}
.exp-modality-icon {
    display: grid;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    place-items: center;
    border-radius: 9px;
    background: #fff;
    box-shadow: inset 0 0 0 1px var(--modality-border);
    font-size: 1.15rem;
    line-height: 1;
}
.exp-modality-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.exp-modality-label {
    color: var(--modality-label);
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    line-height: 1;
    text-transform: uppercase;
}
.exp-modality-name { font-size: 0.95rem; font-weight: 800; line-height: 1.2; overflow-wrap: anywhere; }

.exp-comment {
    font-size: 0.8rem;
    color: var(--gray-500);
    margin-top: 2px;
    overflow: hidden;
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.exp-admin-note-card {
    padding: 7px 10px;
    border-left: 3px solid #7c3aed;
    border-radius: 6px;
    background: #f5f3ff;
    color: #5b21b6;
    font-size: 0.78rem;
    overflow-wrap: anywhere;
}

.exp-contact {
    display: flex; flex-wrap: wrap; gap: 10px;
    font-size: 0.78rem; color: var(--gray-600);
}
.exp-contact span { display: flex; align-items: center; gap: 4px; }
.exp-contact a:hover,
.modal-value a:hover { text-decoration: underline; }

/* ── SEARCH & FILTER BAR ──────────────────── */
.search-bar {
    display: flex; gap: 8px;
    margin-bottom: 16px;
}
.search-input {
    flex: 1;
    padding: 10px 14px;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-family: inherit;
    outline: none;
    background: #fff;
    transition: border-color var(--transition);
}
.search-input:focus { border-color: var(--green-500); }

.filter-btn {
    padding: 10px 14px;
    background: var(--green-600); color: #fff;
    border: none; border-radius: var(--radius-sm);
    cursor: pointer; font-size: 0.9rem;
    display: flex; align-items: center; gap: 6px;
    font-family: inherit; font-weight: 500;
    transition: background var(--transition);
    white-space: nowrap;
}
.filter-btn:hover { background: var(--green-700); }

.search-btn {
    padding: 10px 14px;
    background: var(--green-600); color: #fff;
    border: none; border-radius: var(--radius-sm);
    cursor: pointer; font-size: 0.9rem;
    font-family: inherit; font-weight: 500;
    transition: background var(--transition);
    white-space: nowrap;
}
.search-btn:hover { background: var(--green-700); }

/* FILTER PANEL */
.filter-panel {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
    margin-bottom: 16px;
    display: none;
}
.filter-panel.open { display: block; }
.filter-panel .filter-row {
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.filter-group label {
    display: block; font-size: 0.78rem; font-weight: 600;
    color: var(--gray-600); margin-bottom: 4px;
}
.filter-group select, .filter-group input {
    width: 100%; padding: 8px 10px;
    border: 1.5px solid var(--gray-200); border-radius: var(--radius-sm);
    font-size: 0.85rem; font-family: inherit; outline: none;
    background: #fff;
    transition: border-color var(--transition);
}
.filter-group select:focus, .filter-group input:focus {
    border-color: var(--green-500);
}
.filter-actions { margin-top: 12px; display: flex; gap: 8px; justify-content: flex-end; }
.btn-sm {
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.82rem; font-weight: 600;
    cursor: pointer; border: none; font-family: inherit;
    transition: background var(--transition);
}
.btn-primary { background: var(--green-600); color: #fff; }
.btn-primary:hover { background: var(--green-700); }
.btn-secondary { background: var(--gray-100); color: var(--gray-700); }
.btn-secondary:hover { background: var(--gray-200); }
.btn-danger { background: #dc2626; color: #fff; }
.btn-danger:hover { background: #b91c1c; }

/* ── TABS ──────────────────────────────────── */
.tabs {
    display: flex; gap: 4px;
    background: var(--gray-100);
    padding: 4px; border-radius: var(--radius);
    margin-bottom: 16px;
}
.tab-btn {
    flex: 1; padding: 8px 12px;
    background: none; border: none;
    border-radius: 8px;
    font-size: 0.82rem; font-weight: 600;
    cursor: pointer; font-family: inherit;
    color: var(--gray-500);
    transition: background var(--transition), color var(--transition);
}
.tab-btn.active { background: #fff; color: var(--green-700); box-shadow: var(--shadow); }

/* ── LOAD MORE ─────────────────────────────── */
.load-more-wrap { text-align: center; margin-top: 20px; }
.btn-load-more {
    padding: 12px 28px;
    background: #fff;
    border: 1.5px solid var(--green-500);
    color: var(--green-700);
    border-radius: var(--radius);
    font-size: 0.9rem; font-weight: 600;
    cursor: pointer; font-family: inherit;
    display: inline-flex; align-items: center; gap: 8px;
    transition: background var(--transition), color var(--transition);
}
.btn-load-more:hover { background: var(--green-50); }
.btn-load-more:disabled { opacity: .5; cursor: not-allowed; }

/* ── EMPTY STATE ─────────────────────────── */
.empty-state {
    text-align: center; padding: 48px 20px;
    color: var(--gray-400);
}
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 12px; }
.empty-state p { font-size: 0.9rem; }

/* ── TABLA (instituciones) ─────────────────── */
.table-scroll { overflow-x: auto; }
.data-table {
    width: 100%; border-collapse: collapse;
    font-size: 0.82rem;
}
.data-table th {
    background: var(--gray-50);
    padding: 10px 12px;
    text-align: left; font-weight: 600;
    color: var(--gray-600);
    border-bottom: 1px solid var(--gray-200);
    white-space: nowrap;
}
.data-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-700);
}
.data-table tr:hover td { background: var(--gray-50); }

/* ── DOCUMENTOS ─────────────────────────── */
.doc-section { margin-bottom: 24px; }
.doc-section-title {
    font-size: 1rem; font-weight: 700;
    margin-bottom: 12px; padding-bottom: 8px;
    border-bottom: 2px solid var(--green-500);
    display: flex; align-items: center; gap: 8px;
    color: var(--gray-800);
}
.doc-count { white-space: nowrap; }

.doc-admin-bar {
    display: flex;
    justify-content: flex-end;
    margin: 18px 0 16px;
}
.doc-upload-form {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    background: #fff;
    border: 1px solid #dfe7ee;
    border-radius: 12px;
    padding: 12px 14px;
    box-shadow: 0 4px 10px rgba(15,23,42,0.04);
    width: min(100%, 760px);
}
.doc-upload-form select,
.doc-upload-form input {
    border: 1px solid #d0d7de;
    border-radius: 8px;
    padding: 9px 10px;
    background: #fff;
    font: inherit;
    min-height: 40px;
}
.doc-upload-form select { min-width: 180px; }
.doc-upload-form input[type="file"] { flex: 1 1 220px; }

.doc-message {
    margin: 0 0 14px;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
}
.doc-message.success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}
.doc-message.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.doc-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.doc-card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 14px 16px;
    display: flex; align-items: center; gap: 12px;
}
.doc-icon { font-size: 2rem; flex-shrink: 0; }
.doc-info { flex: 1; min-width: 0; }
.doc-title { font-weight: 600; font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-meta { font-size: 0.75rem; color: var(--gray-400); margin-top: 2px; }
.doc-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
}
.doc-delete-form { display: inline-block; }
.doc-btn {
    padding: 7px 10px;
    border: none; border-radius: 8px;
    cursor: pointer; font-size: 0.78rem; font-weight: 600;
    font-family: inherit;
    transition: background var(--transition), transform var(--transition);
    display: inline-flex; align-items: center; justify-content: center; gap: 4px;
    text-decoration: none;
    line-height: 1.2;
    white-space: nowrap;
}
.doc-btn:hover { transform: translateY(-1px); }
.doc-btn-view { background: var(--green-100); color: var(--green-800); }
.doc-btn-view:hover { background: var(--green-200); }
.doc-btn-download { background: var(--gray-100); color: var(--gray-700); }
.doc-btn-download:hover { background: var(--gray-200); }
.doc-btn-upload { background: #16a34a; color: #fff; min-height: 40px; }
.doc-btn-upload:hover { background: #15803d; }
.doc-btn-delete { background: #dc2626; color: #fff; }
.doc-btn-delete:hover { background: #b91c1c; }

@media (max-width: 767px) {
    .videollamadas-header {
        align-items: stretch;
        gap: 10px;
    }
    .videollamadas-header-title {
        width: 100%;
        min-width: 0;
    }
    .videollamadas-calendar-actions {
        width: 100%;
        margin-left: 0;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }
    #googleCalendarStatus {
        grid-column: 1 / -1;
        text-align: left;
    }
    .videollamadas-calendar-actions .btn {
        width: 100%;
        min-width: 0;
        white-space: normal;
    }
    #openControlModal {
        width: 100%;
        white-space: normal;
    }
    .doc-admin-bar { justify-content: stretch; }
    .doc-upload-form {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }
    .doc-upload-form select,
    .doc-upload-form input,
    .doc-btn-upload {
        width: 100%;
    }
    .doc-section-title {
        align-items: flex-start;
        flex-wrap: wrap;
        line-height: 1.35;
    }
    .doc-count { margin-left: auto !important; }
    .doc-card {
        flex-wrap: wrap;
        align-items: flex-start;
        padding: 12px;
        gap: 8px 10px;
    }
    .doc-icon { font-size: 1.7rem; }
    .doc-info { padding-top: 2px; width: 100%; }
    .doc-title { white-space: normal; overflow-wrap: anywhere; }
    .doc-actions {
        width: 100%;
        justify-content: stretch;
        padding-top: 4px;
        border-top: 1px solid var(--gray-100);
    }
    .doc-actions > * {
        flex: 1 1 100%;
    }
    .doc-btn {
        width: 100%;
        min-height: 36px;
    }
    .modal-backdrop { padding: 10px; }
    .modal-header { padding: 12px 14px; }
    .modal-title { min-width: 0; overflow-wrap: anywhere; }
}

@media (max-width: 479px) {
    .doc-section-title {
        font-size: 0.95rem;
    }
    .doc-meta { font-size: 0.72rem; }
}

/* ── LOGIN PAGE ─────────────────────────── */
.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--green-800) 0%, var(--green-600) 50%, var(--green-700) 100%);
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
}
.login-card {
    background: #fff;
    border-radius: 20px;
    padding: 36px 28px;
    width: 100%; max-width: 380px;
    box-shadow: var(--shadow-lg);
}
.login-logo {
    text-align: center; margin-bottom: 28px;
}
.login-logo-icon { font-size: 3rem; display: block; }
.login-logo-title {
    font-size: 1.4rem; font-weight: 800;
    color: var(--green-700); margin-top: 8px; display: block;
}
.login-logo-sub { color: var(--gray-400); font-size: 0.82rem; }
.login-title { font-size: 1.05rem; font-weight: 700; margin-bottom: 20px; color: var(--gray-800); }

.form-group { margin-bottom: 16px; }
.form-group label {
    display: block; font-size: 0.82rem; font-weight: 600;
    color: var(--gray-600); margin-bottom: 6px;
}
.form-input {
    width: 100%; padding: 12px 14px;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 0.95rem; font-family: inherit;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.form-input:focus {
    border-color: var(--green-500);
    box-shadow: 0 0 0 3px rgba(34,197,94,.15);
}
.btn-full {
    width: 100%; padding: 13px;
    background: var(--green-600); color: #fff;
    border: none; border-radius: var(--radius-sm);
    font-size: 1rem; font-weight: 700;
    cursor: pointer; font-family: inherit;
    transition: background var(--transition), transform var(--transition);
    margin-top: 6px;
}
.btn-full:hover { background: var(--green-700); transform: translateY(-1px); }
.btn-full:active { transform: translateY(0); }

.alert {
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem; margin-bottom: 14px;
}
.alert-error { background: #fee2e2; color: #b91c1c; border: 1px solid #fca5a5; }
.alert-success { background: var(--green-100); color: var(--green-800); }

/* ── MODAL ──────────────────────────────── */
.modal-backdrop {
    display: flex;
    position: fixed; inset: 0;
    background: rgba(0,0,0,.6);
    z-index: 300;
    padding: 20px;
    overflow-y: auto;
    align-items: flex-start;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transition: opacity .2s;
}
.modal-backdrop.open,
.modal-backdrop[style*="flex"] {
    opacity: 1;
    pointer-events: all;
    visibility: visible;
}
.modal {
    background: #fff;
    border-radius: var(--radius);
    width: 100%; max-width: 540px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    margin: auto;
}
.modal-header {
    padding: 16px 18px;
    border-bottom: 1px solid var(--gray-100);
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 1;
    background: #fff;
}
.modal-title {
    min-width: 0;
    font-weight: 700;
    font-size: 1rem;
    line-height: 1.3;
    overflow-wrap: anywhere;
}
.modal-close {
    background: none; border: none; cursor: pointer;
    font-size: 1.2rem; color: #dc2626;
    padding: 4px 8px; border-radius: 6px;
    flex-shrink: 0;
    transition: background var(--transition);
}
.modal-close:hover { background: #fee2e2; color: #b91c1c; }
.modal-body { padding: 18px; }
.field {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
}
.field label {
    color: var(--gray-700);
    font-size: 0.9rem;
}
.field input,
.field select {
    width: 100%;
    min-width: 0;
    min-height: 40px;
    padding: 8px 10px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--gray-800);
    font: inherit;
    outline: none;
}
.field input:focus,
.field select:focus {
    border-color: var(--green-500);
    box-shadow: 0 0 0 3px rgba(34,197,94,.15);
}
.modal-row:last-child { border-bottom: none; }
.modal-label { font-size: 0.75rem; font-weight: 600; color: var(--gray-500); text-transform: uppercase; }
.modal-value { font-size: 0.9rem; color: var(--gray-800); }

.oport-detail-backdrop { align-items: center; }
.oport-detail-modal {
    max-width: 760px;
    max-height: min(88vh, 900px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.oport-detail-modal .modal-header { flex: 0 0 auto; padding: 16px 22px; }
.oport-detail-heading { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }
.oport-detail-heading > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.oport-detail-icon {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    border-radius: 12px;
    background: #eff6ff;
    font-size: 1.25rem;
}
.oport-detail-subtitle { color: #64748b; font-size: 0.72rem; }
.oport-detail-status {
    margin-left: auto;
    padding: 5px 10px;
    border-radius: 999px;
    background: #fff7ed;
    color: #c2410c;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
}
.oport-detail-body { min-height: 0; overflow-y: auto; padding: 18px 22px 22px; }
.oport-detail-section { margin: 0 0 18px; }
.oport-detail-section:last-child { margin-bottom: 0; }
.oport-detail-section h3 {
    margin: 0 0 9px;
    padding-bottom: 7px;
    border-bottom: 1px solid #e2e8f0;
    color: #334155;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.oport-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.oport-detail-field { min-width: 0; padding: 10px 12px; border: 1px solid #e8edf3; border-radius: 10px; background: #f8fafc; }
.oport-detail-label { display: block; margin-bottom: 4px; color: #64748b; font-size: 0.66rem; font-weight: 700; letter-spacing: 0.045em; text-transform: uppercase; }
.oport-detail-value { display: block; overflow-wrap: anywhere; color: #1e293b; font-size: 0.85rem; line-height: 1.45; }
.oport-detail-value[href] { color: #166534; text-decoration: none; }
.oport-detail-value[href]:hover { text-decoration: underline; }
.record-admin-note-editor textarea {
    display: block;
    width: 100%;
    min-height: 100px;
    box-sizing: border-box;
    resize: vertical;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #fff;
    color: #1e293b;
    font: inherit;
    font-size: 0.85rem;
}
.record-admin-note-editor textarea:focus { outline: 2px solid #bbf7d0; border-color: #16a34a; }
.record-admin-note-editor .btn-save-comment {
    margin-top: 9px;
    padding: 9px 14px;
    border: 0;
    border-radius: 8px;
    background: #0f766e;
    color: #fff;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
}
.record-admin-note-editor .btn-save-comment:hover { background: #115e59; }
.record-admin-note-editor .btn-save-comment:disabled { cursor: wait; opacity: 0.65; }
.record-admin-note-card { white-space: pre-wrap; }

.videollamadas-table {
    width: 100%;
    border-collapse: collapse;
}

/* ── RESPONSIVE ─────────────────────────── */
@media (min-width: 480px) {
    .doc-grid { grid-template-columns: repeat(2, 1fr); }
    .user-name-short { display: block; }
}

@media (max-width: 767px) {
    .videollamadas-table,
    .videollamadas-table tbody {
        display: block;
        width: 100%;
    }
    .videollamadas-table thead {
        display: none;
    }
    .videollamadas-table tbody tr {
        display: block;
        width: 100%;
        padding: 4px 12px;
        border: 1px solid var(--gray-200) !important;
        border-left: 3px solid var(--green-500) !important;
        border-radius: 10px;
        background: var(--green-50);
        box-shadow: 0 2px 5px rgba(15, 23, 42, .06);
    }
    .videollamadas-table tbody tr + tr {
        margin-top: 10px;
    }
    .videollamadas-table tbody td {
        display: grid;
        grid-template-columns: minmax(68px, .65fr) minmax(0, 1.35fr);
        align-items: start;
        gap: 10px;
        width: 100%;
        padding: 10px 0 !important;
        border-bottom: 1px solid var(--gray-100);
        overflow-wrap: anywhere;
    }
    .videollamadas-table tbody td:last-child {
        border-bottom: 0;
    }
    .videollamadas-table tbody td::before {
        content: attr(data-label);
        color: var(--gray-500);
        font-size: .68rem;
        font-weight: 700;
        letter-spacing: .04em;
        text-transform: uppercase;
    }
    .videollamadas-table .status-select {
        max-width: 100%;
    }
    .videollamadas-table [data-label="Acciones"] > div {
        align-items: stretch !important;
    }
    .videollamadas-table [data-label="Acciones"] .btn {
        width: 100%;
        white-space: normal;
        text-align: center;
    }
    .sidebar {
        width: min(82vw, 320px);
    }
    .main-content {
        padding: 18px 12px 28px;
    }
    .page-header {
        margin-bottom: 16px;
    }
    .page-title {
        font-size: 1.2rem;
        line-height: 1.35;
    }
    .search-bar {
        flex-wrap: wrap;
        align-items: stretch;
    }
    .search-input {
        flex: 1 1 100%;
        min-width: 0;
    }
    .search-btn,
    .filter-btn {
        flex: 1 1 0;
        justify-content: center;
    }
    .filter-panel .filter-row {
        grid-template-columns: 1fr;
    }
    .tabs {
        flex-wrap: wrap;
    }
    .tab-btn {
        flex: 1 1 calc(50% - 4px);
        min-width: 120px;
    }
    .stats-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
    .exp-card-header {
        flex-wrap: wrap;
        gap: 6px 8px;
    }
    .exp-name {
        min-width: 0;
        word-break: break-word;
    }
    .exp-date {
        margin-left: auto;
    }
    .exp-contact {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    .modal {
        width: min(100%, 540px);
    }
    .oport-detail-modal { width: min(100%, 540px); max-height: 92vh; }
    .oport-detail-modal .modal-header { padding: 13px 14px; }
    .oport-detail-body { padding: 14px; }
    .oport-detail-grid { grid-template-columns: 1fr; gap: 7px; }
    .oport-detail-icon { width: 36px; height: 36px; flex-basis: 36px; }
    .oport-detail-status { padding: 4px 7px; font-size: 0.65rem; }
    .modal-body {
        padding: 14px;
    }
    .btn-full {
        padding: 12px 14px;
    }
}

@media (max-width: 479px) {
    .topbar { padding-left: 8px; padding-right: 8px; gap: 6px; }
    .topbar-brand { gap: 5px; min-width: 0; }
    .brand-name { font-size: 1rem; }
    .login-logo-img2 { width: 42px; }
    .stats-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 6px;
    }
    .stat-card {
        min-width: 0;
        padding: 9px 6px;
        gap: 2px;
    }
    .stat-card .stat-icon {
        font-size: 1rem;
        margin-bottom: 1px;
    }
    .stat-card .stat-value { font-size: clamp(0.9rem, 4vw, 1.2rem); }
    .stat-card .stat-label {
        font-size: 0.58rem;
        line-height: 1.15;
        overflow-wrap: anywhere;
    }
    .filter-btn,
    .search-btn {
        width: 100%;
    }
    .search-bar {
        display: grid;
        grid-template-columns: 1fr auto;
        gap: 8px;
    }
    .search-input {
        grid-column: 1 / -1;
    }
    .filter-btn {
        grid-column: 1 / -1;
    }
    .card-body {
        padding: 12px !important;
    }
    .material-send-modal { width: min(100%, 540px); }
    .material-send-grid,
    .material-library-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .material-send-footer { align-items: stretch; }
    .material-send-total { margin-left: 0; }
}

@media (max-width: 360px) {
    .topbar { padding-left: 8px; padding-right: 8px; gap: 6px; }
    .topbar-brand { gap: 5px; min-width: 0; }
    .login-logo-img2 { width: 42px; }
    .brand-name { font-size: 0.9rem; }
    .user-name-short { display: none; }
    .modal-backdrop { padding: 10px; }
    .modal-header { padding: 12px 14px; }
    .modal-title { min-width: 0; overflow-wrap: anywhere; }
}

@media (min-width: 640px) {
    .stats-grid { grid-template-columns: repeat(4, 1fr); }
    .filter-panel .filter-row { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 768px) {
    .main-content { padding: 24px 28px 40px; }
    .page-title { font-size: 1.7rem; }
}

/* ── UTILIDADES ──────────────────────────── */
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.text-center { text-align: center; }
.hidden { display: none; }
.spinner {
    display: inline-block; width: 20px; height: 20px;
    border: 2px solid var(--gray-200);
    border-top-color: var(--green-600);
    border-radius: 50%;
    animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Skeleton loading */
.skeleton {
    background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 50%, var(--gray-100) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 6px;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ── Password toggle & Remember me ──────────────────────────── */
.password-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.password-wrap .form-input {
    padding-right: 44px;
    width: 100%;
}
.pwd-toggle {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray-400);
    padding: 4px;
    display: flex;
    align-items: center;
    transition: color .2s;
}
.pwd-toggle:hover { color: var(--green-600); }
.remember-row {
    display: flex;
    align-items: center;
    margin: 12px 0 4px;
}
.remember-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--gray-600);
    user-select: none;
}
.remember-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--green-600);
    cursor: pointer;
}

/* ── Email doc buttons ───────────────────────────────────────── */
.email-doc-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}
.btn-email-doc {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 20px;
    border: none;
    cursor: pointer;
    transition: all .18s;
    white-space: nowrap;
}
.btn-email-1doc { background: #dbeafe; color: #1d4ed8; }
.btn-email-1doc:hover { background: #bfdbfe; }
.btn-email-2doc { background: #d1fae5; color: #065f46; }
.btn-email-2doc:hover { background: #a7f3d0; }
.btn-email-pre  { background: #fef3c7; color: #92400e; }
.btn-email-pre:hover  { background: #fde68a; }
.btn-email-cont { background: #ede9fe; color: #5b21b6; }
.btn-email-cont:hover { background: #ddd6fe; }

/* ── Change estado inline ────────────────────────────────────── */
.estado-select-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}
.estado-select-wrap select {
    font-size: 0.75rem;
    padding: 4px 8px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    background: white;
    color: var(--gray-700);
    cursor: pointer;
}
.btn-change-estado {
    font-size: 0.72rem;
    padding: 4px 10px;
    background: var(--green-600);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: background .18s;
}
.btn-change-estado:hover { background: var(--green-700); }

/* ── Email modal ─────────────────────────────────────────────── */
.material-send-modal {
    display: flex;
    flex-direction: column;
    width: min(940px, 96vw);
    max-height: 90vh;
    padding: 0;
    overflow: hidden;
}
.material-send-recipient {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--gray-100);
    background: #f8fafc;
    font-size: .84rem;
}
.material-send-hint { flex-basis: 100%; color: var(--gray-500); font-size: .76rem; }
.material-send-library { min-height: 130px; padding: 16px; overflow-y: auto; }
.material-send-grid,
.material-library-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.material-send-item,
.material-library-item {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 9px;
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    background: #fff;
}
.material-send-item { cursor: pointer; }
.material-send-item:has(input:checked) { border-color: var(--green-600); box-shadow: 0 0 0 2px rgb(22 131 75 / 14%); }
.material-send-item input { align-self: flex-start; width: 18px; height: 18px; accent-color: var(--green-600); }
.material-send-preview,
.material-library-preview {
    width: 100%;
    height: 112px;
    object-fit: cover;
    border-radius: 7px;
    background: #f1f5f9;
}
.material-send-name,
.material-library-name { overflow-wrap: anywhere; color: var(--gray-800); font-size: .78rem; }
.material-send-size,
.material-library-details { color: var(--gray-500); font-size: .7rem; }
.material-send-empty,
.material-library-empty { padding: 20px 0; color: var(--gray-500); text-align: center; font-size: .85rem; }
.material-send-empty a,
.material-manage-link { color: var(--green-700); font-weight: 700; }
#materialSendStatus,
.material-upload-status { margin: 8px 0; color: var(--gray-600); font-size: .8rem; }
.material-send-footer {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 16px;
    border-top: 1px solid var(--gray-100);
}
.material-send-total { margin-left: auto; color: var(--gray-600); font-size: .76rem; }
.material-library-upload,
.material-library-list { margin-bottom: 16px; }
.material-field-label { display: block; margin-bottom: 6px; color: var(--gray-700); font-size: .82rem; font-weight: 700; }
.material-file-input { display: block; width: 100%; max-width: 520px; padding: 9px; border: 1px solid var(--gray-200); border-radius: 8px; background: #fff; }
.material-modalities { margin: 16px 0; padding: 12px; border: 1px solid var(--gray-200); border-radius: 9px; }
.material-modalities legend { padding: 0 5px; color: var(--gray-700); font-size: .8rem; font-weight: 700; }
.material-modalities p { margin: 0 0 10px; color: var(--gray-500); font-size: .76rem; }
.material-modality-options { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.material-modality-options label { display: flex; align-items: center; gap: 5px; font-size: .78rem; }
.material-library-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.material-library-tags span { padding: 3px 7px; border-radius: 99px; background: #f0fdfa; color: #0f766e; font-size: .66rem; font-weight: 700; }
.material-library-remove { align-self: flex-start; margin-top: auto; }
.material-library-count { margin-left: auto; color: var(--gray-400); font-size: .76rem; }
.email-preview-modal .modal { max-width: 640px; }
.email-preview-body { padding: 20px; max-height: 420px; overflow-y: auto; }
.email-preview-body iframe { width: 100%; height: 360px; border: 1px solid var(--gray-200); border-radius: 8px; }
.email-meta { display: flex; flex-direction: column; gap: 6px; padding: 16px 20px; border-bottom: 1px solid var(--gray-100); }
.email-meta-row { display: flex; gap: 8px; font-size: 0.8rem; }
.email-meta-label { font-weight: 600; color: var(--gray-500); min-width: 60px; }
.email-meta-val { color: var(--gray-800); }
.email-modal-footer { padding: 14px 20px; display: flex; justify-content: flex-end; gap: 10px; border-top: 1px solid var(--gray-100); }
.btn-send-email { background: var(--green-600); color: white; padding: 8px 20px; border-radius: 10px; border: none; font-weight: 600; cursor: pointer; font-size: 0.875rem; transition: background .18s; }
.btn-send-email:hover { background: var(--green-700); }
.btn-cancel-email { background: var(--gray-100); color: var(--gray-700); padding: 8px 20px; border-radius: 10px; border: none; font-weight: 600; cursor: pointer; font-size: 0.875rem; }
