:root {
    --bg: #f5f8ff;
    --surface: #ffffff;
    --surface-soft: #f8fbff;
    --text: #1f2937;
    --muted: #64748b;
    --border: #e2e8f0;
    --primary: #2563eb;
    --accent: #7c3aed;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
    --radius: 16px;
}

body {
    background: radial-gradient(circle at 10% 0%, #eef4ff 0%, #f6f9ff 32%, #f7f9fc 100%);
    color: var(--text);
    font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main.container {
    max-width: 1360px;
    flex: 1 0 auto;
    width: 100%;
}

.card,
.section-card,
.form-card {
    border: 1px solid rgba(37, 99, 235, 0.08);
    box-shadow: var(--shadow);
    border-radius: var(--radius);
    background: var(--surface);
}

.dashboard-card {
    border: 1px solid rgba(124, 58, 237, 0.1);
    background: linear-gradient(180deg, #ffffff, #f8fbff);
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.page-header h4,
.page-header h5 {
    font-weight: 700;
    margin: 0;
}

.toolbar-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.btn {
    border-radius: 11px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary,
.primary-button {
    border: 0;
    background: linear-gradient(135deg, var(--primary), #1d4ed8);
    box-shadow: 0 10px 22px rgba(37, 99, 235, 0.28);
}

.btn-primary:hover,
.primary-button:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
}

.btn-outline-primary {
    border-color: #b6cbff;
    color: #1e40af;
    background: #f0f6ff;
}

.btn-outline-secondary {
    border-color: #d7dfec;
    color: #334155;
    background: #f8fafc;
}

.secondary-button {
    border: 1px solid #d7dfec;
    color: #334155;
    background: #f8fafc;
}

.btn-danger,
.danger-button {
    border: 0;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    box-shadow: 0 10px 20px rgba(239, 68, 68, 0.24);
}

.form-control,
.form-select,
.input-group-text {
    border-radius: 10px;
    border-color: var(--border);
}

.form-control,
.form-select {
    min-height: 44px;
}

.form-control:focus,
.form-select:focus {
    border-color: #93c5fd;
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.15);
}

.modern-table .table,
.table {
    border-collapse: separate;
    border-spacing: 0;
}

.modern-table .table thead th,
.table thead th {
    background: #f3f7ff;
    color: #334155;
    font-weight: 700;
    border-bottom: 1px solid #dce6f7;
}

.modern-table .table tbody tr,
.table tbody tr {
    transition: background-color 0.15s ease;
}

.modern-table .table tbody tr:hover,
.table tbody tr:hover {
    background: #f8fbff;
}

.status-badge {
    padding: 0.4rem 0.65rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.75rem;
}

.status-programata { background: #fff6d8; color: #a16207; }
.status-confirmata { background: #dcfce7; color: #166534; }
.status-neconfirmata { background: #f1f5f9; color: #334155; }
.status-preluat { background: #fef3c7; color: #92400e; }
.status-anulata { background: #fee2e2; color: #991b1b; }
.status-finalizata { background: #dbeafe; color: #1d4ed8; }
.status-client_nu_a_venit { background: #eef2ff; color: #4338ca; }

.quick-action-button {
    min-width: 180px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.stat-card {
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.stat-card h3 {
    font-size: 1.85rem;
    margin: 0;
    font-weight: 800;
}

.stat-card .kpi-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}

.filter-tabs .btn {
    border-radius: 999px;
    padding: 0.5rem 0.95rem;
}

.segmented-control {
    background: #eff4ff;
    border-radius: 999px;
    padding: 0.2rem;
    display: inline-flex;
    gap: 0.25rem;
}

.segmented-control .form-check {
    margin: 0;
    padding: 0;
}

.segmented-control .form-check-input {
    display: none;
}

.segmented-control .form-check-label {
    border-radius: 999px;
    padding: 0.45rem 0.9rem;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
}

.segmented-control .form-check-input:checked + .form-check-label {
    background: #ffffff;
    color: #1e3a8a;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.hero-gradient {
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 45%, #3b82f6 100%);
    color: #fff;
    position: relative;
    overflow: hidden;
}

.hero-gradient::before {
    content: "";
    position: absolute;
    width: 320px;
    height: 320px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    top: -120px;
    right: -90px;
}

.hero-gradient::after {
    content: "";
    position: absolute;
    width: 240px;
    height: 240px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    bottom: -90px;
    left: -70px;
}

.hero-gradient > * {
    position: relative;
    z-index: 1;
}

.soft-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    background: #eef4ff;
    color: #1f4fd8;
    font-size: .85rem;
    font-weight: 600;
}

.feature-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: #eef4ff;
    color: #1f4fd8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
}

.color-card {
    border: 1px solid rgba(37, 99, 235, 0.08);
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    transition: transform .2s ease, box-shadow .2s ease;
}

.color-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 30px rgba(18, 38, 63, 0.12);
}

.tint-blue { background: linear-gradient(180deg, #ffffff 0%, #eef4ff 100%); }
.tint-green { background: linear-gradient(180deg, #ffffff 0%, #ecfdf3 100%); }
.tint-violet { background: linear-gradient(180deg, #ffffff 0%, #f4efff 100%); }
.tint-orange { background: linear-gradient(180deg, #ffffff 0%, #fff5e8 100%); }

.navbar {
    backdrop-filter: blur(10px);
}

.navbar-brand {
    font-weight: 800 !important;
    letter-spacing: 0.2px;
}

/* Logo ca pe site-ul public (modern-style.css) — fara intindere; desktop + mobil */
.navbar-brand.navbar-brand--logo {
    flex: 0 1 auto;
    min-width: 0;
    max-width: min(168px, 38vw);
    overflow: visible;
    white-space: normal;
    text-overflow: clip;
    padding-top: 0.3rem;
    padding-bottom: 0.3rem;
    margin-right: 0.5rem;
    font-weight: 700;
}

.navbar-brand-logo {
    display: block;
    width: auto;
    height: auto;
    max-height: 38px;
    max-width: 100%;
    object-fit: contain;
    object-position: left center;
}

.navbar-light .nav-link {
    color: rgba(33, 37, 41, 0.75) !important;
}

.navbar .nav-link {
    border-radius: 8px;
    padding: 0.4rem 0.7rem !important;
    font-weight: 500;
}

.navbar-light .nav-link:hover,
.navbar-light .nav-link.active {
    background: rgba(15, 23, 42, 0.06);
    color: #1f4fd8 !important;
}

@media (max-width: 991.98px) {
    .navbar-brand.navbar-brand--logo {
        max-width: min(calc(100vw - 4.25rem), 220px);
        margin-right: 0.25rem;
    }

    .navbar-brand-logo {
        max-height: 32px;
        max-width: 100%;
    }
}

@media (max-width: 575.98px) {
    .navbar-brand.navbar-brand--logo {
        max-width: min(calc(100vw - 3.85rem), 190px);
    }

    .navbar-brand-logo {
        max-height: 28px;
        max-width: 100%;
    }
}

.modal-content {
    border: 0;
    border-radius: 16px;
    box-shadow: 0 18px 44px rgba(15, 23, 42, 0.18);
}

.alert {
    border: 0;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.08);
}

.table-responsive {
    border-radius: 12px;
    border: 1px solid #e7edf9;
    background: #fff;
}

.table-responsive .table {
    margin-bottom: 0;
}

.form-label {
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.35rem;
}

.page-toolbar .btn,
.toolbar-actions .btn {
    min-height: 42px;
}

.toolbar-actions .btn-sm {
    min-height: 36px;
}

.js-status-select,
.js-appointment-status {
    min-width: 170px;
    border-radius: 10px;
}

.loading-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: #64748b;
    font-weight: 500;
}

.loading-inline .spinner-border {
    width: 1rem;
    height: 1rem;
    border-width: 0.15rem;
}

.status-badge {
    white-space: nowrap;
}

.form-card .row > [class*="col-"] {
    margin-bottom: 0.05rem;
}

.empty-state {
    border: 1px dashed #c7d6f2;
    border-radius: 14px;
    padding: 1.2rem;
    text-align: center;
    color: var(--muted);
    background: #f8fbff;
    margin: 0.4rem;
}

.empty-state i {
    font-size: 1.4rem;
    display: inline-block;
    margin-bottom: 0.35rem;
}

.fc-theme-standard td,
.fc-theme-standard th {
    border-color: #e3ebf9;
}

.fc .fc-button-primary {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    border: 0;
}

.fc .fc-button-primary:disabled {
    background: #94a3b8;
}

.fc .fc-toolbar-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1f2937;
}

.fc-event {
    border: 0 !important;
    border-radius: 8px !important;
    padding: 1px 4px !important;
}

/* Mobile-first safety net */
@media (max-width: 991.98px) {
    main.container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table {
        min-width: 700px;
    }

    .modal-dialog {
        margin: 0.5rem;
    }

    .fc .fc-toolbar {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .fc .fc-button {
        padding: 0.35rem 0.6rem;
        font-size: 0.86rem;
    }
}

/* Lista zi: filtre specialist + data + X inline, aceeasi inaltime ca inainte */
.page-toolbar--day-list {
    align-items: center !important;
}

.day-list-filters {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.day-list-filters .form-select,
.day-list-filters .form-control {
    width: auto !important;
    flex: 0 1 auto;
}

.day-list-filters .form-select {
    min-width: 11rem;
    max-width: 18rem;
}

.day-list-filters input[type="date"].form-control {
    min-width: 9.25rem;
    max-width: 11rem;
    flex: 0 0 auto;
}

.day-list-filters #dayListClearSpecialist {
    flex: 0 0 auto;
    min-width: 2.25rem;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    line-height: 1;
}

@media (max-width: 767.98px) {
    .page-toolbar {
        align-items: stretch !important;
        gap: 0.5rem;
    }

    .page-toolbar:not(.page-toolbar--day-list) > * {
        width: 100%;
    }

    .page-toolbar--day-list .day-list-toolbar-title {
        width: 100%;
    }

    .page-toolbar--day-list .day-list-filters {
        width: 100%;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 2px;
        scrollbar-width: thin;
    }

    .page-toolbar--day-list .day-list-filters .form-select {
        flex: 1 1 7.5rem;
        min-width: 7.25rem;
        max-width: none;
    }

    .toolbar-actions {
        width: 100%;
    }

    .toolbar-actions .btn,
    .toolbar-actions .form-select,
    .toolbar-actions .form-control {
        width: 100%;
    }

    .segmented-control {
        width: 100%;
    }

    .segmented-control .form-check-label {
        width: 100%;
        text-align: center;
    }

    .stat-card h3 {
        font-size: 1.5rem;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .js-status-select,
    .js-appointment-status {
        min-width: 140px;
    }

    .page-toolbar:not(.page-toolbar--day-list) .form-select.w-auto {
        width: 100% !important;
    }

    .app-footer {
        padding: 0.85rem 0 1rem;
    }

    .app-footer .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .footer-card {
        padding: 0.75rem 0.85rem 0.85rem;
        text-align: center;
    }

    .footer-line1 {
        font-size: 0.8125rem;
        margin-bottom: 0.2rem;
        line-height: 1.35;
    }

    .footer-line2 {
        font-size: 0.8125rem;
        margin-bottom: 0.65rem;
        line-height: 1.35;
    }

    .footer-button {
        width: 100%;
        justify-content: center;
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }
}

/* Footer SaaS discret (Notion / Stripe vibe) */
@keyframes app-footer-enter {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.app-footer {
    flex-shrink: 0;
    margin-top: auto;
    padding: 1.5rem 0 1.75rem;
    border-top: 1px solid rgba(15, 23, 42, 0.06);
    background: transparent;
}

/* Aceeasi latime ca main.container / cardurile din pagina */
.app-footer .container {
    max-width: 1360px;
}

.footer-card {
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    padding: 1.15rem 1.25rem 1.2rem;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 16px;
    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.04),
        0 8px 24px rgba(15, 23, 42, 0.06);
    opacity: 0;
    animation: app-footer-enter 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.08s forwards;
    transition:
        transform 0.28s ease,
        box-shadow 0.28s ease;
    will-change: transform;
}

.footer-card:hover {
    transform: translateY(-3px);
    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.05),
        0 12px 32px rgba(15, 23, 42, 0.09);
}

.footer-line1 {
    margin: 0 0 0.35rem;
    font-size: 0.875rem;
    font-weight: 400;
    line-height: 1.45;
    color: #64748b;
    letter-spacing: 0.01em;
}

.footer-brand {
    font-weight: 500;
    color: #475569;
}

.footer-line2 {
    margin: 0 0 0.95rem;
    font-size: 0.875rem;
    font-weight: 400;
    line-height: 1.45;
    color: #475569;
    letter-spacing: 0.01em;
}

.footer-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.55rem 1.35rem;
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    text-decoration: none;
    color: #fff !important;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 42%, #2563eb 100%);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.12) inset,
        0 4px 14px rgba(79, 70, 229, 0.22);
    transition:
        transform 0.22s cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 0.28s ease;
}

.footer-button:hover {
    color: #fff !important;
    transform: translateY(-2px);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.15) inset,
        0 8px 28px rgba(99, 102, 241, 0.38),
        0 0 0 1px rgba(255, 255, 255, 0.08) inset,
        0 0 40px rgba(37, 99, 235, 0.15);
}

.footer-button:active {
    transform: translateY(0);
}

.footer-button__icon {
    font-size: 0.8em;
    opacity: 0.9;
}

@media (prefers-reduced-motion: reduce) {
    .footer-card {
        animation: none;
        opacity: 1;
    }

    .footer-card:hover {
        transform: none;
    }

    .footer-button,
    .footer-button:hover {
        transition: none;
        transform: none;
    }
}
