/* ── Forms ──────────────────────────────────────────────── */
.form { display: flex; flex-direction: column; gap: 1rem; }
.form-group { display: flex; flex-direction: column; gap: 0.4rem; }

.label { font-size: 0.8rem; font-weight: 600; color: var(--cpod-text-muted); text-transform: uppercase; letter-spacing: 0.04em; }

.input, .select, .textarea {
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: 1.5px solid var(--input);
    border-radius: calc(var(--radius) - 2px);
    background: var(--card);
    color: var(--foreground);
    font-size: 0.875rem;
    font-family: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.input:focus, .select:focus, .textarea:focus {
    outline: none;
    border-color: var(--cpod-primary);
    box-shadow: 0 0 0 3px rgba(31,92,89,0.12);
}

.textarea { resize: vertical; min-height: 80px; }
#treatmentPlan { resize: vertical; min-height: 4rem; }

/* ── Checkbox ────────────────────────────────────────────── */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--foreground);
}

.checkbox-label input[type="checkbox"] {
    width: 1.125rem;
    height: 1.125rem;
    border: 2px solid var(--border);
    border-radius: 4px;
    background: var(--card);
    cursor: pointer;
    position: relative;
    margin: 0;
    appearance: none;
    transition: all 0.15s;
    flex-shrink: 0;
}

.checkbox-label input[type="checkbox"]:checked {
    background: var(--cpod-primary);
    border-color: var(--cpod-primary);
}

.checkbox-label input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
}

.checkbox-text { user-select: none; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.6rem 1rem;
    border-radius: var(--radius);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    border: none;
    text-decoration: none;
    white-space: nowrap;
    letter-spacing: 0.01em;
}

.btn-primary {
    background: var(--cpod-primary);
    color: #FFFFFF;
    border: 2px solid var(--cpod-primary);
}
.btn-primary:hover { background: #174845; border-color: #174845; box-shadow: var(--shadow-md); }

.btn-outline {
    background: transparent;
    color: #FFFFFF;
    border: 2px solid rgba(255,255,255,0.6);
}
.btn-outline:hover { background: rgba(255,255,255,0.15); border-color: #FFFFFF; }

/* Outline inside cards (not in header) */
.card .btn-outline, .modal .btn-outline {
    color: var(--cpod-primary);
    border-color: var(--cpod-border);
    background: transparent;
}
.card .btn-outline:hover, .modal .btn-outline:hover {
    background: var(--accent);
    border-color: var(--cpod-primary);
}

.btn-success {
    background: var(--cpod-mint);
    color: var(--cpod-text);
    border: 2px solid var(--cpod-mint);
}
.btn-success:hover { background: #28d9ae; border-color: #28d9ae; box-shadow: var(--shadow-md); }

.btn-danger {
    background: transparent;
    color: rgba(255,255,255,0.85);
    border: 2px solid rgba(255,255,255,0.4);
}
.btn-danger:hover { background: rgba(239,68,68,0.25); border-color: rgba(239,68,68,0.8); color: #FFFFFF; }

/* Danger inside modals */
.modal .btn-danger {
    background: #EF4444;
    color: white;
    border-color: #EF4444;
}
.modal .btn-danger:hover { background: #DC2626; border-color: #DC2626; }

/* ── Export dropdown ─────────────────────────────────────── */
.export-group {
    position: relative;
    display: flex;
}

.export-main {
    border-radius: var(--radius) 0 0 var(--radius);
    border-right: 1px solid rgba(255,255,255,0.25) !important;
}

.export-toggle {
    border-radius: 0 var(--radius) var(--radius) 0;
    padding: 0.6rem 0.55rem;
    border-left: none !important;
}

.export-menu {
    display: none;
    position: absolute;
    top: calc(100% + 5px);
    right: 0;
    min-width: 190px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 200;
    overflow: hidden;
}

.export-group.open .export-menu { display: block; }

.export-menu-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.65rem 1rem;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--foreground);
    text-align: left;
    transition: background 0.12s;
}

.export-menu-item:hover { background: var(--accent); color: var(--cpod-primary); }
.export-menu-item + .export-menu-item { border-top: 1px solid var(--border); }

.export-menu-item i { width: 14px; text-align: center; color: var(--cpod-primary); flex-shrink: 0; }
.export-menu-item small { margin-left: auto; font-size: 0.7rem; font-weight: 400; color: var(--cpod-text-muted); }

/* ── Edit / Delete buttons ───────────────────────────────── */
.btn-edit, .btn-delete {
    padding: 0.3rem 0.65rem;
    border: 1.5px solid var(--border);
    border-radius: calc(var(--radius) - 2px);
    background: var(--card);
    color: var(--foreground);
    font-size: 0.75rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.btn-edit { color: var(--cpod-primary); border-color: rgba(31,92,89,0.3); }
.btn-edit:hover { background: rgba(31,92,89,0.08); border-color: var(--cpod-primary); }

.btn-delete { color: #EF4444; border-color: rgba(239,68,68,0.3); }
.btn-delete:hover { background: rgba(239,68,68,0.08); border-color: #EF4444; }

/* ── Settings dropdown ───────────────────────────────────── */
.settings-group {
    position: relative;
}

.settings-menu {
    display: none;
    position: absolute;
    top: calc(100% + 5px);
    right: 0;
    min-width: 230px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 200;
    overflow: hidden;
}

.settings-group.open .settings-menu { display: block; }

.settings-section-label {
    padding: 0.5rem 1rem 0.25rem;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--cpod-text-muted);
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.2rem;
}

.settings-menu-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.65rem 1rem;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--foreground);
    text-align: left;
    transition: background 0.12s;
}

.settings-menu-item:hover { background: var(--accent); }
.settings-menu-item i { width: 14px; text-align: center; flex-shrink: 0; }
.settings-menu-item.active {
    background: var(--accent);
    color: var(--accent-foreground);
}

.danger-item { color: #EF4444; }
.danger-item:hover { background: rgba(239,68,68,0.08) !important; color: #DC2626; }

/* ── Bridge mode button active state ───── */
.bridge-mode-btn.active {
    background: rgba(51,195,243,0.15) !important;
    color: var(--cpod-blue) !important;
    border-color: var(--cpod-blue) !important;
}

/* ── Tooth tooltip ───────────────────────────────────────── */
.tooth-tooltip {
    position: fixed;
    padding: 0.4rem 0.65rem;
    background: var(--cpod-text);
    color: #FFFFFF;
    border-radius: calc(var(--radius) - 2px);
    font-size: 0.75rem;
    font-weight: 500;
    pointer-events: none;
    z-index: 9999;
    max-width: 210px;
    box-shadow: var(--shadow-md);
    opacity: 0;
    transition: opacity 0.1s;
    line-height: 1.5;
}

.tooth-tooltip.visible { opacity: 1; }

.tooth-tooltip .tt-badge {
    display: inline-block;
    margin-top: 0.2rem;
    padding: 0.1rem 0.35rem;
    background: rgba(51,243,195,0.2);
    border-radius: 3px;
    font-size: 0.68rem;
    color: #7fffd4;
}
