/* ============================================
   OBJECTIVES GAUGES — Tachometer Style
   Domus-IA España v1.0
   ============================================ */

/* ── Container ───────────────────────────── */
.objectives-panel {
    background: #fff;
    border-radius: 16px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    padding: 20px;
    margin-bottom: 24px;
}

.objectives-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 8px;
}

.objectives-header h2 {
    font-size: 16px;
    font-weight: 700;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.objectives-header h2 i {
    color: #f59e0b;
}

.objectives-period-tabs {
    display: flex;
    background: #f3f4f6;
    border-radius: 10px;
    padding: 3px;
    gap: 2px;
}

.objectives-period-tab {
    padding: 5px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    border: none;
    background: transparent;
    transition: all 0.2s;
}

.objectives-period-tab.active {
    background: #fff;
    color: #6366f1;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.objectives-period-tab:hover:not(.active) {
    color: #374151;
}

/* ── Grid of gauges ──────────────────────── */
.gauges-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
}

@media (max-width: 1200px) {
    .gauges-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 900px) {
    .gauges-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px) {
    .gauges-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
}

/* ── Single gauge widget ─────────────────── */
.gauge-widget {
    background: #fafbfc;
    border: 1px solid #e8eaed;
    border-radius: 14px;
    padding: 14px 10px 10px;
    text-align: center;
    transition: all 0.25s ease;
    position: relative;
    cursor: default;
}

.gauge-widget:hover {
    border-color: #c7d0dd;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    transform: translateY(-2px);
}

.gauge-svg-wrap {
    width: 100%;
    max-width: 140px;
    margin: 0 auto 4px;
    position: relative;
}

.gauge-svg-wrap svg {
    width: 100%;
    height: auto;
    display: block;
}

.gauge-label {
    font-size: 11px;
    font-weight: 600;
    color: #374151;
    line-height: 1.2;
    margin-bottom: 4px;
    min-height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gauge-progress-text {
    font-size: 18px;
    font-weight: 800;
    color: #1f2937;
    line-height: 1;
}

.gauge-progress-text .gauge-slash {
    font-size: 13px;
    font-weight: 500;
    color: #9ca3af;
    margin: 0 1px;
}

.gauge-progress-text .gauge-target {
    font-size: 14px;
    font-weight: 600;
    color: #6b7280;
}

.gauge-pct {
    font-size: 10px;
    font-weight: 700;
    color: #9ca3af;
    margin-top: 2px;
}

/* ── Edit target overlay ─────────────────── */
.gauge-edit-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    border: none;
    background: rgba(99,102,241,0.08);
    color: #6366f1;
    font-size: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.gauge-widget:hover .gauge-edit-btn {
    opacity: 1;
}

.gauge-edit-btn:hover {
    background: rgba(99,102,241,0.2);
}

/* ── Increment button ────────────────────── */
.gauge-inc-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid #e5e7eb;
    background: #fff;
    color: #6b7280;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 6px;
    transition: all 0.2s;
}

.gauge-inc-btn:hover {
    border-color: #6366f1;
    color: #6366f1;
    background: rgba(99,102,241,0.05);
    transform: scale(1.1);
}

.gauge-inc-btn:active {
    transform: scale(0.95);
}

/* ── Edit modal ──────────────────────────── */
.objectives-edit-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.objectives-edit-modal.active {
    display: flex;
}

.objectives-edit-content {
    background: #fff;
    border-radius: 20px;
    max-width: 440px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    padding: 24px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

.objectives-edit-content h3 {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.objectives-edit-content h3 i {
    color: #f59e0b;
}

.edit-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid #f3f4f6;
}

.edit-row:last-of-type {
    border-bottom: none;
}

.edit-row-label {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
}

.edit-row input[type="number"] {
    width: 60px;
    padding: 5px 8px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    color: #1f2937;
    transition: border-color 0.2s;
}

.edit-row input[type="number"]:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}

.edit-row-divider {
    font-size: 11px;
    color: #9ca3af;
    font-weight: 500;
}

.edit-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    justify-content: flex-end;
}

.edit-actions button {
    padding: 8px 20px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.edit-btn-cancel {
    background: #f3f4f6;
    color: #6b7280;
}

.edit-btn-cancel:hover {
    background: #e5e7eb;
}

.edit-btn-save {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
}

.edit-btn-save:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.edit-btn-reset {
    background: transparent;
    color: #ef4444;
    font-size: 12px;
    padding: 8px 12px;
    margin-right: auto;
}

.edit-btn-reset:hover {
    background: rgba(239,68,68,0.06);
}

/* ── Needle animation ────────────────────── */
.gauge-needle {
    transition: transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-origin: 100px 100px;
}

/* ── Completion glow ─────────────────────── */
.gauge-widget.completed {
    border-color: #86efac;
    background: linear-gradient(135deg, #f0fdf4, #fafbfc);
}

.gauge-widget.completed .gauge-pct {
    color: #16a34a;
}
