/* Offline font fallback (replaces Google Fonts Source Sans Pro) */
body, .main-sidebar, .main-header, .content-wrapper {
    font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
}

:root {
    --opd-primary: #343791;
    --opd-primary-dark: #252866;
    --opd-accent: #17a2b8;
    --opd-success: #28a745;
    --opd-warning: #ffc107;
    --opd-danger: #dc3545;
}

/* Sidebar branding */
.main-sidebar.sidebar-dark-primary {
    background: linear-gradient(180deg, var(--opd-primary) 0%, var(--opd-primary-dark) 100%) !important;
}

.brand-link {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    padding: 0.6rem 0.5rem;
}

.brand-link .brand-image {
    max-height: 42px;
    width: auto;
    border-radius: 4px;
    opacity: 1;
}

.brand-text {
    color: #fff !important;
    font-weight: 600 !important;
    font-size: 0.95rem;
}

/* Navbar */
.main-header {
    border-bottom: 1px solid #dee2e6;
}

.main-header .navbar-nav .nav-link {
    color: #495057;
}

/* Content area */
.content-wrapper {
    background: #f4f6f9;
}

.content-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #343a40;
}

/* AdminLTE small-box enhancements */
.small-box {
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.small-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.12);
}

.small-box .icon > i {
    font-size: 70px;
    top: 15px;
}

.small-box-footer {
    background: rgba(0, 0, 0, 0.08);
}

/* Cards */
.card {
    border-radius: 0.5rem;
    box-shadow: 0 0 1px rgba(0, 0, 0, 0.125), 0 1px 3px rgba(0, 0, 0, 0.08);
    border: none;
}

.card-header {
    background: #fff;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    font-weight: 600;
}

/* Tables */
.table thead th {
    border-top: none;
    background: #f8f9fa;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #6c757d;
}

/* Forms */
.form-control:focus {
    border-color: var(--opd-primary);
    box-shadow: 0 0 0 0.2rem rgba(52, 55, 145, 0.2);
}

.btn-primary {
    background-color: var(--opd-primary);
    border-color: var(--opd-primary);
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--opd-primary-dark);
    border-color: var(--opd-primary-dark);
}

/* SB Admin 2 compatibility - border-left cards still work */
.border-left-primary { border-left: 0.25rem solid var(--opd-primary) !important; }
.border-left-success { border-left: 0.25rem solid var(--opd-success) !important; }
.border-left-warning { border-left: 0.25rem solid var(--opd-warning) !important; }
.border-left-danger  { border-left: 0.25rem solid var(--opd-danger) !important; }
.border-left-info    { border-left: 0.25rem solid var(--opd-accent) !important; }

.text-gray-800 { color: #5a5c69 !important; }
.text-gray-300 { color: #dddfeb !important; }

/* Footer */
.main-footer {
    border-top: 1px solid #dee2e6;
    font-size: 0.875rem;
    color: #6c757d;
}

/* Login page */
.login-page {
    background: linear-gradient(135deg, #e8f4fd 0%, #f4f6f9 50%, #ffffff 100%);
    min-height: 100vh;
}

.login-box,
.register-box {
    width: 400px;
}

.login-logo img {
    max-height: 80px;
    margin-bottom: 0.5rem;
}

.login-logo a {
    color: var(--opd-primary);
    font-weight: 700;
    font-size: 1.4rem;
}

.login-card-body {
    border-radius: 0.5rem;
}

/* Landing page */
.opd-landing {
    min-height: 100vh;
    background: linear-gradient(135deg, #e8f4fd 0%, #ffffff 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.opd-landing-logo img {
    max-height: 100px;
    margin-bottom: 1rem;
}

.opd-landing-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(52, 55, 145, 0.15);
    padding: 2.5rem 3rem;
    text-align: center;
    z-index: 2;
    max-width: 420px;
    width: 90%;
}

.opd-landing-card h1 {
    color: var(--opd-primary);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.opd-landing-card .btn-login {
    display: block;
    width: 100%;
    padding: 0.75rem;
    margin: 0.5rem 0;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.opd-landing-card .btn-login:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(52, 55, 145, 0.3);
}

.opd-float-icon {
    position: absolute;
    opacity: 0.08;
    animation: opdFloat 20s linear infinite;
}

@keyframes opdFloat {
    0%   { transform: translateY(100vh) rotate(0deg); }
    100% { transform: translateY(-120vh) rotate(360deg); }
}

/* DataTables in AdminLTE */
.dataTables_wrapper .dataTables_filter input {
    border-radius: 0.25rem;
    border: 1px solid #ced4da;
    padding: 0.375rem 0.75rem;
}

/* Responsive sidebar */
@media (max-width: 991.98px) {
    .content-header h1 {
        font-size: 1.25rem;
    }
}

/* Patient registration (job) page */
.job-reg-card .card-header {
    background: linear-gradient(135deg, var(--opd-primary) 0%, var(--opd-primary-dark) 100%);
    color: #fff;
    border-radius: 0.5rem 0.5rem 0 0;
}

.job-reg-card .card-header h3,
.job-reg-card .card-header .card-title {
    color: #fff;
    margin: 0;
    font-size: 1rem;
}

.job-reg-card {
    border: none;
    margin-bottom: 1.25rem;
    box-shadow: 0 2px 8px rgba(52, 55, 145, 0.1);
}

.job-reg-card .card-body {
    background: #fafbfc;
}

/* Horizontal form: label left, input right */
.job-form-horizontal .form-group.row {
    margin-bottom: 0.65rem;
    align-items: center;
}

.job-form-horizontal .col-form-label {
    font-weight: 500;
    font-size: 0.9rem;
    color: #495057;
    padding-top: calc(0.375rem + 1px);
    padding-bottom: calc(0.375rem + 1px);
    text-align: right;
}

.job-form-horizontal .form-control,
.job-form-horizontal .custom-select {
    font-size: 0.9rem;
}

@media (max-width: 575.98px) {
    .job-form-horizontal .col-form-label {
        text-align: left;
        padding-bottom: 0.25rem;
    }
}

.job-bmi-box {
    background: linear-gradient(135deg, #e8f4fd, #f0f7ff);
    border: 1px solid #b8d4f0;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.job-bmi-box .title {
    margin: 0;
    font-weight: 600;
    color: var(--opd-primary);
    font-size: 0.95rem;
}

.job-form-actions {
    background: #fff;
    border-top: 2px solid var(--opd-primary);
    padding: 1rem;
    border-radius: 0 0 0.5rem 0.5rem;
    position: sticky;
    bottom: 0;
    z-index: 10;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.06);
}

.job-form-actions .btn-primary {
    min-width: 140px;
    padding: 0.6rem 1.5rem;
    font-weight: 600;
}

.job-section-icon {
    width: 28px;
    text-align: center;
    margin-right: 0.5rem;
    opacity: 0.9;
}

.job-patients-table thead th {
    background: var(--opd-primary);
    color: #fff;
    border-color: var(--opd-primary-dark);
    font-size: 0.8rem;
    white-space: nowrap;
}

.job-patients-table tbody tr:hover {
    background-color: #f0f4ff;
}

.job-token-badge {
    font-size: 0.85rem;
    padding: 0.35rem 0.6rem;
}
