/* ==========================================================================
   ATESTALIS — Estilos globales de la aplicación
   ========================================================================== */

/* --------------------------------------------------------------------------
   Variables de color
   -------------------------------------------------------------------------- */
:root {
    --color-emerald:     #10b981;
    --color-emerald-dark:#059669;
    --color-emerald-deep:#065f46;
    --color-green-deep:  #064e3b;
}

/* --------------------------------------------------------------------------
   Layout: Admin header
   -------------------------------------------------------------------------- */
.admin-header {
    background: linear-gradient(135deg, #064e3b 0%, #065f46 40%, #059669 100%);
}

/* --------------------------------------------------------------------------
   Sidebar
   -------------------------------------------------------------------------- */
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    padding: 1rem 0;
}

.sidebar-brand__logo {
    width: 30px;
    height: 30px;
    background: linear-gradient(135deg, #059669, #10b981);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
}

.sidebar-brand__name {
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    color: #064e3b;
    text-transform: uppercase;
}

.sidebar-logout {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    background: #fef2f2;
    color: #dc2626;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    text-decoration: none;
    transition: background 0.15s;
    margin-top: 8px;
}

.sidebar-logout:hover {
    background: #fee2e2;
    color: #dc2626;
}

/* --------------------------------------------------------------------------
   Navbar
   -------------------------------------------------------------------------- */
.nav-user-badge {
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    background: rgba(255, 255, 255, 0.95);
    color: #065f46;
    border-left: 3px solid #10b981;
}

.nav-user-badge i {
    color: #10b981;
    margin-right: 4px;
}

/* --------------------------------------------------------------------------
   Dashboard: grids
   -------------------------------------------------------------------------- */
.dash-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.dash-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.dash-grid-2 {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 20px;
    align-items: start;
}

.dash-sidebar {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.row--flush {
    margin-bottom: 0 !important;
}

@media (max-width: 1200px) { .dash-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px)  { .dash-grid-4 { grid-template-columns: repeat(1, minmax(0, 1fr)); } }
@media (max-width: 900px)  { .dash-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 580px)  { .dash-grid-3 { grid-template-columns: repeat(1, minmax(0, 1fr)); } }
@media (max-width: 900px)  { .dash-grid-2 { grid-template-columns: 1fr; } }

/* --------------------------------------------------------------------------
   Dashboard: KPI cards
   -------------------------------------------------------------------------- */
.kpi-card {
    background: white;
    border-radius: 12px;
    padding: 18px 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    gap: 14px;
    border-left: 4px solid transparent;
}

.kpi-icon {
    width: 46px;
    height: 46px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.kpi-val {
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1;
}

.kpi-lbl {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6b7280;
    margin-top: 2px;
}

.kpi-sub {
    font-size: 0.7rem;
    color: #9ca3af;
}

/* KPI color variants */
.kpi--emerald { border-color: #10b981; }
.kpi--emerald .kpi-icon { background: #ecfdf5; color: #059669; }
.kpi--emerald .kpi-val  { color: #059669; }

.kpi--blue { border-color: #3b82f6; }
.kpi--blue .kpi-icon { background: #eff6ff; color: #2563eb; }
.kpi--blue .kpi-val  { color: #2563eb; }

.kpi--amber { border-color: #f59e0b; }
.kpi--amber .kpi-icon { background: #fffbeb; color: #d97706; }
.kpi--amber .kpi-val  { color: #d97706; }

.kpi--indigo { border-color: #6366f1; }
.kpi--indigo .kpi-icon { background: #eef2ff; color: #4f46e5; }
.kpi--indigo .kpi-val  { color: #4f46e5; }

.kpi--pink { border-color: #ec4899; }
.kpi--pink .kpi-icon { background: #fdf2f8; color: #db2777; }
.kpi--pink .kpi-val  { color: #db2777; }

.kpi--teal { border-color: #14b8a6; }
.kpi--teal .kpi-icon { background: #f0fdfa; color: #0d9488; }
.kpi--teal .kpi-val  { color: #0d9488; }

.kpi--violet { border-color: #8b5cf6; }
.kpi--violet .kpi-icon { background: #f5f3ff; color: #7c3aed; }
.kpi--violet .kpi-val  { color: #7c3aed; }

.kpi--orange { border-color: #f97316; }
.kpi--orange .kpi-icon { background: #fff7ed; color: #ea580c; }
.kpi--orange .kpi-val  { color: #ea580c; }

.kpi--red { border-color: #ef4444; }
.kpi--red .kpi-icon { background: #fef2f2; color: #dc2626; }
.kpi--red .kpi-val  { color: #dc2626; }

/* --------------------------------------------------------------------------
   Dashboard: panel genérico
   -------------------------------------------------------------------------- */
.panel {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.07);
    overflow: hidden;
}

.panel--padded { padding: 16px; }
.panel--actions { padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.panel--areas   { padding: 12px; display: flex; flex-direction: column; gap: 6px; }

/* --------------------------------------------------------------------------
   Dashboard: section title
   -------------------------------------------------------------------------- */
.section-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}

.section-icon { color: #10b981; }

/* --------------------------------------------------------------------------
   Dashboard: status pill
   -------------------------------------------------------------------------- */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 9px;
    border-radius: 20px;
    font-size: 0.68rem;
    font-weight: 600;
    white-space: nowrap;
    /* background y color se aplican inline desde PHP (valores dinámicos) */
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
    /* background se aplica inline desde PHP (valor dinámico) */
}

/* --------------------------------------------------------------------------
   Dashboard: status bar (distribución por estado)
   -------------------------------------------------------------------------- */
.sbar-item { margin-bottom: 11px; }

.sbar-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.sbar-label {
    font-size: 0.73rem;
    font-weight: 600;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 5px;
}

.sbar-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
    /* background se aplica inline desde PHP (valor dinámico) */
}

.sbar-count {
    font-size: 0.73rem;
    font-weight: 700;
    color: #1f2937;
}

.sbar-track {
    background: #f1f5f9;
    border-radius: 4px;
    height: 5px;
}

.sbar-fill {
    height: 100%;
    border-radius: 4px;
    /* background y width se aplican inline desde PHP (valores dinámicos) */
}

/* --------------------------------------------------------------------------
   Dashboard: tabla de solicitudes
   -------------------------------------------------------------------------- */
.dash-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.dash-table thead tr {
    background: #f8fafc;
    border-bottom: 2px solid #e5e7eb;
}

.dash-table th {
    padding: 11px 16px;
    text-align: left;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #9ca3af;
}

.dash-table td {
    padding: 10px 16px;
}

.dash-table tbody tr {
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.12s;
}

.dash-table tbody tr:hover {
    background: #f0fdf4;
}

.dash-table__num {
    font-weight: 700;
    color: #065f46;
}

.dash-table__main { color: #374151; }
.dash-table__sub  { color: #6b7280; font-size: 0.78rem; }
.dash-table__muted{ color: #9ca3af; font-size: 0.75rem; }
.dash-table__center { text-align: center; }

.dash-table__link {
    color: #059669;
    text-decoration: none;
}

.dash-table__empty td {
    padding: 28px;
    text-align: center;
    color: #9ca3af;
}

.dash-table__empty-icon {
    font-size: 1.4rem;
    display: block;
    margin-bottom: 6px;
}

.dash-table__footer {
    padding: 10px 16px;
    border-top: 1px solid #f1f5f9;
    text-align: right;
}

.dash-table__footer a {
    font-size: 0.78rem;
    font-weight: 600;
    color: #059669;
    text-decoration: none;
}

/* --------------------------------------------------------------------------
   Dashboard: quick links
   -------------------------------------------------------------------------- */
.quick-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    text-decoration: none;
    transition: filter 0.15s;
}

.quick-link:hover { filter: brightness(0.96); }

.quick-link--primary { background: #ecfdf5; }
.quick-link--default { background: #f8fafc; }

.quick-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: white;
    font-size: 0.75rem;
}

.quick-icon--emerald { background: #059669; }
.quick-icon--blue    { background: #3b82f6; }
.quick-icon--pink    { background: #ec4899; }
.quick-icon--violet  { background: #8b5cf6; }
.quick-icon--indigo  { background: #6366f1; }

.ql-title    { font-size: 0.78rem; font-weight: 700; color: #1f2937; }
.ql-title--primary { color: #065f46; }
.ql-subtitle { font-size: 0.68rem; color: #6b7280; }

/* --------------------------------------------------------------------------
   Dashboard: welcome bar (barra superior)
   -------------------------------------------------------------------------- */
.welcome-bar {
    background: linear-gradient(135deg, #064e3b 0%, #059669 100%);
    border-radius: 12px;
    padding: 20px 24px;
    color: white;
    margin-bottom: 20px;
    box-shadow: 0 4px 18px rgba(5, 150, 105, 0.3);
}

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

.welcome-bar__date {
    font-size: 0.7rem;
    opacity: 0.7;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.welcome-bar__title {
    font-size: 1.25rem;
    font-weight: 800;
    margin: 0;
}

.welcome-bar__subtitle {
    margin: 4px 0 0;
    font-size: 0.82rem;
    opacity: 0.8;
}

.welcome-bar__stat {
    text-align: right;
    opacity: 0.9;
}

.welcome-bar__stat-num {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
}

.welcome-bar__stat-label {
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.8;
}

.welcome-bar__areas {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.welcome-bar__area-tag {
    padding: 4px 12px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.2);
    font-size: 0.72rem;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.welcome-bar__no-areas {
    font-size: 0.78rem;
    opacity: 0.7;
}

/* --------------------------------------------------------------------------
   Dashboard: área item (inspector)
   -------------------------------------------------------------------------- */
.area-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: 10px;
    background: #f8fafc;
}

.area-item__inner {
    display: flex;
    align-items: center;
    gap: 10px;
}

.area-item__icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, #059669, #10b981);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: white;
    font-size: 0.75rem;
}

.area-item__name { font-size: 0.8rem; font-weight: 700; color: #1f2937; }
.area-item__desc { font-size: 0.68rem; color: #9ca3af; }

.area-item__empty {
    padding: 20px;
    text-align: center;
    color: #9ca3af;
    font-size: 0.8rem;
}

/* --------------------------------------------------------------------------
   Dashboard: área tag en tabla (inspector)
   -------------------------------------------------------------------------- */
.area-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    background: #f0fdf4;
    color: #065f46;
    font-weight: 600;
    font-size: 0.75rem;
}

/* --------------------------------------------------------------------------
   Dashboard: inspector badge "yo"
   -------------------------------------------------------------------------- */
.inspector-me-badge {
    font-size: 0.6rem;
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
    border-radius: 8px;
    padding: 1px 5px;
    margin-left: 3px;
    vertical-align: middle;
}

.inspector-me-name { font-weight: 700; color: #059669; }
.inspector-unassigned { color: #d1d5db; }

/* --------------------------------------------------------------------------
   Dashboard: info card del cliente
   -------------------------------------------------------------------------- */
.client-info-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.client-info-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, #059669, #10b981);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: white;
    font-size: 0.85rem;
}

.client-info-name { font-size: 0.85rem; font-weight: 700; color: #1f2937; }
.client-info-tin  { font-size: 0.7rem; color: #9ca3af; }

.client-info-location {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: #6b7280;
    padding: 6px 10px;
    background: #f8fafc;
    border-radius: 8px;
}

.client-info-location i { color: #10b981; width: 14px; }

/* --------------------------------------------------------------------------
   Login page
   -------------------------------------------------------------------------- */
.login-bg {
    background: linear-gradient(135deg, #064e3b 0%, #065f46 30%, #047857 60%, #059669 100%);
    min-height: 100vh;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
}

.login-bg::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at center, rgba(16, 185, 129, 0.15) 0%, transparent 60%);
    animation: pulse-bg 8s ease-in-out infinite;
}

@keyframes pulse-bg {
    0%, 100% { transform: scale(1);   opacity: 0.5; }
    50%       { transform: scale(1.1); opacity: 1;   }
}

.circle-deco {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(52, 211, 153, 0.15);
}

.leaf-deco {
    position: absolute;
    opacity: 0.06;
}

.login-wrapper {
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 10;
}

.login-card {
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(52, 211, 153, 0.1);
    padding: 2.5rem 2.5rem 2rem;
}

.brand-logo {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #059669, #10b981);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.45);
}

.brand-title {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    background: linear-gradient(135deg, #065f46, #059669);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    text-align: center;
}

.brand-subtitle {
    font-size: 0.72rem;
    letter-spacing: 0.25em;
    color: #6b7280;
    text-transform: uppercase;
    margin-top: 4px;
    text-align: center;
}

.brand-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 14px;
}

.brand-divider__line {
    height: 2px;
    width: 28px;
    border-radius: 2px;
}

.brand-divider__line--left  { background: linear-gradient(90deg, transparent, #10b981); }
.brand-divider__line--right { background: linear-gradient(90deg, #10b981, transparent); }

.brand-divider__dot {
    width: 6px;
    height: 6px;
    background: #10b981;
    border-radius: 50%;
}

.login-welcome {
    text-align: center;
    color: #6b7280;
    font-size: 0.85rem;
    margin: 16px 0 24px;
}

.input-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #374151;
    margin-bottom: 6px;
}

.input-wrapper {
    position: relative;
    margin-bottom: 18px;
}

.input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    width: 18px;
    height: 18px;
    transition: color 0.25s;
}

.input-wrapper:focus-within .input-icon { color: #10b981; }

.input-field {
    width: 100%;
    padding: 12px 16px 12px 44px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 0.9rem;
    color: #1f2937;
    background: #f9fafb;
    transition: border-color 0.25s, box-shadow 0.25s;
    outline: none;
}

.input-field:focus {
    border-color: #10b981;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.12);
}

.input-field.error {
    border-color: #ef4444;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

.remember-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 16px;
}

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

.remember-checkbox {
    width: 18px;
    height: 18px;
    accent-color: #10b981;
    cursor: pointer;
}

.remember-text {
    font-size: 0.82rem;
    color: #4b5563;
    font-weight: 500;
}

.forgot-link {
    color: #059669;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s;
}

.forgot-link:hover {
    color: #047857;
    text-decoration: underline;
}

.btn-login {
    width: 100%;
    padding: 13px;
    background: linear-gradient(135deg, #059669, #10b981);
    color: white;
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
    transition: transform 0.25s, box-shadow 0.25s, background 0.25s;
    margin-top: 8px;
}

.btn-login:hover {
    background: linear-gradient(135deg, #047857, #059669);
    box-shadow: 0 8px 28px rgba(16, 185, 129, 0.55);
    transform: translateY(-1px);
}

.btn-login:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}

.btn-login__inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.error-msg {
    color: #dc2626;
    font-size: 0.75rem;
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.login-footer {
    text-align: center;
    margin-top: 20px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.72rem;
    letter-spacing: 0.05em;
}
