/**
 * AKT Clinic CMS - Main Stylesheet
 * A modern, professional UI for healthcare management
 * ============================================
 */

/* ============================================
   CSS Custom Properties (Design Tokens)
   ============================================ */
:root {
    /* Primary Colors - Teal/Cyan theme for healthcare */
    --akt-primary: #0891b2;
    --akt-primary-hover: #0e7490;
    --akt-primary-light: #ecfeff;
    --akt-primary-dark: #164e63;
    
    /* Secondary Colors */
    --akt-secondary: #64748b;
    --akt-secondary-hover: #475569;
    
    /* Accent Colors */
    --akt-success: #10b981;
    --akt-success-light: #d1fae5;
    --akt-danger: #ef4444;
    --akt-danger-light: #fee2e2;
    --akt-warning: #f59e0b;
    --akt-warning-light: #fef3c7;
    --akt-info: #3b82f6;
    --akt-info-light: #dbeafe;
    
    /* Neutrals */
    --akt-bg: #f8fafc;
    --akt-surface: #ffffff;
    --akt-border: #e2e8f0;
    --akt-text: #1e293b;
    --akt-text-muted: #64748b;
    --akt-text-light: #94a3b8;
    
    /* Shadows */
    --akt-shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --akt-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --akt-shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --akt-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    
    /* Layout */
    --akt-header-height: 64px;
    --akt-footer-height: 48px;
    --akt-radius: 0.5rem;
    --akt-radius-lg: 0.75rem;
    
    /* Typography */
    --akt-font: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ============================================
   Base Styles
   ============================================ */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--akt-font);
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--akt-text);
    background: var(--akt-bg);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   Layout Structure - Sticky Header/Footer
   ============================================ */
.akt-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.akt-header {
    position: sticky;
    top: 0;
    z-index: 1030;
    height: var(--akt-header-height);
    background: linear-gradient(135deg, var(--akt-primary-dark) 0%, var(--akt-primary) 100%);
    box-shadow: var(--akt-shadow-md);
}

.akt-main {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem 0;
}

.akt-footer {
    height: var(--akt-footer-height);
    background: var(--akt-surface);
    border-top: 1px solid var(--akt-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--akt-text-muted);
    font-size: 0.8125rem;
}

/* ============================================
   Navigation
   ============================================ */
.akt-header .navbar {
    padding: 0 1rem;
    height: 100%;
}

.akt-header .navbar-brand {
    padding: 0;
    margin-right: 1.5rem;
}

.akt-header .navbar-brand img {
    height: 44px;
    width: auto;
    filter: brightness(1.1);
}

.akt-header .nav-link {
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.5rem 0.875rem !important;
    border-radius: var(--akt-radius);
    transition: all 0.2s ease;
    color: rgba(255, 255, 255, 0.85) !important;
}

.akt-header .nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff !important;
}

.akt-header .nav-link.active {
    background: rgba(255, 255, 255, 0.15);
    color: #fff !important;
}

.akt-header .dropdown-menu {
    border: none;
    box-shadow: var(--akt-shadow-lg);
    border-radius: var(--akt-radius-lg);
    padding: 0.5rem;
    margin-top: 0.5rem;
}

.akt-header .dropdown-item {
    border-radius: var(--akt-radius);
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--akt-text);
}

.akt-header .dropdown-item:hover {
    background: var(--akt-primary-light);
    color: var(--akt-primary);
}

.akt-header .dropdown-item.active {
    background: var(--akt-primary);
    color: #fff;
}

.akt-user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.akt-user-name {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    font-size: 0.875rem;
    text-decoration: none;
    padding: 0.375rem 0.75rem;
    border-radius: var(--akt-radius);
    transition: all 0.2s ease;
}

.akt-user-name:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.akt-user-avatar {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
}

.akt-logout-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 0.8125rem;
    font-weight: 500;
    padding: 0.375rem 0.875rem;
    border-radius: var(--akt-radius);
    transition: all 0.2s ease;
}

.akt-logout-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    color: #fff;
}

/* ============================================
   Page Header
   ============================================ */
.akt-page-header {
    margin-bottom: 1.5rem;
}

.akt-page-header h4,
.akt-page-header h5 {
    font-weight: 600;
    color: var(--akt-text);
    margin: 0;
}

/* ============================================
   Cards
   ============================================ */
.card {
    border: 1px solid var(--akt-border);
    border-radius: var(--akt-radius-lg);
    box-shadow: var(--akt-shadow-sm);
    background: var(--akt-surface);
    overflow: hidden;
}

.card-header {
    background: var(--akt-bg);
    border-bottom: 1px solid var(--akt-border);
    padding: 1rem 1.25rem;
    font-weight: 600;
    font-size: 0.9375rem;
}

.card-body {
    padding: 1.25rem;
}

.card-footer {
    background: var(--akt-bg);
    border-top: 1px solid var(--akt-border);
    padding: 1rem 1.25rem;
}

/* Stat Cards */
.akt-stat-card {
    border: none;
    border-radius: var(--akt-radius-lg);
    box-shadow: var(--akt-shadow);
    transition: all 0.2s ease;
    overflow: hidden;
}

.akt-stat-card:hover {
    box-shadow: var(--akt-shadow-md);
    transform: translateY(-2px);
}

.akt-stat-card .card-body {
    padding: 1.25rem;
}

.akt-stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--akt-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.akt-stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
}

.akt-stat-card .stat-label {
    font-size: 0.8125rem;
    color: var(--akt-text-muted);
    font-weight: 500;
}

/* ============================================
   Alerts
   ============================================ */
.akt-alert {
    border: none;
    border-radius: var(--akt-radius-lg);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    box-shadow: var(--akt-shadow-sm);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.akt-alert-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.875rem;
}

.akt-alert-content {
    flex: 1;
    font-weight: 500;
}

.akt-alert-success {
    background: var(--akt-success-light);
    color: #065f46;
}

.akt-alert-success .akt-alert-icon {
    background: var(--akt-success);
    color: #fff;
}

.akt-alert-danger {
    background: var(--akt-danger-light);
    color: #991b1b;
}

.akt-alert-danger .akt-alert-icon {
    background: var(--akt-danger);
    color: #fff;
}

.akt-alert-warning {
    background: var(--akt-warning-light);
    color: #92400e;
}

.akt-alert-warning .akt-alert-icon {
    background: var(--akt-warning);
    color: #fff;
}

.akt-alert-info {
    background: var(--akt-info-light);
    color: #1e40af;
}

.akt-alert-info .akt-alert-icon {
    background: var(--akt-info);
    color: #fff;
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    border-radius: var(--akt-radius);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

.btn-primary {
    background: var(--akt-primary);
    border-color: var(--akt-primary);
}

.btn-primary:hover, .btn-primary:focus {
    background: var(--akt-primary-hover);
    border-color: var(--akt-primary-hover);
}

.btn-success {
    background: var(--akt-success);
    border-color: var(--akt-success);
}

.btn-danger {
    background: var(--akt-danger);
    border-color: var(--akt-danger);
}

.btn-outline-primary {
    color: var(--akt-primary);
    border-color: var(--akt-primary);
}

.btn-outline-primary:hover {
    background: var(--akt-primary);
    border-color: var(--akt-primary);
}

/* ============================================
   Forms
   ============================================ */
.form-label {
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--akt-text);
    margin-bottom: 0.375rem;
}

.form-control, .form-select {
    border: 1px solid var(--akt-border);
    border-radius: var(--akt-radius);
    padding: 0.5rem 0.875rem;
    font-size: 0.9375rem;
    transition: all 0.2s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--akt-primary);
    box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.1);
}

.form-text {
    font-size: 0.8125rem;
    color: var(--akt-text-muted);
}

.input-group-text {
    background: var(--akt-bg);
    border-color: var(--akt-border);
    color: var(--akt-text-muted);
}

/* ============================================
   Tables
   ============================================ */
.table {
    font-size: 0.875rem;
}
select {
min-width: 70px;    
}
.table thead th {
    background: var(--akt-primary-dark);
    color: #fff;
    font-weight: 600;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    padding: 0.875rem 1rem;
    border: none;
    white-space: nowrap;
}

.table tbody td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
    border-color: var(--akt-border);
}

.table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: rgba(0, 0, 0, 0.02);
}

.table-hover > tbody > tr:hover > * {
    background-color: var(--akt-primary-light);
}

/* DataTables Overrides */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
    font-size: 0.875rem;
    padding: 0.75rem 0;
}

.dataTables_wrapper .dataTables_filter input {
    border: 1px solid var(--akt-border);
    border-radius: var(--akt-radius);
    padding: 0.375rem 0.75rem;
}

.dataTables_wrapper .dataTables_length select {
    border: 1px solid var(--akt-border);
    border-radius: var(--akt-radius);
    padding: 0.375rem 0.5rem;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: var(--akt-radius) !important;
    margin: 0 2px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--akt-primary) !important;
    border-color: var(--akt-primary) !important;
    color: #fff !important;
}

/* ============================================
   Modals
   ============================================ */
.modal-content {
    border: none;
    border-radius: var(--akt-radius-lg);
    box-shadow: var(--akt-shadow-lg);
    overflow: hidden;
}

.modal-header {
    background: linear-gradient(135deg, var(--akt-primary-dark) 0%, var(--akt-primary) 100%);
    color: #fff;
    padding: 1rem 1.5rem;
    border: none;
}

.modal-header .modal-title {
    font-weight: 600;
    font-size: 1.125rem;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
    opacity: 0.8;
}

.modal-header .btn-close:hover {
    opacity: 1;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    background: var(--akt-bg);
    border-top: 1px solid var(--akt-border);
    padding: 1rem 1.5rem;
}

/* ============================================
   Badges
   ============================================ */
.badge {
    font-weight: 500;
    font-size: 0.75rem;
    padding: 0.375rem 0.625rem;
    border-radius: 9999px;
}

.badge.bg-success {
    background: var(--akt-success-light) !important;
    color: #065f46;
}

.badge.bg-danger {
    background: var(--akt-danger-light) !important;
    color: #991b1b;
}

.badge.bg-warning {
    background: var(--akt-warning-light) !important;
    color: #92400e;
}

.badge.bg-info {
    background: var(--akt-info-light) !important;
    color: #1e40af;
}

.badge.bg-secondary {
    background: #e2e8f0 !important;
    color: var(--akt-secondary);
}

.badge.bg-primary {
    background: var(--akt-primary-light) !important;
    color: var(--akt-primary-dark);
}

/* ============================================
   Select2 Overrides
   ============================================ */
.select2-container--bootstrap-5 .select2-selection {
    border-color: var(--akt-border);
    border-radius: var(--akt-radius);
}

.select2-container--bootstrap-5 .select2-selection--single {
    height: calc(2.5rem + 2px);
    padding: 0.5rem 0.875rem;
}

.select2-container--bootstrap-5 .select2-dropdown {
    border-color: var(--akt-border);
    border-radius: var(--akt-radius);
    box-shadow: var(--akt-shadow-lg);
}

.select2-invalid .select2-selection {
    border-color: var(--akt-danger) !important;
    box-shadow: 0 0 0 0.25rem rgba(239, 68, 68, 0.25);
}

/* ============================================
   Utility Classes
   ============================================ */
.text-primary { color: var(--akt-primary) !important; }
.text-success { color: var(--akt-success) !important; }
.text-danger { color: var(--akt-danger) !important; }
.text-warning { color: var(--akt-warning) !important; }
.text-muted { color: var(--akt-text-muted) !important; }

.bg-primary-light { background: var(--akt-primary-light) !important; }
.bg-success-light { background: var(--akt-success-light) !important; }
.bg-danger-light { background: var(--akt-danger-light) !important; }
.bg-warning-light { background: var(--akt-warning-light) !important; }
.bg-info-light { background: var(--akt-info-light) !important; }

.shadow-sm { box-shadow: var(--akt-shadow-sm) !important; }
.shadow { box-shadow: var(--akt-shadow) !important; }
.shadow-md { box-shadow: var(--akt-shadow-md) !important; }
.shadow-lg { box-shadow: var(--akt-shadow-lg) !important; }

/* ============================================
   Login Page
   ============================================ */
.akt-login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--akt-primary-dark) 0%, var(--akt-primary) 50%, #06b6d4 100%);
    padding: 2rem;
}

.akt-login-card {
    width: 100%;
    max-width: 420px;
    background: var(--akt-surface);
    border-radius: var(--akt-radius-lg);
    box-shadow: var(--akt-shadow-lg);
    overflow: hidden;
}

.akt-login-header {
    background: var(--akt-surface);
    padding: 2rem;
    text-align: center;
    border-bottom: 1px solid var(--akt-border);
}

.akt-login-body {
    padding: 2rem;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 991.98px) {
    .akt-header .navbar-collapse {
        background: var(--akt-primary-dark);
        padding: 1rem;
        margin: 0.5rem -1rem -0.5rem;
        border-radius: var(--akt-radius);
    }
    
    .akt-user-menu {
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 767.98px) {
    .akt-main {
        padding: 1rem 0;
    }
    
    .container, .container-fluid {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    .akt-header, .akt-footer, .btn, .dataTables_filter, .dataTables_length, .dataTables_paginate {
        display: none !important;
    }
    
    .akt-main {
        padding: 0;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

