/* ============================================
   TTRIPLE FITNESS - COMMON STYLES
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=DM+Serif+Display&display=swap');

:root {
    --sidebar-width: 260px;
    --sidebar-bg: #1a1a2e;
    --sidebar-text: #a4a6b3;
    --sidebar-active-bg: rgba(233, 69, 96, 0.15);
    --sidebar-active-text: #e94560;
    --sidebar-hover-bg: rgba(255, 255, 255, 0.05);
    --sidebar-section-text: #6c7293;
    --primary-color: #e94560;
    --primary-hover: #c73a52;
    --primary-light: rgba(233, 69, 96, 0.1);
    --secondary-color: #0f3460;
    --accent-color: #16213e;
    --bg-main: #f5f7fa;
    --bg-card: #ffffff;
    --text-primary: #2d3748;
    --text-secondary: #718096;
    --text-muted: #a0aec0;
    --border-color: #e2e8f0;
    --success: #48bb78;
    --warning: #ecc94b;
    --danger: #f56565;
    --info: #4299e1;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
    --radius: 0.5rem;
    --radius-lg: 0.75rem;
    --transition: all 0.3s ease;
}

* { box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-size: 0.875rem;
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: var(--text-primary);
}

a { color: var(--primary-color); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-hover); }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: #c1c1c1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #a1a1a1; }

/* Sidebar Navigation (shared by admin + vendor) */
.sidebar-nav { padding: 0.75rem 0; }

.sidebar-section {
    padding: 0.75rem 1.5rem 0.375rem;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--sidebar-section-text);
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 0.625rem 1.5rem;
    color: var(--sidebar-text);
    font-size: 0.8125rem;
    font-weight: 400;
    transition: var(--transition);
    gap: 0.75rem;
    border-left: 3px solid transparent;
    text-decoration: none;
}
.sidebar-link i { font-size: 1.125rem; width: 20px; text-align: center; }
.sidebar-link:hover {
    background: var(--sidebar-hover-bg);
    color: #fff;
    text-decoration: none;
}
.sidebar-link.active {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-active-text);
    border-left-color: var(--primary-color);
    font-weight: 500;
}

.sidebar-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: none;
    border: none;
    color: rgba(255,255,255,0.5);
    font-size: 1.125rem;
    cursor: pointer;
    padding: 0.25rem;
    z-index: 10;
    transition: var(--transition);
}
.sidebar-close:hover { color: #fff; }

/* Buttons */
.btn-primary { background-color: var(--primary-color); border-color: var(--primary-color); }
.btn-primary:hover, .btn-primary:focus { background-color: var(--primary-hover); border-color: var(--primary-hover); }
.btn-outline-primary { color: var(--primary-color); border-color: var(--primary-color); }
.btn-outline-primary:hover { background-color: var(--primary-color); border-color: var(--primary-color); }

/* Stat Cards */
.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}
.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}
.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}
.stat-card .stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.stat-card .stat-change {
    font-size: 0.75rem;
    font-weight: 600;
}
.stat-card .stat-change.positive { color: var(--success); }
.stat-card .stat-change.negative { color: var(--danger); }

/* Cards */
.card-custom {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}
.card-custom .card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
    font-weight: 600;
}
.card-custom .card-body { padding: 1.5rem; }

/* Tables */
.table-custom { border-collapse: separate; border-spacing: 0; }
.table-custom thead th {
    background: #f8fafc;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-color);
    padding: 0.875rem 1rem;
    white-space: nowrap;
}
.table-custom tbody td {
    padding: 0.875rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
}
.table-custom tbody tr:hover { background-color: #f8fafc; }

/* Status Badges */
.badge-status {
    padding: 0.35em 0.75em;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}
.badge-active { background: rgba(72, 187, 120, 0.1); color: #2f855a; }
.badge-inactive { background: rgba(160, 174, 192, 0.15); color: #718096; }
.badge-expired { background: rgba(245, 101, 101, 0.1); color: #c53030; }
.badge-suspended { background: rgba(237, 137, 54, 0.1); color: #c05621; }
.badge-paid { background: rgba(72, 187, 120, 0.1); color: #2f855a; }
.badge-partial { background: rgba(236, 201, 75, 0.15); color: #975a16; }
.badge-unpaid { background: rgba(245, 101, 101, 0.1); color: #c53030; }
.badge-overdue { background: rgba(229, 62, 62, 0.15); color: #9b2c2c; }

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}
.empty-state i {
    font-size: 3rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    display: block;
}
.empty-state h5 { color: var(--text-primary); margin-bottom: 0.5rem; }
.empty-state p { max-width: 400px; margin: 0 auto; }

/* Page Header */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}
.page-header h4 { margin: 0; font-weight: 700; }

/* Form Styles */
.form-label { font-weight: 500; color: var(--text-primary); font-size: 0.8125rem; margin-bottom: 0.375rem; }
.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.1);
}
.form-section {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}
.form-section-title {
    font-size: 1rem;
    font-weight: 600;
    padding-bottom: 0.75rem;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

/* Expiry Banner */
.expiry-banner {
    background: linear-gradient(135deg, #f56565, #e53e3e);
    color: white;
    padding: 0.75rem 1.5rem;
    text-align: center;
    font-weight: 500;
    font-size: 0.875rem;
    position: sticky;
    top: 0;
    z-index: 1050;
}
.expiry-banner a { color: #fff; text-decoration: underline; font-weight: 700; }

/* Login-as banner */
.login-as-banner {
    background: linear-gradient(135deg, #4299e1, #3182ce);
    color: white;
    padding: 0.5rem 1.5rem;
    text-align: center;
    font-size: 0.8125rem;
    position: sticky;
    top: 0;
    z-index: 1050;
}
.login-as-banner a { color: #fff; text-decoration: underline; font-weight: 600; }

/* Loader */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}
.page-loader.active { display: flex; }
.page-loader .spinner-border { width: 3rem; height: 3rem; color: var(--primary-color); }

/* Avatar */
.avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.avatar-sm { width: 32px; height: 32px; }
.avatar-lg { width: 60px; height: 60px; }
.avatar-xl { width: 80px; height: 80px; }
.avatar-placeholder {
    width: 40px; height: 40px; border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary-color);
    display: flex; align-items: center; justify-content: center;
    font-weight: 600; font-size: 0.875rem;
}

/* DataTables override */
.dataTables_wrapper .dataTables_filter input {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}
.dataTables_wrapper .dataTables_length select {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 0.25rem 0.5rem;
}
div.dataTables_wrapper div.dataTables_info { font-size: 0.8125rem; color: var(--text-secondary); }

/* Chart container */
.chart-container { position: relative; height: 300px; }

/* Toastr overrides */
.toast-success { background-color: var(--success) !important; }
.toast-error { background-color: var(--danger) !important; }
.toast-warning { background-color: var(--warning) !important; }
.toast-info { background-color: var(--info) !important; }

/* Responsive */
@media (max-width: 768px) {
    .page-header { flex-direction: column; align-items: flex-start; }
    .page-header > div:last-child { width: 100%; }
    .page-header .d-flex.gap-2 { flex-wrap: wrap; }
    .stat-card { padding: 1rem; }
    .stat-card .stat-value { font-size: 1.375rem; }
}

/* Stat card inner layout on very small screens */
@media (max-width: 400px) {
    .stat-card {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    .stat-card .stat-icon { flex-shrink: 0; }
}
