/* ================================================
   ASEGURATE PERÚ — CRM app.css
   Matches website palette: deep charcoal + crimson
   Fonts: Playfair Display + DM Sans
   ================================================ */

:root {
    --deep-charcoal:    #1A1A1A;
    --charcoal-mid:     #2C2C2C;
    --accent-red:       #8B1A1A;
    --accent-red-light: #B22222;
    --accent-red-soft:  #f5e6e6;
    --off-white:        #F8F6F2;
    --border:           #E5E0D8;
    --mid-text:         #555555;
    --light-text:       #888888;
    --white:            #FFFFFF;
    --success:          #27AE60;
    --danger:           #C0392B;
    --sidebar-w:        260px;
    --topbar-h:         68px;
}

/* ------------------------------------------------ RESET */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
    height: 100%;
    overflow: hidden;          /* crm-layout is 100vh — no browser-level scroll */
    font-family: 'DM Sans', sans-serif;
    background: var(--off-white);
    color: var(--deep-charcoal);
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
img { display: block; max-width: 100%; }
svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ================================================
   LOGIN PAGE
   ================================================ */
.login-page {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
}

/* — Left branding panel — */
.login-left {
    background: var(--deep-charcoal);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 56px 64px;
    position: relative;
    overflow: hidden;
}

/* Subtle red glow in corner */
.login-left::before {
    content: '';
    position: absolute;
    bottom: -120px;
    left: -80px;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(139,26,26,0.18) 0%, transparent 70%);
    pointer-events: none;
}

/* Thin red top border */
.login-left::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent-red);
}

.login-branding {
    display: flex;
    flex-direction: column;
    gap: 64px;
}

.login-logo {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.login-logo-img {
    height: 56px;
    width: auto;
    object-fit: contain;
    object-position: left center;
    filter: brightness(0) invert(1);   /* white version */
    margin-bottom: 4px;
}

.login-logo h1 {
    font-family: 'DM Sans', sans-serif;
    font-size: 28px;
    font-weight: 300;
    color: white;
    letter-spacing: 0.5px;
    line-height: 1;
}

.login-logo h1 em {
    font-style: normal;
    color: var(--accent-red-light);
    font-weight: 500;
}

.login-tagline {
    font-size: 11px;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.3);
    font-weight: 400;
}

.login-intro h2 {
    font-family: 'Playfair Display', serif;
    font-size: 36px;
    font-weight: 700;
    color: white;
    line-height: 1.2;
    margin-bottom: 16px;
    letter-spacing: -0.5px;
}

.login-intro > p {
    color: rgba(255,255,255,0.5);
    font-size: 15px;
    line-height: 1.8;
    font-weight: 300;
    margin-bottom: 36px;
}

.login-features {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.login-features li {
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(255,255,255,0.65);
    font-size: 14px;
    font-weight: 300;
}

.login-features li svg {
    color: var(--accent-red-light);
    flex-shrink: 0;
    width: 18px;
    height: 18px;
}

.login-footer-left p {
    font-size: 12px;
    color: rgba(255,255,255,0.2);
    line-height: 1.6;
    font-weight: 300;
}

.login-contact {
    color: rgba(255,255,255,0.15) !important;
    font-size: 11px !important;
}

/* — Right form panel — */
.login-right {
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 56px;
    position: relative;
}

.login-form-wrapper {
    width: 100%;
    max-width: 420px;
}

.login-form-header {
    margin-bottom: 36px;
    padding-bottom: 28px;
    border-bottom: 1px solid var(--border);
}

.login-form-header h3 {
    font-family: 'Playfair Display', serif;
    font-size: 26px;
    font-weight: 700;
    color: var(--deep-charcoal);
    margin-bottom: 6px;
    letter-spacing: -0.3px;
}

.login-form-header p {
    color: var(--light-text);
    font-size: 14px;
    font-weight: 300;
}

/* — Form elements — */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11.5px;
    font-weight: 500;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--mid-text);
}

.form-label svg {
    width: 16px;
    height: 16px;
    color: var(--accent-red);
    flex-shrink: 0;
}

.form-control {
    width: 100%;
    padding: 13px 16px;
    border: 1px solid var(--border);
    background: var(--off-white);
    font-family: 'DM Sans', sans-serif;
    font-size: 14.5px;
    color: var(--deep-charcoal);
    border-radius: 0;
    outline: none;
    transition: border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
    -webkit-appearance: none;
}

.form-control::placeholder { color: #BDBDBD; font-weight: 300; }

.form-control:focus {
    border-color: var(--accent-red);
    background: white;
    box-shadow: 0 0 0 3px rgba(139,26,26,0.07);
}

.form-control.is-invalid {
    border-color: var(--danger);
    background: #fdf6f5;
}

.form-error {
    font-size: 12px;
    color: var(--danger);
    font-weight: 400;
}

/* Password wrapper */
.password-input-wrapper {
    position: relative;
}

.password-input-wrapper .form-control {
    padding-right: 48px;
}

.toggle-password {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 4px;
    color: var(--light-text);
    transition: color 0.2s;
    display: flex;
    align-items: center;
}

.toggle-password:hover { color: var(--accent-red); }
.toggle-password svg   { width: 17px; height: 17px; }

/* Checkbox row */
.form-checkbox {
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

.form-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent-red);
    flex-shrink: 0;
    cursor: pointer;
}

.form-checkbox label {
    font-size: 13.5px;
    color: var(--mid-text);
    font-weight: 300;
    cursor: pointer;
}

/* Submit */
.btn-login {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    background: var(--accent-red);
    color: white;
    border: none;
    padding: 15px 28px;
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    transition: background 0.3s ease;
    margin-top: 4px;
}

.btn-login svg { width: 17px; height: 17px; transition: transform 0.25s; }
.btn-login:hover { background: var(--accent-red-light); }
.btn-login:hover svg { transform: translateX(4px); }

/* Login footer */
.login-footer-form {
    margin-top: 32px;
    padding-top: 28px;
    border-top: 1px solid var(--border);
}

.login-help-text {
    font-size: 13px;
    color: var(--light-text);
    font-weight: 300;
    margin-bottom: 14px;
}

.login-support {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.login-support a {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--mid-text);
    transition: color 0.2s;
}

.login-support a svg { width: 15px; height: 15px; color: var(--accent-red); flex-shrink: 0; }
.login-support a:hover { color: var(--accent-red); }

/* Alerts */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    margin-bottom: 24px;
    font-size: 14px;
    font-weight: 300;
    line-height: 1.6;
    border-left: 3px solid;
}

.alert svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }

.alert-danger  { background: #fdf6f5; border-color: var(--danger);  color: #7B241C; }
.alert-danger svg { color: var(--danger); }
.alert-success { background: #f0faf4; border-color: var(--success); color: #1E8449; }
.alert-success svg { color: var(--success); }

.alert p { margin: 0; }


/* ================================================
   CRM LAYOUT  (sidebar + main)
   ================================================ */

:root {
    --sb-w:      252px;
    --topbar-h:  64px;
}

.crm-layout {
    display: flex;
    height: 100vh;             /* exact viewport — never taller */
    overflow: hidden;
    background: #F0EEE9;
}

/* ================================================
   SIDEBAR  — fits full height without scrolling
   ================================================ */
.crm-sidebar {
    width: var(--sb-w);
    background: #141414;
    position: fixed;
    left: 0; top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 200;
    border-right: 1px solid rgba(255,255,255,0.04);
}

/* Red top stripe */
.crm-sidebar::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: var(--accent-red);
}

/* --- Brand --- */
.sb-brand {
    padding: 22px 20px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
}

.sb-logo {
    height: 36px;
    width: auto;
    object-fit: contain;
    object-position: left;
    filter: brightness(0) invert(1);
    display: block;
    margin-bottom: 6px;
}

.sb-brand-text { display: none; }

.sb-brand-name {
    font-family: 'DM Sans', sans-serif;
    font-size: 17px;
    font-weight: 300;
    color: white;
    letter-spacing: 0.3px;
    display: block;
    margin-bottom: 6px;
}

.sb-brand-name em {
    font-style: normal;
    color: var(--accent-red-light);
    font-weight: 500;
}

.sb-crm-label {
    display: block;
    font-size: 9px;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.22);
    font-weight: 400;
}

/* --- Nav --- */
.sb-nav {
    flex: 1;
    padding: 10px 0;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
}
.sb-nav::-webkit-scrollbar { display: none; }

.sb-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 20px;
    color: rgba(255,255,255,0.5);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 400;
    letter-spacing: 0.1px;
    transition: color 0.18s, background 0.18s, border-color 0.18s;
    border-left: 2px solid transparent;
    position: relative;
}

.sb-link .sb-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    stroke-width: 1.75;
}

.sb-link:hover {
    color: rgba(255,255,255,0.88);
    background: rgba(255,255,255,0.04);
    border-left-color: rgba(178,34,34,0.35);
}

.sb-link--active {
    color: white !important;
    background: rgba(139,26,26,0.22) !important;
    border-left-color: var(--accent-red-light) !important;
    font-weight: 500;
}

/* Sub-links (config accordion) */
.sb-link--sub {
    padding-left: 44px;
    font-size: 13px;
}

/* Section label */
.sb-section-label {
    padding: 14px 20px 4px;
    font-size: 9.5px;
    font-weight: 500;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    gap: 8px;
}
.sb-section-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255,255,255,0.05);
}

/* Config group toggle button */
.sb-group-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 9px 20px;
    background: none;
    border: none;
    border-left: 2px solid transparent;
    color: rgba(255,255,255,0.5);
    font-family: 'DM Sans', sans-serif;
    font-size: 13.5px;
    font-weight: 400;
    cursor: pointer;
    transition: color 0.18s, background 0.18s;
}

.sb-group-toggle:hover {
    color: rgba(255,255,255,0.88);
    background: rgba(255,255,255,0.04);
}

.sb-group-toggle-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sb-group-toggle .sb-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    stroke-width: 1.75;
}

.sb-chevron {
    width: 14px;
    height: 14px;
    transition: transform 0.25s ease;
    stroke-width: 2;
    opacity: 0.5;
}

/* Accordion items */
.sb-group-items {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}
.sb-group-items.open {
    max-height: 300px;
}

/* --- Footer --- */
.sb-footer {
    padding: 14px 16px 16px;
    border-top: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
}

.sb-user {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.sb-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(139,26,26,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--accent-red-light);
    flex-shrink: 0;
    overflow: hidden;
}

.sb-user-avatar img { width: 100%; height: 100%; object-fit: cover; }

.sb-user-info { overflow: hidden; }

.sb-user-name {
    display: block;
    font-size: 12.5px;
    color: rgba(255,255,255,0.8);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sb-user-role {
    display: block;
    font-size: 11px;
    color: rgba(255,255,255,0.28);
    font-weight: 300;
    white-space: nowrap;
}

.sb-logout {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 12px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.07);
    color: rgba(255,255,255,0.45);
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sb-logout .sb-icon { width: 15px; height: 15px; stroke-width: 1.75; }

.sb-logout:hover {
    background: rgba(139,26,26,0.2);
    border-color: rgba(139,26,26,0.4);
    color: rgba(255,255,255,0.88);
}

/* ================================================
   MAIN CONTENT
   ================================================ */
.crm-main {
    margin-left: var(--sb-w);
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;             /* match parent — contained */
    overflow: hidden;          /* topbar fixed, content scrolls internally */
    min-width: 0;
}

/* ================================================
   TOP BAR
   ================================================ */
.crm-topbar {
    height: var(--topbar-h);
    background: white;
    border-bottom: 1px solid var(--border);
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 6px rgba(0,0,0,0.04);
    flex-shrink: 0;
}

.crm-topbar-title {
    font-family: 'Playfair Display', serif;
    font-size: 20px;
    font-weight: 700;
    color: var(--deep-charcoal);
    letter-spacing: -0.3px;
    margin: 0;
}

.crm-topbar-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.crm-topbar-user-info { text-align: right; }

.crm-topbar-name {
    display: block;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--deep-charcoal);
    line-height: 1.2;
}

.crm-topbar-role {
    display: block;
    font-size: 11.5px;
    color: var(--light-text);
    font-weight: 300;
}

.crm-topbar-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent-red-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--accent-red);
    flex-shrink: 0;
    overflow: hidden;
    border: 1.5px solid var(--border);
}

.crm-topbar-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ================================================
   CONTENT AREA
   ================================================ */
.crm-content {
    flex: 1;
    padding: 28px 32px;
    overflow-y: auto;          /* regular pages scroll vertically here */
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;             /* allow shrinking in flex chain */
}

/* Kanban page: board manages its own scroll — disable crm-content scroll */
.crm-content--kanban {
    overflow: hidden;
    padding-bottom: 0;         /* board handles its own bottom padding */
}

/* Alerts */
.crm-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 13px 16px;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 300;
    line-height: 1.6;
    border-left: 3px solid;
}
.crm-alert p { margin: 0; }
.crm-alert--success { background: #f0faf4; border-color: var(--success); color: #1E8449; }
.crm-alert--danger  { background: #fdf6f5; border-color: var(--danger);  color: #7B241C; }

/* ================================================
   DASHBOARD PAGE STYLES
   ================================================ */

/* Welcome bar */
.dash-welcome {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.dash-welcome-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--deep-charcoal);
    margin: 0 0 4px;
    letter-spacing: -0.4px;
}

.dash-welcome-sub {
    font-size: 13.5px;
    color: var(--light-text);
    font-weight: 300;
    margin: 0;
}

.dash-create-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--accent-red);
    color: white;
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.3px;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.2s;
    flex-shrink: 0;
}

.dash-create-btn:hover { background: var(--accent-red-light); }

/* Metric cards */
.dash-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.dash-card {
    background: white;
    border: 1px solid var(--border);
    padding: 22px 24px;
    position: relative;
    overflow: hidden;
    transition: box-shadow 0.25s, transform 0.25s;
    border-top: 2px solid transparent;
}

.dash-card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.07);
    transform: translateY(-2px);
}

.dash-card--red   { border-top-color: var(--accent-red); }
.dash-card--dark  { border-top-color: var(--deep-charcoal); }
.dash-card--green { border-top-color: var(--success); }

.dash-card-icon {
    position: absolute;
    top: 20px;
    right: 20px;
    opacity: 0.1;
}

.dash-card-label {
    font-size: 10.5px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--light-text);
    margin-bottom: 8px;
}

.dash-card-value {
    font-family: 'Playfair Display', serif;
    font-size: 36px;
    font-weight: 700;
    color: var(--deep-charcoal);
    line-height: 1;
    margin-bottom: 6px;
}

.dash-card-sub {
    font-size: 12px;
    color: var(--light-text);
    font-weight: 300;
}

/* Section */
.dash-section {
    background: white;
    border: 1px solid var(--border);
    padding: 24px 24px;
    margin-bottom: 16px;
}

.dash-section-title {
    font-family: 'Playfair Display', serif;
    font-size: 16px;
    font-weight: 700;
    color: var(--deep-charcoal);
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}

/* Quick action tiles */
.dash-actions-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.dash-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 20px 12px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    border: 1.5px solid;
}

.dash-action-icon {
    width: 22px;
    height: 22px;
    stroke-width: 1.75;
}

.dash-action-label { line-height: 1.2; text-align: center; }

.dash-action--primary {
    background: var(--accent-red);
    color: white;
    border-color: var(--accent-red);
}
.dash-action--primary:hover { background: var(--accent-red-light); border-color: var(--accent-red-light); }

.dash-action--outline-red {
    background: white;
    color: var(--accent-red);
    border-color: var(--accent-red);
}
.dash-action--outline-red:hover { background: var(--accent-red-soft); }

.dash-action--outline {
    background: white;
    color: var(--deep-charcoal);
    border-color: var(--border);
}
.dash-action--outline:hover { border-color: var(--accent-red); color: var(--accent-red); }

/* Config grid */
.dash-config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.dash-config-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 16px;
    border: 1px solid var(--border);
    background: var(--off-white);
    text-decoration: none;
    transition: all 0.2s;
    position: relative;
}

.dash-config-card::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0;
    width: 0; height: 2px;
    background: var(--accent-red);
    transition: width 0.3s;
}

.dash-config-card:hover {
    border-color: var(--accent-red);
    background: white;
}

.dash-config-card:hover::after { width: 100%; }

.dash-config-icon {
    width: 18px;
    height: 18px;
    color: var(--accent-red);
    flex-shrink: 0;
    stroke-width: 1.75;
    margin-top: 1px;
}

.dash-config-title {
    font-size: 13.5px;
    font-weight: 500;
    color: var(--deep-charcoal);
    margin-bottom: 3px;
}

.dash-config-desc {
    font-size: 12px;
    color: var(--light-text);
    font-weight: 300;
    margin: 0;
    line-height: 1.4;
}

/* ================================================
   GENERIC UTILITIES
   ================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 20px;
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary  { background: var(--accent-red); color: white; border-color: var(--accent-red); }
.btn-primary:hover { background: var(--accent-red-light); }
.btn-secondary { background: white; color: var(--deep-charcoal); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--accent-red); color: var(--accent-red); }
.btn-danger   { background: var(--danger); color: white; }
.btn-danger:hover { background: #a93226; }
.btn-sm { padding: 7px 14px; font-size: 12px; }
.btn-lg { padding: 13px 26px; font-size: 14px; }

/* Tables */
.table-wrap { overflow-x: auto; }

table.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }

.data-table thead { background: var(--deep-charcoal); }

.data-table th {
    padding: 12px 16px;
    text-align: left;
    color: rgba(255,255,255,0.75);
    font-size: 10.5px;
    font-weight: 500;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    white-space: nowrap;
}

.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--mid-text);
    font-weight: 300;
    vertical-align: middle;
}

.data-table tbody tr:hover { background: var(--off-white); }
.data-table td strong { color: var(--deep-charcoal); font-weight: 500; }

/* Badges */
.badge { display: inline-block; padding: 3px 9px; font-size: 11px; font-weight: 500; letter-spacing: 0.5px; }
.badge-red   { background: var(--accent-red-soft); color: var(--accent-red); }
.badge-green { background: #e8f8ee; color: #1E8449; }
.badge-gray  { background: #f0f0f0; color: #555; }

/* White card container */
.content-card { background: white; border: 1px solid var(--border); padding: 24px 28px; margin-bottom: 20px; }

/* ================================================
   RESPONSIVE
   ================================================ */
@media (max-width: 1024px) {
    .dash-grid-3     { grid-template-columns: repeat(2, 1fr); }
    .dash-actions-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .crm-sidebar { transform: translateX(-100%); transition: transform 0.3s; }
    .crm-sidebar.open { transform: translateX(0); }
    .crm-main { margin-left: 0; }
    .crm-content { padding: 20px 16px; }
    .crm-topbar { padding: 0 16px; }
    .dash-grid-3 { grid-template-columns: 1fr; }
    .dash-actions-grid { grid-template-columns: repeat(2, 1fr); }
    .login-page { grid-template-columns: 1fr; }
    .login-left { display: none; }
    .login-right { padding: 32px 24px; }
}

/* ================================================
   KANBAN BOARD  (imported from kanban.blade.php
   <style> block — duplicated here for reference)
   ================================================ */

.kb-board {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    overflow-x: auto;
    padding-bottom: 16px;
}

.kb-board::-webkit-scrollbar { height: 6px; }
.kb-board::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.kb-col {
    flex: 0 0 280px;
    display: flex;
    flex-direction: column;
    background: #ECEAE5;
    border: 1px solid var(--border);
    max-height: calc(100vh - var(--topbar-h) - 120px);
}

.kb-col-head {
    padding: 14px 16px 12px;
    border-bottom: 1px solid var(--border);
    background: white;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.kb-col-stripe { width: 3px; height: 18px; border-radius: 2px; flex-shrink: 0; }
.kb-col-title { font-size: 13px; font-weight: 600; color: var(--deep-charcoal); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kb-col-count { font-size: 11px; font-weight: 600; min-width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; background: var(--off-white); border: 1px solid var(--border); color: var(--mid-text); border-radius: 20px; padding: 0 6px; }

.kb-drop-zone { flex: 1; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 8px; transition: background 0.15s; min-height: 60px; }
.kb-drop-zone.kb-drag-over { background: rgba(139,26,26,0.05); outline: 1.5px dashed rgba(139,26,26,0.35); outline-offset: -4px; }

.kb-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 28px 12px; color: #bbb; font-size: 12.5px; font-weight: 300; text-align: center; pointer-events: none; }
.kb-empty svg { width: 28px; height: 28px; opacity: 0.3; stroke: currentColor; fill: none; stroke-width: 1.5; }

.kb-card { background: white; border: 1px solid var(--border); border-left: 3px solid transparent; padding: 12px 14px; cursor: grab; user-select: none; transition: box-shadow 0.2s, transform 0.15s; position: relative; }
.kb-card:active { cursor: grabbing; }
.kb-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,0.09); transform: translateY(-1px); }
.kb-card.kb-dragging { opacity: 0.4; transform: rotate(1.5deg) scale(0.98); }
.kb-ghost { background: rgba(139,26,26,0.06); border: 1.5px dashed rgba(139,26,26,0.3); height: 70px; pointer-events: none; flex-shrink: 0; }

.kb-card-name { font-size: 13.5px; font-weight: 600; color: var(--deep-charcoal); margin-bottom: 6px; line-height: 1.3; }
.kb-card-meta { display: flex; flex-direction: column; gap: 3px; margin-bottom: 10px; }
.kb-card-meta-row { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--light-text); font-weight: 300; }
.kb-card-meta-row i { width: 12px; height: 12px; flex-shrink: 0; stroke-width: 2; }
.kb-card-footer { display: flex; align-items: center; justify-content: space-between; padding-top: 8px; border-top: 1px solid var(--border); }
.kb-card-date { font-size: 11px; color: #bbb; font-weight: 300; }
.kb-card-link { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 500; color: var(--accent-red); text-decoration: none; }
.kb-card-link:hover { color: var(--accent-red-light); }
.kb-card-badge { display: inline-block; font-size: 10px; font-weight: 500; letter-spacing: 0.8px; text-transform: uppercase; padding: 2px 7px; background: var(--off-white); border: 1px solid var(--border); color: var(--mid-text); margin-bottom: 8px; }

.kb-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.kb-toolbar-left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.kb-search { display: flex; align-items: center; gap: 8px; background: white; border: 1px solid var(--border); padding: 8px 12px; min-width: 220px; transition: border-color 0.2s; }
.kb-search:focus-within { border-color: var(--accent-red); }
.kb-search i { width: 15px; height: 15px; color: var(--light-text); stroke-width: 2; flex-shrink: 0; }
.kb-search input { border: none; outline: none; font-family: 'DM Sans', sans-serif; font-size: 13.5px; color: var(--deep-charcoal); background: transparent; width: 100%; }
.kb-filter-select { background: white; border: 1px solid var(--border); padding: 8px 28px 8px 12px; font-family: 'DM Sans', sans-serif; font-size: 13.5px; color: var(--deep-charcoal); outline: none; cursor: pointer; transition: border-color 0.2s; appearance: none; }
.kb-filter-select:focus { border-color: var(--accent-red); }
.kb-total-badge { font-size: 12.5px; color: var(--light-text); font-weight: 300; }
.kb-total-badge strong { color: var(--deep-charcoal); font-weight: 600; }

.kb-toast { position: fixed; bottom: 28px; right: 28px; background: var(--deep-charcoal); color: white; padding: 12px 18px; font-size: 13.5px; font-weight: 400; display: flex; align-items: center; gap: 10px; z-index: 9999; box-shadow: 0 8px 24px rgba(0,0,0,0.2); transform: translateY(80px); opacity: 0; transition: transform 0.3s cubic-bezier(0.16,1,0.3,1), opacity 0.3s ease; pointer-events: none; min-width: 260px; max-width: 360px; }
.kb-toast.kb-toast--show { transform: translateY(0); opacity: 1; }
.kb-toast.kb-toast--success { border-left: 3px solid var(--success); }
.kb-toast.kb-toast--error   { border-left: 3px solid var(--danger); }
.kb-card-saving::after { content: ''; position: absolute; inset: 0; background: rgba(255,255,255,0.7); }

/* ================================================
   LEADS PAGES — shared styles
   index, create, edit, show, analytics, convert
   ================================================ */

/* ---- Page header row ---- */
.pg-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.pg-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--deep-charcoal);
    margin: 0;
    letter-spacing: -0.3px;
    line-height: 1.2;
}

.pg-subtitle {
    font-size: 13.5px;
    color: var(--light-text);
    font-weight: 300;
    margin: 4px 0 0;
}

.pg-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--mid-text);
    text-decoration: none;
    margin-bottom: 18px;
    transition: color 0.2s;
}

.pg-back-link:hover { color: var(--accent-red); }
.pg-back-link i { width: 15px; height: 15px; stroke-width: 2; }

/* ---- White panel ---- */
.pg-panel {
    background: white;
    border: 1px solid var(--border);
    margin-bottom: 16px;
}

.pg-panel-head {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
}

.pg-panel-head i { width: 16px; height: 16px; color: var(--accent-red); stroke-width: 1.75; flex-shrink: 0; }

.pg-panel-title {
    font-family: 'Playfair Display', serif;
    font-size: 15px;
    font-weight: 700;
    color: var(--deep-charcoal);
    margin: 0;
}

.pg-panel-body { padding: 24px; }
.pg-panel-body--sm { padding: 16px 24px; }

/* ---- Field grid ---- */
.pg-field-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.pg-field-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
.pg-field-grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; }

/* ---- Read-only field (show page) ---- */
.pg-field { margin-bottom: 0; }

.pg-field-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--light-text);
    margin-bottom: 4px;
    display: block;
}

.pg-field-value {
    font-size: 14px;
    color: var(--deep-charcoal);
    font-weight: 400;
    line-height: 1.5;
}

.pg-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 20px 0;
}

/* ---- Status badge ---- */
.pg-status-badge {
    display: inline-block;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: white;
}

/* ---- Priority badge ---- */
.pg-priority {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 500;
    padding: 3px 8px;
    border-width: 1px;
    border-style: solid;
}

.pg-priority--high   { background: #fdf1f1; color: var(--danger);  border-color: #f5c6c6; }
.pg-priority--medium { background: #fff8e6; color: #856404;        border-color: #ffe08a; }
.pg-priority--low    { background: #f0faf4; color: var(--success); border-color: #b7dfca; }

/* ---- Converted badge ---- */
.pg-converted-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #f0faf4;
    color: var(--success);
    border: 1px solid #b7dfca;
    font-size: 11.5px;
    font-weight: 600;
    padding: 4px 10px;
    letter-spacing: 0.3px;
}

/* ---- Form section heading ---- */
.frm-section {
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.frm-section:last-of-type { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

.frm-section-title {
    font-family: 'Playfair Display', serif;
    font-size: 15px;
    font-weight: 700;
    color: var(--deep-charcoal);
    margin: 0 0 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
}

.frm-section-title i { width: 15px; height: 15px; color: var(--accent-red); stroke-width: 1.75; }

.frm-group { display: flex; flex-direction: column; gap: 6px; }

.frm-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--mid-text);
}

.frm-required { color: var(--accent-red); margin-left: 2px; }

.frm-input,
.frm-select,
.frm-textarea {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid var(--border);
    background: var(--off-white);
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    color: var(--deep-charcoal);
    border-radius: 0;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    appearance: none;
    -webkit-appearance: none;
}

.frm-input:focus,
.frm-select:focus,
.frm-textarea:focus {
    border-color: var(--accent-red);
    background: white;
    box-shadow: 0 0 0 3px rgba(139,26,26,0.06);
}

.frm-input.is-invalid,
.frm-select.is-invalid,
.frm-textarea.is-invalid { border-color: var(--danger); background: #fdf6f5; }

.frm-error { font-size: 12px; color: var(--danger); font-weight: 400; }

.frm-textarea { resize: vertical; min-height: 90px; }

.frm-select-wrap { position: relative; }

.frm-select-wrap .frm-select { padding-right: 34px; }

.frm-select-wrap::after {
    content: '';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid var(--mid-text);
    pointer-events: none;
}

.frm-actions {
    display: flex;
    gap: 10px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    margin-top: 24px;
}

/* Radio / Checkbox groups */
.frm-radio-group { display: flex; gap: 20px; flex-wrap: wrap; }

.frm-radio-label,
.frm-check-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: var(--mid-text);
    font-weight: 300;
}

.frm-radio-label input,
.frm-check-label input { accent-color: var(--accent-red); width: 15px; height: 15px; cursor: pointer; }

/* ---- Filter bar (index) ---- */
.filter-bar {
    background: white;
    border: 1px solid var(--border);
    padding: 20px 24px;
    margin-bottom: 16px;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

.filter-actions { display: flex; gap: 8px; }

/* ---- Data table ---- */
.leads-table-wrap {
    background: white;
    border: 1px solid var(--border);
    overflow-x: auto;
}

.leads-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }

.leads-table thead { background: var(--deep-charcoal); }

.leads-table th {
    padding: 12px 16px;
    text-align: left;
    color: rgba(255,255,255,0.75);
    font-size: 10.5px;
    font-weight: 500;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    white-space: nowrap;
}

.leads-table td {
    padding: 13px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--mid-text);
    vertical-align: middle;
}

.leads-table tbody tr:hover { background: var(--off-white); }

.leads-table td strong { color: var(--deep-charcoal); font-weight: 500; }

.leads-table-actions { display: flex; align-items: center; gap: 8px; justify-content: center; }

.tbl-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 500;
    padding: 5px 10px;
    text-decoration: none;
    border: 1px solid;
    transition: all 0.2s;
    cursor: pointer;
    background: none;
    font-family: 'DM Sans', sans-serif;
}

.tbl-action-btn--view   { color: var(--accent-red);  border-color: var(--accent-red);  }
.tbl-action-btn--view:hover { background: var(--accent-red-soft); }
.tbl-action-btn--edit   { color: var(--mid-text);    border-color: var(--border); }
.tbl-action-btn--edit:hover { border-color: var(--accent-red); color: var(--accent-red); }
.tbl-action-btn i { width: 12px; height: 12px; stroke-width: 2; }

.leads-table-pagination { padding: 14px 20px; border-top: 1px solid var(--border); background: white; }

/* Assigned user chips */
.assigned-chip {
    display: inline-block;
    font-size: 11px;
    font-weight: 400;
    padding: 2px 8px;
    background: var(--accent-red-soft);
    border: 1px solid rgba(139,26,26,0.15);
    color: var(--accent-red);
}

/* ---- SHOW page sidebar ---- */
.show-layout { display: grid; grid-template-columns: 1fr 320px; gap: 16px; align-items: start; }

.show-sidebar-field {
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.show-sidebar-field:last-child { border-bottom: none; }

/* Activity timeline */
.activity-timeline { border-left: 2px solid var(--border); padding-left: 18px; }

.activity-item {
    position: relative;
    padding-bottom: 18px;
}

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

.activity-item::before {
    content: '';
    position: absolute;
    left: -24px;
    top: 4px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-red);
    border: 2px solid white;
    box-shadow: 0 0 0 1px var(--accent-red);
}

.activity-title {
    font-size: 13.5px;
    font-weight: 500;
    color: var(--deep-charcoal);
    margin: 0 0 2px;
}

.activity-desc {
    font-size: 13px;
    color: var(--mid-text);
    font-weight: 300;
    margin: 0 0 2px;
    line-height: 1.5;
}

.activity-time {
    font-size: 11px;
    color: #bbb;
    font-weight: 300;
}

/* Note item */
.note-item {
    background: var(--off-white);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent-red);
    padding: 14px 16px;
    margin-bottom: 10px;
}

.note-item:last-child { margin-bottom: 0; }

.note-author {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--deep-charcoal);
    margin-bottom: 2px;
}

.note-time { font-size: 11px; color: #bbb; font-weight: 300; }

.note-content {
    font-size: 13.5px;
    color: var(--mid-text);
    font-weight: 300;
    line-height: 1.65;
    margin-top: 8px;
}

/* File attachment */
.attachment-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 14px;
    border: 1px solid var(--border);
    background: var(--off-white);
    margin-bottom: 8px;
}

.attachment-info { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.attachment-info i { width: 16px; height: 16px; color: var(--accent-red); flex-shrink: 0; stroke-width: 1.75; }
.attachment-name { font-size: 13px; font-weight: 500; color: var(--deep-charcoal); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.attachment-meta { font-size: 11px; color: #bbb; font-weight: 300; }

/* ---- Analytics ---- */
.analytics-metric {
    background: white;
    border: 1px solid var(--border);
    padding: 22px 24px;
    position: relative;
    border-top: 2px solid var(--accent-red);
}

.analytics-metric-label {
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--light-text);
    margin-bottom: 8px;
}

.analytics-metric-value {
    font-family: 'Playfair Display', serif;
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--accent-red);
    line-height: 1;
}

.analytics-status-item {
    padding: 14px 16px;
    border-left: 3px solid;
    background: var(--off-white);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.analytics-status-name { font-size: 13.5px; color: var(--mid-text); font-weight: 300; }
.analytics-status-count { font-family: 'Playfair Display', serif; font-size: 22px; font-weight: 700; color: var(--deep-charcoal); line-height: 1; }

.analytics-source-item {
    padding: 14px 16px;
    background: white;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.analytics-source-name { font-size: 13.5px; color: var(--mid-text); font-weight: 300; }
.analytics-source-count { font-family: 'Playfair Display', serif; font-size: 22px; font-weight: 700; color: var(--accent-red); line-height: 1; }

/* ---- Convert page ---- */
.convert-wrap { max-width: 640px; margin: 0 auto; }

.convert-lead-info {
    background: rgba(139,26,26,0.04);
    border: 1px solid rgba(139,26,26,0.15);
    border-left: 3px solid var(--accent-red);
    padding: 18px 20px;
    margin-bottom: 24px;
}

.convert-info-row {
    display: flex;
    gap: 12px;
    padding: 7px 0;
    border-bottom: 1px solid rgba(139,26,26,0.08);
    font-size: 13.5px;
}

.convert-info-row:last-child { border-bottom: none; }

.convert-info-label { font-weight: 500; color: var(--mid-text); min-width: 130px; flex-shrink: 0; }
.convert-info-value { color: var(--deep-charcoal); font-weight: 300; }

.convert-warning {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-left: 3px solid #f59e0b;
    padding: 14px 16px;
    margin-bottom: 24px;
    font-size: 13.5px;
    color: #78350f;
    font-weight: 300;
    line-height: 1.6;
}

.convert-warning i { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; color: #f59e0b; stroke-width: 2; }

/* ---- Responsive ---- */
@media (max-width: 1024px) {
    .show-layout { grid-template-columns: 1fr; }
    .pg-field-grid-3 { grid-template-columns: 1fr 1fr; }
    .pg-field-grid-4 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
    .pg-field-grid-2,
    .pg-field-grid-3,
    .pg-field-grid-4 { grid-template-columns: 1fr; }
    .filter-grid { grid-template-columns: 1fr; }
    .pg-header { flex-direction: column; align-items: flex-start; }
    .frm-actions { flex-direction: column; }
    .frm-actions .btn { width: 100%; justify-content: center; }
}

/* ================================================
   POLICIES PAGES — shared styles
   index, create, edit, show (with tabs)
   ================================================ */

/* ---- Tab navigation ---- */
.tab-nav {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border);
    margin-bottom: 20px;
    background: white;
    border: 1px solid var(--border);
    border-bottom: none;
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 14px 22px;
    font-size: 13.5px;
    font-weight: 400;
    color: var(--mid-text);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    transition: all 0.18s;
    position: relative;
    top: 1px;
    white-space: nowrap;
}

.tab-btn i { width: 15px; height: 15px; stroke-width: 1.75; flex-shrink: 0; }

.tab-btn:hover { color: var(--deep-charcoal); background: var(--off-white); }

.tab-btn.tab-active {
    color: var(--accent-red);
    font-weight: 500;
    border-bottom-color: var(--accent-red);
    background: white;
}

.tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: var(--off-white);
    border: 1px solid var(--border);
    color: var(--mid-text);
    font-size: 10px;
    font-weight: 600;
    border-radius: 9px;
}

.tab-btn.tab-active .tab-badge {
    background: var(--accent-red-soft);
    border-color: rgba(139,26,26,0.2);
    color: var(--accent-red);
}

/* Tab pane */
.tab-pane { display: none; }
.tab-pane.tab-pane--active { display: block; }

/* ---- Policy status badge ---- */
.pol-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11.5px;
    font-weight: 600;
    padding: 4px 10px;
    letter-spacing: 0.3px;
}

.pol-status--active   { background: #F0FAF4; color: var(--success); border: 1px solid #B7DFCA; }
.pol-status--inactive { background: #FDF6F5; color: var(--danger);  border: 1px solid #F5C6C6; }
.pol-status--expiring { background: #FFFBEB; color: #92400E;         border: 1px solid #FDE68A; }

.pol-status i { width: 12px; height: 12px; stroke-width: 2.5; }

/* ---- Policy hero (show page header) ---- */
.pol-hero {
    background: var(--deep-charcoal);
    padding: 28px 32px;
    /* No negative margins — show page uses crm-content--no-pad so hero
       bleeds full width naturally without clipping issues.              */
    margin: 0;
    position: relative;
    overflow: hidden;
}

/* Show page: removes crm-content padding so hero is flush edge-to-edge */
.crm-content--no-pad {
    padding: 0 !important;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* Wrapper for all content BELOW the hero on show pages */
.pol-content-wrap {
    padding: 20px 32px 32px;
    flex: 1;
}

.pol-hero::before {
    content: '';
    position: absolute;
    right: -80px; bottom: -80px;
    width: 300px; height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(139,26,26,0.18) 0%, transparent 70%);
    pointer-events: none;
}

.pol-hero::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: var(--accent-red);
}

.pol-hero-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

.pol-hero-num {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.35);
    margin-bottom: 6px;
}

.pol-hero-title {
    font-family: 'Playfair Display', serif;
    font-size: 26px;
    font-weight: 700;
    color: white;
    margin: 0 0 10px;
    line-height: 1.2;
}

.pol-hero-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.pol-hero-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: rgba(255,255,255,0.55);
    font-weight: 300;
}

.pol-hero-meta-item i { width: 13px; height: 13px; stroke-width: 2; }

.pol-hero-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

/* ---- Cert card ---- */
.cert-card {
    border: 1px solid var(--border);
    background: white;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.cert-card::before {
    content: '';
    position: absolute;
    left: 0; top: 0;
    width: 3px; height: 0;
    background: var(--accent-red);
    transition: height 0.3s;
}

.cert-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.07); transform: translateY(-1px); }
.cert-card:hover::before { height: 100%; }

.cert-card-head {
    padding: 14px 18px 12px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.cert-card-num {
    font-family: 'Playfair Display', serif;
    font-size: 15px;
    font-weight: 700;
    color: var(--deep-charcoal);
}

.cert-card-body { padding: 14px 18px; }

.cert-field { margin-bottom: 10px; }
.cert-field:last-child { margin-bottom: 0; }
.cert-field-label { font-size: 10px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; color: var(--light-text); margin-bottom: 3px; }
.cert-field-value { font-size: 13.5px; color: var(--deep-charcoal); font-weight: 400; }

.cert-card-foot {
    padding: 10px 18px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 8px;
    background: var(--off-white);
}

/* ---- Doc list item ---- */
.doc-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 13px 16px;
    border: 1px solid var(--border);
    background: var(--off-white);
    margin-bottom: 8px;
    transition: background 0.18s;
}

.doc-item:last-child { margin-bottom: 0; }
.doc-item:hover { background: white; }

.doc-icon {
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    background: white;
    border: 1px solid var(--border);
    flex-shrink: 0;
    color: var(--accent-red);
}

.doc-icon i { width: 18px; height: 18px; stroke-width: 1.75; }

.doc-info { flex: 1; min-width: 0; }

.doc-name { font-size: 13.5px; font-weight: 500; color: var(--deep-charcoal); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-meta { font-size: 11.5px; color: var(--light-text); font-weight: 300; margin-top: 2px; }

.doc-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* ---- Upload zone ---- */
.upload-zone {
    border: 1.5px dashed var(--border);
    background: var(--off-white);
    padding: 20px 20px;
    margin-bottom: 16px;
}

.upload-zone-grid {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 12px;
    align-items: end;
}

/* ---- Vigencia indicator ---- */
.pol-vigencia-bar {
    height: 6px;
    background: var(--off-white);
    border: 1px solid var(--border);
    overflow: hidden;
    margin-top: 8px;
}

.pol-vigencia-fill {
    height: 100%;
    background: var(--success);
    transition: width 1s cubic-bezier(0.16,1,0.3,1);
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .pol-hero { padding: 24px 20px; margin: -20px -20px 16px; }
    .pol-hero-title { font-size: 20px; }
    .tab-btn { padding: 11px 14px; font-size: 12.5px; }
    .tab-btn span { display: none; }
    .upload-zone-grid { grid-template-columns: 1fr; }
}