/* Calendario Judicial - Estilos personalizados */

/* Safe area para dispositivos con notch */
.safe-bottom {
    padding-bottom: env(safe-area-inset-bottom, 0);
}

/* Navegación inferior */
.nav-btn {
    color: #627d98;
    transition: color 0.2s;
}
.nav-btn.active {
    color: #1e3a5f;
}
.nav-btn.active svg {
    stroke-width: 2.5;
}

/* Cards */
.card {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    padding: 1rem;
    transition: transform 0.15s, box-shadow 0.15s;
}
.card:active {
    transform: scale(0.98);
}

/* Timeline */
.timeline-item {
    position: relative;
    padding-left: 2rem;
    padding-bottom: 1.5rem;
}
.timeline-item::before {
    content: '';
    position: absolute;
    left: 0.5rem;
    top: 1.75rem;
    bottom: 0;
    width: 2px;
    background: #d9e2ec;
}
.timeline-item:last-child::before {
    display: none;
}
.timeline-dot {
    position: absolute;
    left: 0;
    top: 0.25rem;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    border: 3px solid #d9e2ec;
    background: white;
    z-index: 1;
}
.timeline-dot.completado {
    background: #10b981;
    border-color: #10b981;
}
.timeline-dot.en-curso {
    background: #f59e0b;
    border-color: #f59e0b;
    animation: pulse-dot 2s infinite;
}
.timeline-dot.vencido {
    background: #ef4444;
    border-color: #ef4444;
}

@keyframes pulse-dot {
    0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(245, 158, 11, 0); }
}

/* Wizard steps */
.step-indicator {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}
.step-dot {
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
    background: #d9e2ec;
    transition: background 0.3s, transform 0.3s;
}
.step-dot.active {
    background: #1e3a5f;
    transform: scale(1.3);
}
.step-dot.done {
    background: #10b981;
}

/* Calendar grid */
.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}
.cal-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    min-height: 40px;
}
.cal-day:active {
    transform: scale(0.9);
}
.cal-day.despacho {
    background: #d1fae5;
    color: #065f46;
}
.cal-day.no-despacho {
    background: #fee2e2;
    color: #991b1b;
}
.cal-day.sin-registrar {
    background: #f3f4f6;
    color: #6b7280;
}
.cal-day.fin-semana {
    background: #e5e7eb;
    color: #9ca3af;
}
.cal-day.vacacion {
    background: #fef3c7;
    color: #92400e;
}
.cal-day.header {
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 600;
    cursor: default;
}

/* Form styles */
.form-input {
    width: 100%;
    border: 1.5px solid #d9e2ec;
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: white;
}
.form-input:focus {
    border-color: #1e3a5f;
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.1);
}
.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #334e68;
    margin-bottom: 0.375rem;
}

/* Selector cards */
.selector-card {
    border: 2px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: all 0.15s;
}
.selector-card:active {
    transform: scale(0.98);
}
.selector-card.selected {
    border-color: #1e3a5f;
    background: #f0f4f8;
}

/* Button */
.btn-primary {
    background: #1e3a5f;
    color: white;
    padding: 0.875rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 600;
    font-size: 1rem;
    width: 100%;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-primary:active {
    background: #243b53;
}
.btn-primary:disabled {
    background: #bcccdc;
    cursor: not-allowed;
}
.btn-secondary {
    background: white;
    color: #1e3a5f;
    padding: 0.875rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 600;
    font-size: 1rem;
    width: 100%;
    border: 2px solid #1e3a5f;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-secondary:active {
    background: #f0f4f8;
}

/* Badge */
.badge {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}
.badge-ordinario {
    background: #dbeafe;
    color: #1e40af;
}
.badge-breve {
    background: #fce7f3;
    color: #9d174d;
}

/* Loading spinner */
.spinner {
    border: 3px solid #e5e7eb;
    border-top: 3px solid #1e3a5f;
    border-radius: 50%;
    width: 2rem;
    height: 2rem;
    animation: spin 0.8s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Search input */
.search-input-wrapper {
    position: relative;
}
.search-input-wrapper svg {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
}
.search-input-wrapper input {
    padding-left: 2.5rem;
}

/* Toggle switch */
.toggle-switch {
    position: relative;
    width: 2.75rem;
    height: 1.5rem;
    background: #d1d5db;
    border-radius: 9999px;
    cursor: pointer;
    transition: background 0.3s;
}
.toggle-switch.active {
    background: #10b981;
}
.toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 1.25rem;
    height: 1.25rem;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle-switch.active::after {
    transform: translateX(1.25rem);
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #627d98;
}
.empty-state svg {
    width: 4rem;
    height: 4rem;
    margin: 0 auto 1rem;
    opacity: 0.5;
}

/* Auth pages */
.auth-container {
    max-width: 400px;
    margin: 0 auto;
    padding: 2rem 1rem;
}
.auth-logo {
    text-align: center;
    margin-bottom: 2rem;
}
.auth-logo h2 {
    color: #1e3a5f;
    font-size: 1.5rem;
    font-weight: 700;
}
.auth-logo p {
    color: #627d98;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}
.auth-card {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.auth-link {
    color: #1e3a5f;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
}

/* User menu dropdown */
.user-menu {
    position: relative;
}
.user-menu-btn {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: #c9a84c;
    color: #1e3a5f;
    font-weight: 700;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 2px solid rgba(255,255,255,0.3);
}
.user-dropdown {
    position: absolute;
    right: 0;
    top: 2.5rem;
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    min-width: 200px;
    overflow: hidden;
    z-index: 60;
    display: none;
}
.user-dropdown.open {
    display: block;
}
.user-dropdown-item {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.875rem;
    color: #334e68;
    cursor: pointer;
    border: none;
    background: none;
}
.user-dropdown-item.danger {
    color: #dc2626;
}
.user-dropdown-divider {
    height: 1px;
    background: #e5e7eb;
}
/* Notifications bell */
.notif-menu {
    position: relative;
}
.notif-bell-btn {
    position: relative;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: rgba(255,255,255,0.85);
    background: none;
    border: none;
    transition: background 0.2s;
}
.notif-bell-btn:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}
.notif-badge {
    position: absolute;
    top: 0;
    right: 0;
    min-width: 1rem;
    height: 1rem;
    padding: 0 0.25rem;
    border-radius: 999px;
    background: #dc2626;
    color: #fff;
    font-size: 0.625rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.notif-dropdown {
    position: absolute;
    right: 0;
    top: 2.5rem;
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    width: 320px;
    max-width: 90vw;
    overflow: hidden;
    z-index: 60;
    display: none;
}
.notif-dropdown.open {
    display: block;
}
.notif-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e5e7eb;
}
.notif-dropdown-list {
    max-height: 360px;
    overflow-y: auto;
}
.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.15s;
}
.notif-item:hover {
    background: #f9fafb;
}
.notif-item:last-child {
    border-bottom: none;
}
.notif-item-unread {
    background: #eff6ff;
}
.notif-item-unread:hover {
    background: #dbeafe;
}
.notif-icon {
    flex-shrink: 0;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    margin-top: 0.125rem;
}
.notif-icon-proximo {
    background: #fef3c7;
}
.notif-icon-vencido {
    background: #fee2e2;
    color: #dc2626;
    font-weight: 700;
}
.notif-item-body {
    flex: 1;
    min-width: 0;
}
.notif-item-msg {
    font-size: 0.8125rem;
    color: #1f2937;
    line-height: 1.3;
}
.notif-item-meta {
    font-size: 0.6875rem;
    color: #9ca3af;
    margin-top: 0.125rem;
}
.notif-empty {
    padding: 2rem 1rem;
    text-align: center;
    color: #9ca3af;
    font-size: 0.875rem;
}

.admin-badge {
    display: inline-block;
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-size: 0.625rem;
    font-weight: 700;
    background: #c9a84c;
    color: #1e3a5f;
    text-transform: uppercase;
}
.badge-divorcio {
    background: #fce7f3;
    color: #9d174d;
}
.badge-separacion {
    background: #f3e8ff;
    color: #6b21a8;
}
.section-header {
    font-size: 0.75rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.5rem 0;
    margin-top: 0.5rem;
}
.cal-day.readonly {
    cursor: default;
}
.cal-day.readonly:active {
    transform: none;
}
