/* Super Admin portal enhancements */

.admin-layout .stat-card {
    position: relative;
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    animation: cardFadeIn 0.5s ease backwards;
}
.admin-layout .stat-card:nth-child(1) { animation-delay: 0.05s; }
.admin-layout .stat-card:nth-child(2) { animation-delay: 0.1s; }
.admin-layout .stat-card:nth-child(3) { animation-delay: 0.15s; }
.admin-layout .stat-card:nth-child(4) { animation-delay: 0.2s; }
.admin-layout .stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
}
.admin-layout .stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    border-radius: 0.75rem 0.75rem 0 0;
}
.admin-layout .stat-card-teal::before { background: linear-gradient(90deg, #14b8a6, #2dd4bf); }
.admin-layout .stat-card-green::before { background: linear-gradient(90deg, #22c55e, #4ade80); }
.admin-layout .stat-card-blue::before { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.admin-layout .stat-card-purple::before { background: linear-gradient(90deg, #a855f7, #c084fc); }
.admin-layout .card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    animation: cardFadeIn 0.45s ease backwards;
}
.admin-layout .card:hover { box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25); }
@keyframes cardFadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.specialty-list { display: flex; flex-direction: column; gap: 0.5rem; }
.specialty-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.75rem 1rem; background: #374151; border-radius: 0.5rem;
    border: 1px solid #4b5563; transition: background 0.15s, border-color 0.15s;
}
.specialty-row:hover { background: #3f4d63; border-color: #6b7280; }
.specialty-row-label {
    display: flex; align-items: center; gap: 0.625rem;
    color: #f3f4f6; font-size: 0.875rem; font-weight: 500; text-transform: capitalize;
}
.specialty-row-dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; flex-shrink: 0; }
.specialty-row-count {
    color: #2dd4bf; font-weight: 600; font-size: 0.875rem;
    background: rgba(13, 148, 136, 0.15); padding: 0.2rem 0.625rem; border-radius: 9999px;
}

.modal-dark .modal { background: #1f2937; border: 1px solid #374151; color: #f3f4f6; }
.modal-dark .modal-header { border-color: #374151; }
.modal-dark .modal-header h3 { color: #fff; }
.modal-dark .modal-close { color: #9ca3af; background: none; border: none; cursor: pointer; }
.modal-dark .modal-close:hover { color: #fff; }
.modal-dark .modal-body { color: #e5e7eb; }
.modal-dark .label { color: #d1d5db; }
.modal-dark .input, .modal-dark .select {
    background: #374151; border-color: #4b5563; color: #fff;
}
.modal-dark .input:focus, .modal-dark .select:focus {
    border-color: #2dd4bf; box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.15);
}
.modal-dark .input::placeholder { color: #6b7280; }
.modal-dark p { color: #d1d5db; margin: 0.25rem 0 0; }
.modal-dark .btn-secondary { background: #374151; border-color: #4b5563; color: #e5e7eb; }
.modal-dark .btn-secondary:hover { background: #4b5563; }
.modal-dark .table-wrap { overflow-x: auto; margin: 0 -0.25rem; }
.modal-dark .data-table { width: 100%; border-collapse: collapse; }
.modal-dark .data-table thead { background: #374151; }
.modal-dark .data-table th {
    padding: 0.625rem 0.75rem; text-align: left; font-size: 0.75rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.04em; color: #9ca3af; border-bottom: 1px solid #4b5563;
}
.modal-dark .data-table td {
    padding: 0.75rem; font-size: 0.875rem; color: #e5e7eb; border-bottom: 1px solid #374151;
}
.modal-dark .data-table tbody tr:hover { background: rgba(55, 65, 81, 0.5); }
.modal-dark .data-table tbody tr:last-child td { border-bottom: none; }
.modal-dark .badge { font-size: 0.6875rem; }
.modal-dark .badge-pending { background: rgba(251, 191, 36, 0.15); color: #fbbf24; }
.modal-dark .badge-overdue { background: rgba(239, 68, 68, 0.15); color: #f87171; }
.modal-dark .badge-paid { background: rgba(34, 197, 94, 0.15); color: #4ade80; }
.modal-dark .badge-cancelled { background: rgba(239, 68, 68, 0.12); color: #fca5a5; }
.modal-dark .temp-password-box {
    margin: 1rem 0; padding: 1rem; background: #374151; border: 1px solid #4b5563;
    border-radius: 0.5rem; font-family: ui-monospace, monospace; font-size: 1.125rem;
    letter-spacing: 0.05em; color: #2dd4bf; text-align: center; user-select: all;
}

.input-group { position: relative; }
.input-group-icon {
    position: absolute; left: 0.75rem; top: 50%; transform: translateY(-50%);
    color: #9ca3af; pointer-events: none;
}
.input-group .input { padding-left: 2.5rem; }

.specialty-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.75rem;
}
.specialty-chip { position: relative; cursor: pointer; }
.specialty-chip input { position: absolute; opacity: 0; width: 0; height: 0; }
.specialty-chip-inner {
    display: flex; flex-direction: column; align-items: center; gap: 0.375rem;
    padding: 1rem 0.75rem; border: 2px solid #4b5563; border-radius: 0.75rem;
    background: #374151; transition: all 0.2s ease; text-align: center;
}
.specialty-chip-icon { font-size: 1.5rem; }
.specialty-chip-label { font-size: 0.75rem; font-weight: 600; color: #d1d5db; text-transform: capitalize; }
.specialty-chip input:checked + .specialty-chip-inner {
    border-color: #2dd4bf; background: rgba(13, 148, 136, 0.15);
    box-shadow: 0 0 0 1px rgba(45, 212, 191, 0.3);
}
.specialty-chip input:checked + .specialty-chip-inner .specialty-chip-label { color: #2dd4bf; }
.specialty-chip:hover .specialty-chip-inner { border-color: #6b7280; transform: translateY(-2px); }

.plan-selector { display: flex; flex-direction: column; gap: 0.75rem; }
.plan-option { position: relative; cursor: pointer; }
.plan-option input { position: absolute; opacity: 0; }
.plan-option-card {
    padding: 1rem 1.25rem; border: 2px solid #4b5563; border-radius: 0.75rem;
    background: #374151; transition: all 0.2s ease;
}
.plan-option input:checked + .plan-option-card {
    border-color: #2dd4bf; background: rgba(13, 148, 136, 0.12);
    box-shadow: 0 0 0 1px rgba(45, 212, 191, 0.25);
}
.plan-option-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.375rem; }
.plan-option-name { font-weight: 700; color: #fff; font-size: 1rem; }
.plan-option-price { font-weight: 700; color: #2dd4bf; font-size: 1.125rem; }
.plan-option-detail { font-size: 0.8125rem; color: #9ca3af; }
.plan-badge {
    display: inline-block; background: linear-gradient(135deg, #059669, #14b8a6);
    color: #fff; font-size: 0.6875rem; font-weight: 600;
    padding: 0.15rem 0.5rem; border-radius: 9999px; margin-left: 0.5rem;
}

.admin-layout .sidebar-footer {
    display: flex; flex-direction: column; align-items: flex-start; gap: 0.5rem;
    padding: 0.75rem; border-top: 1px solid #374151;
}
.admin-layout .sidebar-footer .sidebar-logout-btn { width: auto; flex: 0 0 auto; align-self: flex-start; }
.admin-layout .sidebar-logout-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.375rem;
    width: auto; min-width: 0; max-width: 100%; align-self: flex-start;
    margin-top: 0; padding: 0.375rem 0.75rem;
    background: rgba(220, 38, 38, 0.1); border: 1px solid rgba(220, 38, 38, 0.25);
    border-radius: 0.5rem; color: #fca5a5; font-size: 0.75rem; font-weight: 500;
    cursor: pointer; transition: all 0.15s; white-space: nowrap; flex: 0 0 auto;
    box-sizing: border-box; font-family: inherit; line-height: 1.25;
}
.admin-layout .sidebar-logout-btn:hover {
    background: rgba(220, 38, 38, 0.2); color: #fecaca; border-color: rgba(220, 38, 38, 0.4);
}
.admin-layout .sidebar-logout-btn svg {
    width: 0.875rem; height: 0.875rem; min-width: 0.875rem; min-height: 0.875rem;
    max-width: 0.875rem; max-height: 0.875rem; flex-shrink: 0; display: block;
}
.admin-layout .sidebar-logout-btn span { flex: 0 0 auto; line-height: 1.25; }

.admin-layout .topbar-logout-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.375rem;
    width: auto; min-width: 0; max-width: 100%;
    padding: 0.375rem 0.75rem; background: rgba(220, 38, 38, 0.1);
    border: 1px solid rgba(220, 38, 38, 0.25); border-radius: 0.5rem;
    color: #fca5a5; font-size: 0.8125rem; font-weight: 500; cursor: pointer;
    white-space: nowrap; flex: 0 0 auto; box-sizing: border-box;
    font-family: inherit; line-height: 1.25;
}
.admin-layout .topbar-logout-btn:hover { background: rgba(220, 38, 38, 0.2); color: #fecaca; }
.admin-layout .topbar-logout-btn svg {
    width: 0.875rem; height: 0.875rem; min-width: 0.875rem; min-height: 0.875rem;
    max-width: 0.875rem; max-height: 0.875rem; flex-shrink: 0; display: block;
}
.admin-layout .topbar-logout-btn span { flex: 0 0 auto; line-height: 1.25; }

/* Toast styles live in app.css */

.admin-dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
@media (max-width: 900px) { .admin-dashboard-grid { grid-template-columns: 1fr; } }

.admin-layout .btn-ghost { color: #9ca3af; }
.admin-layout .btn-ghost:hover { background: #374151; color: #fff; }

.form-panel {
    background: #374151; border: 1px solid #4b5563; border-radius: 0.75rem;
    padding: 1rem 1.125rem; margin-bottom: 1rem;
}
.form-panel-title {
    font-size: 0.8125rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.05em; color: #2dd4bf; margin: 0 0 0.875rem;
    padding-bottom: 0.5rem; border-bottom: 1px solid #4b5563;
}
.form-panel .form-group:last-child { margin-bottom: 0; }
.form-hint { display: block; font-size: 0.75rem; color: #9ca3af; margin-top: 0.25rem; line-height: 1.4; }
.modal-dark .form-hint { color: #9ca3af; }

.logo-dropzone { display: block; cursor: pointer; }
.logo-preview {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.35rem;
    min-height: 7.5rem; padding: 1rem; border: 2px dashed #4b5563; border-radius: 0.75rem;
    background: #1f2937; color: #d1d5db; text-align: center; transition: border-color 0.2s, background 0.2s;
}
.logo-dropzone:hover .logo-preview { border-color: #2dd4bf; background: rgba(13, 148, 136, 0.08); }
.logo-preview-icon { font-size: 1.5rem; }
.logo-preview.has-image { padding: 0.5rem; border-style: solid; }
.logo-preview img {
    max-height: 6.5rem; max-width: 100%; object-fit: contain; border-radius: 0.5rem;
}

.doctor-toggle {
    display: flex; align-items: center; gap: 0.625rem;
    color: #e5e7eb; font-weight: 500; cursor: pointer;
}
.doctor-toggle input { width: 1rem; height: 1rem; accent-color: #14b8a6; }

.practice-row-identity { display: flex; align-items: center; gap: 0.75rem; }
.practice-row-logo {
    width: 2.25rem; height: 2.25rem; border-radius: 0.5rem; object-fit: cover;
    background: #374151; border: 1px solid #4b5563; flex-shrink: 0;
}
.practice-row-logo-fallback {
    display: inline-flex; align-items: center; justify-content: center; font-size: 1rem;
}
.practice-row-tagline { font-size: 0.75rem; color: #2dd4bf; margin-top: 0.125rem; }

.practice-view-brand { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.25rem; }
.practice-view-logo {
    width: 4.5rem; height: 4.5rem; object-fit: contain; border-radius: 0.75rem;
    background: #111827; border: 1px solid #4b5563; padding: 0.25rem;
}
.practice-view-tagline { margin: 0; color: #2dd4bf; font-style: italic; }
.practice-doctor-list { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; }
.practice-doctor-chip {
    display: flex; flex-direction: column; gap: 0.15rem;
    padding: 0.625rem 0.75rem; background: #374151; border: 1px solid #4b5563; border-radius: 0.5rem;
    font-size: 0.8125rem; min-width: 12rem;
}
.practice-doctor-chip span { color: #9ca3af; }

.specialty-sub-wrap { margin-bottom: 1.5rem; }
.specialty-sub-heading { margin-bottom: 1rem; }
.specialty-sub-heading h3 { margin: 0 0 0.25rem; color: #fff; font-size: 1.05rem; }
.specialty-sub-heading p { margin: 0; color: #9ca3af; font-size: 0.8125rem; }
.specialty-sub-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 1rem;
}
.specialty-sub-card {
    position: relative; overflow: hidden; text-align: left;
    width: 100%; font: inherit;
    padding: 1.15rem 1.1rem 1rem;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 1rem; color: #fff; cursor: pointer;
    background: #111827;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
    animation: specialtyCardIn 0.55s ease backwards;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.specialty-sub-card::before {
    content: '';
    position: absolute; inset: 0 auto auto 0; width: 100%; height: 4px;
    background: var(--accent);
}
.specialty-sub-card::after {
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(120% 90% at 0% 0%, var(--accent), transparent 58%);
    opacity: 0.28;
    pointer-events: none;
}
.specialty-sub-card-shine {
    position: absolute; top: -40%; left: -60%; width: 50%; height: 180%; z-index: 2;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.18), transparent);
    transform: rotate(20deg);
    animation: specialtyShine 3.8s ease-in-out infinite;
    pointer-events: none;
}
.specialty-sub-card:hover {
    transform: translateY(-6px) scale(1.015);
    border-color: var(--accent);
    box-shadow: 0 18px 32px rgba(0, 0, 0, 0.38);
}
.specialty-sub-card.is-active {
    border-color: var(--accent);
    box-shadow: 0 16px 30px rgba(0, 0, 0, 0.4), 0 0 0 2px var(--accent);
}
.specialty-sub-card-head,
.specialty-sub-metrics,
.specialty-sub-mrr,
.specialty-sub-practices { position: relative; z-index: 1; }
.specialty-sub-card-head { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.9rem; }
.specialty-sub-icon {
    width: 2.75rem; height: 2.75rem; border-radius: 0.85rem;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1.35rem; background: rgba(17, 24, 39, 0.7);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.12);
    position: relative; z-index: 1;
}
.specialty-sub-label { font-weight: 700; font-size: 0.95rem; }
.specialty-sub-count { font-size: 0.75rem; color: #d1d5db; }
.specialty-sub-metrics {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.4rem;
    margin-bottom: 0.75rem;
}
.specialty-sub-metrics div {
    background: rgba(17, 24, 39, 0.55); border-radius: 0.5rem; padding: 0.45rem 0.35rem;
    text-align: center; font-size: 0.65rem; color: #9ca3af; text-transform: uppercase; letter-spacing: 0.04em;
}
.specialty-sub-metrics span {
    display: block; color: #fff; font-size: 1rem; font-weight: 700; letter-spacing: 0; text-transform: none;
}
.specialty-sub-mrr {
    font-size: 0.75rem; font-weight: 600; color: var(--accent); margin-bottom: 0.65rem;
}
.specialty-sub-practices { display: flex; flex-direction: column; gap: 0.35rem; max-height: 7.5rem; overflow: auto; }
.specialty-sub-chip {
    display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem;
    background: rgba(17, 24, 39, 0.65); border-radius: 0.45rem; padding: 0.35rem 0.5rem;
    font-size: 0.75rem; color: #e5e7eb;
}
.specialty-sub-chip em { font-style: normal; color: #9ca3af; font-size: 0.65rem; white-space: nowrap; }
.specialty-sub-empty { font-size: 0.75rem; color: #6b7280; }

@keyframes specialtyCardIn {
    from { opacity: 0; transform: translateY(16px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes specialtyShine {
    0%, 55% { left: -60%; }
    80%, 100% { left: 140%; }
}

@media (max-width: 700px) {
    .specialty-sub-cards { grid-template-columns: 1fr; }
}
