/* --------------------------------------------------
   Global Design Tokens
-------------------------------------------------- */
:root {
    --app-primary-blue: #007BFF;
    --app-dark-blue: #001F3F;

    --app-secondary-teal: #00C49F;
    --app-secondary-teal-alt: #00CED1;

    --app-accent-orange: #FF9500;

    --app-status-red: #D9534F;
    --app-status-green: #28A745;

    --app-bg-light: #F5F5F5;
    --app-card-bg: #FFFFFF;
    --app-border-light: #E0E0E0;
    --app-border-soft: #EFEFEF;

    --app-text-dark: #333333;
    --app-text-muted: #666666;
    --app-text-muted-soft: #777777;

    --app-radius-lg: 14px;
    --app-radius-sm: 8px;
    --app-radius-pill: 25px;

    --app-shadow-soft: 0 2px 4px rgba(0, 0, 0, 0.10);
    --app-shadow-medium: 0 4px 8px rgba(0, 0, 0, 0.12);
    --app-shadow-large: 0 18px 45px rgba(15, 23, 42, 0.12);

    /* Aliases */
    --app-primary: var(--app-primary-blue);
    --app-danger: var(--app-status-red);
    --app-success: var(--app-status-green);
    --app-gray-light: #f8f9fa;
    --app-shadow-small: var(--app-shadow-soft);
}

/* --------------------------------------------------
   Base Typography / Background
-------------------------------------------------- */

body {
    background-color: var(--app-bg-light);
    color: var(--app-text-dark);
    font-weight: 400;
}

a {
    color: var(--app-primary-blue);
    text-decoration: none;
}

a:hover,
a:focus {
    color: #0056b3;
    text-decoration: underline;
}

.right_col {
    height: auto !important;
}

/* --------------------------------------------------
   Buttons
-------------------------------------------------- */
/* PRIMARY */

.btn-primary {
    background-color: var(--app-primary);
    border-color: var(--app-primary);
    border-radius: var(--app-radius-lg);
    font-weight: 600;
    padding: 0.6rem 1.2rem;
    box-shadow: var(--app-shadow-soft);
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: #0065d1;
    border-color: #0065d1;
    box-shadow: var(--app-shadow-soft);
    /* SAME shadow */
}


/* SECONDARY – EXACT SAME BEHAVIOR */

.btn-secondary {
    background-color: var(--app-secondary, #79838b);
    border-color: var(--app-secondary, #79838b);
    border-radius: var(--app-radius-lg);
    font-weight: 600;
    padding: 0.6rem 1.2rem;
    box-shadow: var(--app-shadow-soft);
    color: #fff;
}

.btn-secondary:hover,
.btn-secondary:focus {
    background-color: var(--app-secondary-hover, var(--app-secondary, #5a6268));
    border-color: var(--app-secondary-hover, var(--app-secondary, #5a6268));
    box-shadow: var(--app-shadow-soft);
    /* NO visual growth */
    color: #fff;
}


/* OUTLINE VARIANTS */

.btn-outline-primary {
    color: var(--app-primary);
    border-color: var(--app-primary);
    border-radius: var(--app-radius-lg);
    font-weight: 600;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
    background-color: var(--app-primary);
    color: #fff;
}

.btn-outline-secondary {
    color: var(--app-secondary, #5a6268);
    border-color: var(--app-secondary, #5a6268);
    border-radius: var(--app-radius-lg);
    font-weight: 600;
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus {
    background-color: var(--app-secondary, #5a6268);
    color: #fff;
}


.btn-danger {
    background-color: var(--app-danger);
    border-color: var(--app-danger);
}

/* Teal button (special actions) */
.btn-teal {
    background-color: var(--app-secondary-teal);
    border-color: var(--app-secondary-teal);
    color: #fff;
    border-radius: var(--app-radius-pill);
    font-weight: 600;
    padding: 0.5rem 1.2rem;
    box-shadow: var(--app-shadow-soft);
}

.btn-teal:hover,
.btn-teal:focus {
    background-color: #00af88;
    border-color: #00af88;
    color: #fff;
}

/* Logout-style button in header */
.btn-logout {
    background-color: var(--app-primary);
    border-color: var(--app-primary);
    color: #fff;
    border-radius: var(--app-radius-pill);
    font-weight: 600;
    padding: 0.4rem 1.1rem;
    box-shadow: var(--app-shadow-soft);
    font-size: 0.9rem;
}

/* Pill outline button (e.g. "View All") */
.btn-view-all {
    border-radius: 999px;
    border: 1px solid var(--app-primary);
    color: var(--app-primary);
    background-color: #ffffff;
    font-weight: 600;
    padding: 5px 18px;
}

.btn-view-all:hover {
    background-color: var(--app-primary);
    color: #ffffff;
}


/* Make buttons match form-control height when side-by-side */
.input-group .btn,
.d-flex .btn {
    height: calc(1.5em + 0.75rem + 2px);
    /* exact Bootstrap form-control height */
    padding: 0.375rem 0.75rem;
    /* reset vertical padding */
    display: inline-flex;
    align-items: center;
    justify-content: center;
}



/* --------------------------------------------------
   Cards
-------------------------------------------------- */

.card {
    border-radius: var(--app-radius-lg);
    border: 1px solid #eee;
    box-shadow: var(--app-shadow-soft);
    background-color: var(--app-card-bg);
}

/* Generic elevated card */
.card.app-card {
    padding: 26px 20px 20px !important;
    margin-bottom: 1rem;
    background: #fff !important;
    border-radius: 16px !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05) !important;
    border-left: 6px solid var(--app-secondary-teal-alt) !important;
    transition: 0.2s;
}

/* Clinic card (index view) */
.card.app-clinic-card {
    border-left: 6px solid var(--app-secondary-teal-alt);
    padding: 1.25rem 1.25rem;
    margin-bottom: 1rem;
    box-shadow: var(--app-shadow-soft);
    transition: 0.2s;
}

.tile_stats_count:hover,
.app-clinic-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.08);
}

.app-card .small {
    font-weight: 600;
    color: #777 !important;
    letter-spacing: 0.5px;
}

.app-card .h2 {
    font-size: 2rem !important;
    font-weight: 700;
    margin: 10px 0 !important;
}

.app-card i {
    font-size: 28px;
    color: var(--app-primary) !important;
}

.app-clinic-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--app-primary);
    margin-bottom: 0.4rem;
}

.app-clinic-detail {
    font-size: 0.9rem;
    color: var(--app-text-muted);
    line-height: 1.6;
}

.app-clinic-detail-label {
    font-weight: 600;
    color: var(--app-text-dark);
    min-width: 60px;
}

/* Clinics grid & logo */
.clinics-grid {
    row-gap: 20px;
}

.clinic-logo-img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: var(--app-shadow-small);
}

.clinic-logo-placeholder {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background-color: var(--app-gray-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--app-primary);
    font-size: 22px;
    box-shadow: var(--app-shadow-small);
}

.app-clinic-id {
    font-size: 0.9rem;
    color: #999;
    white-space: nowrap;
}

/* --------------------------------------------------
   Headers / Top Bars
-------------------------------------------------- */

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 1.25rem;
    background-color: #fff;
    border-bottom: 1px solid var(--app-border-soft);
}

.app-header-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--app-text-dark);
}

.app-header-title span {
    color: var(--app-primary);
    font-weight: 700;
}

.app-header-buttons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.app-header-icon-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background-color: #F0F0F0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: var(--app-text-dark);
}

/* Section titles (e.g., "System Admins") */
.app-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--app-text-muted);
    margin-bottom: 6px;
}

/* --------------------------------------------------
   Forms / Inputs
-------------------------------------------------- */

.form-control {
    border-radius: var(--app-radius-lg);
    border-color: var(--app-border-light);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
    /*padding: 0.6rem 0.9rem;*/
    font-size: 1rem;
}

.form-control:focus {
    border-color: var(--app-secondary-teal);
    box-shadow: 0 0 0 0.2rem rgba(0, 196, 159, 0.25);
}

/* Input group styled like phone + country code box */
.app-input-group {
    display: flex;
    align-items: stretch;
    border-radius: var(--app-radius-lg);
    border: 1px solid var(--app-border-light);
    background-color: #fff;
    box-shadow: var(--app-shadow-soft);
    overflow: hidden;
    margin-bottom: 1.3rem;
}

.app-input-prefix {
    display: flex;
    align-items: center;
    padding: 0.75rem 0.9rem;
    border-right: 1px solid var(--app-border-light);
    font-weight: 600;
    color: #000;
    gap: 0.35rem;
}

.app-input-prefix-flag {
    font-size: 1.3rem;
}

.app-input-group .form-control {
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

/* Helper / terms text */
.app-terms-text {
    font-size: 0.87rem;
    color: var(--app-text-muted-soft);
    text-align: center;
}

.app-terms-text a,
.app-terms-link {
    color: var(--app-secondary-teal);
    font-weight: 700;
}

/* --------------------------------------------------
   Login Page Layout
-------------------------------------------------- */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: stretch;
    justify-content: center;
    background: linear-gradient(to bottom,
            rgba(255, 255, 255, 0.9),
            rgba(245, 245, 245, 0.95));
}

.login-wrapper {
    margin: auto;
    max-width: 420px;
    width: 100%;
    padding: 2rem 1.5rem 3rem;
}

.card.login-card {
    background-color: rgba(255, 255, 255, 0.97);
    border-radius: var(--app-radius-lg);
    padding: 2rem 1.75rem 2.25rem;
    text-align: center;
    box-shadow: var(--app-shadow-medium);
}

.login-icon-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: var(--app-secondary-teal);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.6rem;
    font-size: 2.3rem;
    color: #fff;
}

.login-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--app-dark-blue);
    margin-bottom: 0.4rem;
}

.login-subtitle {
    font-size: 0.95rem;
    color: var(--app-text-muted-soft);
    margin-bottom: 1.8rem;
}

/* --------------------------------------------------
   Search bar (pages using #search-form)
-------------------------------------------------- */

#search-form .input-group {
    width: 100%;
}

#search-form .input-group .form-control {
    border-radius: 999px 0 0 999px !important;
    border: 1px solid #d0d0d0 !important;
    border-right: none !important;
    background-color: #fff !important;
    box-shadow: none !important;
}

#search-form .input-group .btn-search {
    border-radius: 0 999px 999px 0 !important;
    border: 1px solid #d0d0d0 !important;
    border-left: none !important;
    background-color: #fff !important;
    color: var(--app-primary) !important;
    font-weight: 600;
    padding-inline: 1.4rem;
    height: 100%;
    box-shadow: none !important;
}

#search-form .input-group .btn-search:hover {
    background-color: var(--app-primary) !important;
    color: #fff !important;
}

#search-form input::placeholder {
    color: #999;
}

/* --------------------------------------------------
   Action Buttons (tables, clinic cards)
-------------------------------------------------- */

.app-action-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 !important;
    margin-left: 6px;
    border: none !important;
    box-shadow: var(--app-shadow-soft);
    transition: 0.2s;
}

.app-action-btn:hover {
    transform: translateY(-2px);
}

/* View (white with blue border) */
.app-btn-view {
    background: #ffffff !important;
    border: 2px solid var(--app-primary) !important;
    color: var(--app-primary) !important;
}

/* Assign Admin (solid teal) */
.app-btn-assign {
    background: var(--app-secondary-teal) !important;
    color: #ffffff !important;
}

/* Edit (solid blue) */
.app-btn-edit {
    background: var(--app-primary) !important;
    color: #ffffff !important;
}

/* Delete (red) */
.app-btn-delete {
    background: var(--app-danger) !important;
    color: #ffffff !important;
}

/* Fix icon colors inside action buttons */
.app-btn-view i {
    color: var(--app-primary) !important;
}

.app-btn-edit i,
.app-btn-assign i,
.app-btn-delete i {
    color: #ffffff !important;
}

/* Generic actions row for tables */
.app-actions-row,
.services-actions {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
}

/* --------------------------------------------------
   Statistic tiles + panel spacing
-------------------------------------------------- */

/* Remove default Gentelella gray line */
.tile_stats_count:before {
    border-left: none !important;
}

/* Tile layout & spacing */
.tile_count {
    width: 100%;
    margin-bottom: 25px !important;
    margin-left: 10px;
    padding: 10px 0 !important;
    gap: 20px !important;
    display: flex;
    flex-wrap: wrap;
}

/* Scope tile spacing to tile_count only */
.tile_count .col-md-3,
.tile_count .col-sm-6 {
    margin-bottom: 20px !important;
}

.tile_stats_count {
    background-color: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
    border: none;
    padding: 14px 18px;
    margin-right: 20px !important;
    margin-bottom: 20px !important;
    position: relative;
    border-left: 4px solid var(--app-secondary-teal-alt);
}

.tile_stats_count .count_top {
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #555;
    display: block;
    margin: 10px 0px;
    font-weight: 600;
}

.tile_stats_count .count_top a {
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #555;
    display: block;
    margin: 10px 0px;
    font-weight: 600;
    text-decoration: none;
}

.tile_stats_count .count_top i {
    margin-right: 4px;
    color: var(--app-primary);
    font-size: 1.2rem;
}

.tile_stats_count .count {
    font-size: 26px;
    font-weight: 700;
    color: var(--app-text-dark);
}

/* Panel styling */
.x_panel {
    margin-top: 25px !important;
    padding: 10px 20px 20px 20px !important;
    background-color: #ffffff;
    border-radius: 16px;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.x_title {
    border-bottom: 1px solid #f0f0f0;
    padding: 12px 15px 8px;
    margin-bottom: 15px !important;
}

.x_title h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--app-text-dark);
}

.x_title h2 small {
    font-weight: 400;
    color: #888;
}

.x_content {
    padding-bottom: 20px !important;
}

.x_content .table {
    margin-top: 10px !important;
}

/* Prevent panels / wrappers from jumping on hover */
.x_panel:hover,
.x_content:hover,
.table-responsive:hover {
    transform: none !important;
    box-shadow: none !important;
}

/* Remove internal scroll from Gentelella panels */
.x_panel,
.x_content,
.x_content table {
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
}

/* Remove scroll from 'projects' table container */
.table-responsive {
    overflow: visible !important;
}

/* --------------------------------------------------
   Global Modal Restyle
-------------------------------------------------- */

.modal-content {
    border-radius: 16px !important;
    border: none !important;
    box-shadow: var(--app-shadow-medium) !important;
    background-color: #ffffff !important;
}

.modal-header {
    border-bottom: 1px solid #f3f3f3 !important;
    padding: 1rem 1.5rem !important;
    align-items: center;
}

.modal-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--app-text-dark);
}

.modal-header .close {
    outline: none;
    opacity: 0.6;
}

.modal-header .close:hover {
    opacity: 1;
}

.modal-body {
    padding: 1.25rem 1.5rem 1rem !important;
}

.modal-footer {
    border-top: 0 !important;
    padding: 0 1.5rem 1.25rem !important;
}

.modal-body .form-group label {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.modal-body .form-control {
    border-radius: var(--app-radius-lg);
}

.modal-backdrop.show {
    opacity: 0.35;
}

/* --------------------------------------------------
   Select2 Theme
-------------------------------------------------- */

.select2-container .select2-selection--single {
    height: 48px !important;
    border-radius: var(--app-radius-lg) !important;
    border: 1px solid var(--app-border-light) !important;
    box-shadow: var(--app-shadow-soft) !important;
    display: flex !important;
    align-items: center !important;
}

.select2-container .select2-selection__rendered {
    line-height: 48px !important;
    padding-left: 14px !important;
    font-size: 1rem !important;
    color: var(--app-text-dark) !important;
}

.select2-container .select2-selection__arrow {
    height: 48px !important;
    right: 10px !important;
}

.select2-dropdown {
    border-radius: var(--app-radius-lg) !important;
    border: 1px solid #ddd !important;
}

.select2-container--default .select2-results__option--highlighted {
    background-color: var(--app-primary) !important;
    color: white !important;
}

.select2-container {
    width: 100% !important;
}

/* --------------------------------------------------
   Generic Table Layout (App Tables)
-------------------------------------------------- */

.app-table-wrapper {
    border-left: none !important;
    margin-top: 10px;
}

.table.app-table {
    margin-bottom: 0;
}

.table.app-table thead th {
    border-bottom: 1px solid #e9ecef;
    background-color: #f9fafb;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #888;
}

.table.app-table tbody td {
    border-top: none;
    vertical-align: middle;
    font-size: 0.9rem;
}

/* Zebra rows */
.table.app-table tbody tr:nth-child(even),
.table.table-striped tbody tr:nth-child(even),
.table.projects tbody tr:nth-child(even) {
    background-color: #fdfdfd;
}

/* Stable table hover: background only, no movement */
.table.app-table tbody tr:hover,
.table.table-striped tbody tr:hover,
.table.projects tbody tr:hover {
    background-color: #f5f9ff !important;
    transform: none !important;
    box-shadow: none !important;
}

/* --------------------------------------------------
   Status / ID Pills
-------------------------------------------------- */

.id-block {
    padding: 4px 10px;
    color: #fff !important;
    font-weight: 600;
    border-radius: 999px;
    display: inline-block;
    min-width: 34px;
    text-align: center;
    font-size: 0.8rem;
    /* Color comes from bg-* utility classes (bg-primary, bg-success, etc.) */
}

.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: lowercase;
    color: #fff;
}

.status-badge.bg-success {
    background-color: var(--app-status-green) !important;
}

.status-badge.bg-danger {
    background-color: var(--app-status-red) !important;
}

.status-badge.bg-warning {
    background-color: #f0ad4e !important;
}

.status-badge.bg-primary {
    background-color: var(--app-primary) !important;
}

/* --------------------------------------------------
   Misc
-------------------------------------------------- */

input[type="date"]::placeholder {
    color: #999 !important;
}

/* Clean, modern file input */
.custom-file-input {
    display: block;
    width: 100%;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid #ddd;
    background-color: #fff;
    font-size: 0.9rem;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.custom-file-input:hover {
    border-color: var(--app-primary);
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.08);
}

.custom-file-input::-webkit-file-upload-button {
    background: var(--app-primary);
    color: #fff;
    border: none;
    padding: 6px 14px;
    border-radius: 999px;
    margin-right: 10px;
    cursor: pointer;
}

.custom-file-input:hover::-webkit-file-upload-button {
    background: #005ec2;
}


/* ================================
   Services Calendar (FullCalendar)
   Bulletproof visibility pack
   ================================ */

/* Card wrapper (no inline styles needed) */
.svc-calendar-card {
    border-radius: 16px;
    border: none;
    box-shadow: var(--app-shadow-soft, 0 8px 24px rgba(0, 0, 0, .08));
}

.svc-calendar-wrapper {
    border-radius: 14px;
    overflow: hidden;
}

.svc-calendar {
    min-height: 720px;
}

/* FullCalendar root gets class "fc" on SAME element */
.svc-calendar.fc .fc-toolbar {
    margin-bottom: 14px !important;
}

.svc-calendar.fc .fc-button {
    border-radius: 10px !important;
    padding: .45rem .75rem !important;
    font-weight: 700 !important;
}

/* Day cell padding so events don’t feel cramped */
.svc-calendar.fc .fc-daygrid-day-frame {
    padding: 6px;
}

/* ================================
   Event card style (month/week/day)
   ================================ */

/* Apply to the actual event element */
.svc-calendar.fc .svc-event {
    border: none !important;
    border-radius: 12px !important;
    padding: 8px 10px !important;
    margin: 4px 0 !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .10) !important;
    font-weight: 500 !important;
    line-height: 1.2 !important;
    overflow: hidden !important;
}

/* Ensure inner text inherits and shows clearly */
.svc-calendar.fc .svc-event,
.svc-calendar.fc .svc-event .fc-event-main,
.svc-calendar.fc .svc-event .fc-event-time,
.svc-calendar.fc .svc-event .fc-event-title {
    color: inherit !important;
}

/* Wrap title instead of cutting it off */
.svc-calendar.fc .svc-event .fc-event-title-container,
.svc-calendar.fc .svc-event .fc-event-title {
    white-space: normal !important;
    overflow: visible !important;
}

/* Month view: stop “hairline” events */
.svc-calendar.fc .fc-daygrid-event {
    min-height: 36px !important;
}

/* Week/day view: readable blocks */
.svc-calendar.fc .fc-timegrid-event .fc-event-main {
    padding: 6px 8px !important;
}

/* “+x more” visibility */
.svc-calendar.fc .fc-daygrid-more-link {
    font-weight: 800 !important;
}

/* ================================
   Status colors (NO bootstrap vars)
   ================================ */

.svc-calendar.fc .svc-event.svc-primary {
    background: #0d6efd !important;
    color: #ffffff !important;
}

.svc-calendar.fc .svc-event.svc-success {
    background: #198754 !important;
    color: #ffffff !important;
}

.svc-calendar.fc .svc-event.svc-danger {
    background: #dc3545 !important;
    color: #ffffff !important;
}

.svc-calendar.fc .svc-event.svc-warning {
    background: #ffc107 !important;
    color: #111111 !important;
}

/* Optional: a left accent stripe for extra “pop” */
.svc-calendar.fc .svc-event::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 6px;
    background: rgba(255, 255, 255, .45);
}

.svc-calendar.fc .svc-event.svc-warning::before {
    background: rgba(0, 0, 0, .18);
}

/* Make sure absolute stripe works without breaking layout */
.svc-calendar.fc .svc-event {
    position: relative;
    padding-left: 14px !important;
}