/* =============================================
   PUSAT BEKAM RUQYAH - POS SYSTEM
   Natural Wellness Aesthetic
   ============================================= */

/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&display=swap');

/* =============================================
   CSS VARIABLES
   ============================================= */
:root {
    /* Primary Colors - Earthy Wellness Palette */
    --primary: #C4654A;
    --primary-dark: #A85540;
    --primary-light: #E8A090;
    --primary-subtle: #FDF5F3;

    /* Secondary - Sage Green */
    --secondary: #8B9A7D;
    --secondary-dark: #6B7A5D;
    --secondary-light: #B5C4A8;
    --secondary-subtle: #F5F7F3;

    /* Accent - Golden Sand */
    --accent: #D4A853;
    --accent-dark: #B8923F;
    --accent-light: #E8C97A;

    /* Neutrals */
    --bg-cream: #F9F6F1;
    --bg-warm: #F5F0E8;
    --bg-card: #FFFFFF;
    --text-dark: #3D2E2A;
    --text-medium: #6B5B54;
    --text-light: #9A8A82;
    --text-muted: #B8A89E;
    --border-light: #E8E2DB;
    --border-medium: #D4CBC2;

    /* Status Colors */
    --success: #5D9A6B;
    --success-light: #E8F5EB;
    --warning: #D4A853;
    --warning-light: #FFF8E8;
    --danger: #C4654A;
    --danger-light: #FDF5F3;
    --info: #5B8A9A;
    --info-light: #EBF5F8;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(61, 46, 42, 0.08);
    --shadow-md: 0 4px 12px rgba(61, 46, 42, 0.1);
    --shadow-lg: 0 8px 24px rgba(61, 46, 42, 0.12);
    --shadow-xl: 0 16px 48px rgba(61, 46, 42, 0.15);

    /* Typography */
    --font-display: 'Cormorant Garamond', Georgia, serif;
    --font-body: 'DM Sans', -apple-system, sans-serif;

    /* Spacing */
    --sidebar-width: 280px;
    --header-height: 72px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 400ms ease;
}

/* =============================================
   RESET & BASE
   ============================================= */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: 0.9375rem;
    font-weight: 400;
    line-height: 1.6;
    color: var(--text-dark);
    background: var(--bg-cream);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-warm);
}

::-webkit-scrollbar-thumb {
    background: var(--border-medium);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
}

/* =============================================
   TYPOGRAPHY
   ============================================= */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-dark);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

.display-title {
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.section-title {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-dark);
}

.subtitle {
    font-size: 0.875rem;
    color: var(--text-medium);
    font-weight: 400;
}

p {
    margin-bottom: 1rem;
}

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

a:hover {
    color: var(--primary-dark);
}

/* =============================================
   LAYOUT - APP SHELL
   ============================================= */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #3D2E2A 0%, #2A1F1C 100%);
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform var(--transition-base);
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.875rem;
}

.logo-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(196, 101, 74, 0.3);
}

.logo-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.logo-text {
    flex: 1;
}

.logo-text h1 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}

.logo-text span {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.5);
    font-weight: 400;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* Branch Selector */
.branch-selector {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.branch-selector label {
    display: block;
    font-size: 0.6875rem;
    color: rgba(255,255,255,0.4);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
}

.branch-dropdown {
    width: 100%;
    padding: 0.625rem 0.875rem;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-sm);
    color: #fff;
    font-family: var(--font-body);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.5)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
}

.branch-dropdown:hover,
.branch-dropdown:focus {
    background-color: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.2);
    outline: none;
}

.branch-dropdown option {
    background: var(--text-dark);
    color: #fff;
}

/* Navigation */
.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 1.5rem;
}

.nav-section-title {
    padding: 0.5rem 1.5rem;
    font-size: 0.6875rem;
    color: rgba(255,255,255,0.35);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.75rem 1.5rem;
    color: rgba(255,255,255,0.65);
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
}

.nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary);
    transform: scaleY(0);
    transition: transform var(--transition-fast);
}

.nav-item:hover {
    background: rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.9);
}

.nav-item.active {
    background: rgba(255,255,255,0.08);
    color: #fff;
}

.nav-item.active::before {
    transform: scaleY(1);
}

.nav-item .nav-icon {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    opacity: 0.8;
}

.nav-item.active .nav-icon {
    opacity: 1;
}

.nav-badge {
    margin-left: auto;
    padding: 0.125rem 0.5rem;
    background: var(--primary);
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 600;
    border-radius: 10px;
}

/* Sidebar Footer - User Info */
.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.08);
    background: rgba(0,0,0,0.15);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
}

.user-details {
    flex: 1;
}

.user-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: #fff;
}

.user-role {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.5);
}

.user-logout {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    border: none;
    color: rgba(255,255,255,0.5);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.user-logout:hover {
    background: var(--danger);
    color: #fff;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.main-header {
    height: var(--header-height);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-light);
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-light);
}

.breadcrumb a {
    color: var(--text-light);
}

.breadcrumb a:hover {
    color: var(--primary);
}

.breadcrumb .separator {
    color: var(--text-muted);
}

.breadcrumb .current {
    color: var(--text-dark);
    font-weight: 500;
}

.page-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-dark);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Search Bar */
.header-search {
    position: relative;
}

.header-search input {
    width: 280px;
    padding: 0.625rem 1rem 0.625rem 2.5rem;
    background: var(--bg-warm);
    border: 1px solid transparent;
    border-radius: var(--radius-lg);
    font-family: var(--font-body);
    font-size: 0.875rem;
    color: var(--text-dark);
    transition: all var(--transition-fast);
}

.header-search input:focus {
    outline: none;
    background: var(--bg-card);
    border-color: var(--primary-light);
    width: 320px;
    box-shadow: var(--shadow-md);
}

.header-search input::placeholder {
    color: var(--text-muted);
}

.header-search .search-icon {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

/* Header Icons */
.header-icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: var(--text-medium);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    position: relative;
    transition: all var(--transition-fast);
}

.header-icon-btn:hover {
    background: var(--bg-warm);
    color: var(--text-dark);
}

.header-icon-btn .badge {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 18px;
    height: 18px;
    background: var(--danger);
    color: #fff;
    font-size: 0.625rem;
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Date Display */
.header-date {
    padding: 0.5rem 1rem;
    background: var(--secondary-subtle);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--secondary-dark);
    font-weight: 500;
}

/* Content Area */
.content-area {
    flex: 1;
    padding: 2rem;
}

/* =============================================
   CARDS
   ============================================= */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: all var(--transition-base);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-warm);
}

.card-title {
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.card-title .icon {
    color: var(--primary);
}

.card-body {
    padding: 1.5rem;
}

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

/* Stat Cards */
.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    border: 1px solid var(--border-light);
    position: relative;
    overflow: hidden;
    transition: all var(--transition-base);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary);
}

.stat-card.secondary::before {
    background: var(--secondary);
}

.stat-card.accent::before {
    background: var(--accent);
}

.stat-card.info::before {
    background: var(--info);
}

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

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    background: var(--primary-subtle);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.stat-card.secondary .stat-icon {
    background: var(--secondary-subtle);
    color: var(--secondary);
}

.stat-card.accent .stat-icon {
    background: var(--warning-light);
    color: var(--accent);
}

.stat-card.info .stat-icon {
    background: var(--info-light);
    color: var(--info);
}

.stat-value {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-medium);
    font-weight: 500;
}

.stat-change {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8125rem;
    font-weight: 600;
    margin-top: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
}

.stat-change.positive {
    color: var(--success);
    background: var(--success-light);
}

.stat-change.negative {
    color: var(--danger);
    background: var(--danger-light);
}

/* =============================================
   GRID LAYOUTS
   ============================================= */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

/* =============================================
   BUTTONS
   ============================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(196, 101, 74, 0.3);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(196, 101, 74, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-dark) 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(139, 154, 125, 0.3);
}

.btn-secondary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(139, 154, 125, 0.4);
}

.btn-accent {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(212, 168, 83, 0.3);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover:not(:disabled) {
    background: var(--primary);
    color: #fff;
}

.btn-outline-secondary {
    background: transparent;
    border: 2px solid var(--secondary);
    color: var(--secondary);
}

.btn-outline-secondary:hover:not(:disabled) {
    background: var(--secondary);
    color: #fff;
}

.btn-ghost {
    background: transparent;
    color: var(--text-medium);
}

.btn-ghost:hover:not(:disabled) {
    background: var(--bg-warm);
    color: var(--text-dark);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-danger:hover:not(:disabled) {
    background: #B05540;
}

.btn-success {
    background: var(--success);
    color: #fff;
}

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

.btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--radius-sm);
}

.btn-group {
    display: flex;
    gap: 0.5rem;
}

/* =============================================
   FORMS
   ============================================= */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.form-label.required::after {
    content: '*';
    color: var(--danger);
    margin-left: 0.25rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    font-family: var(--font-body);
    font-size: 0.9375rem;
    color: var(--text-dark);
    background: var(--bg-card);
    border: 1.5px solid var(--border-medium);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-subtle);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-control:disabled {
    background: var(--bg-warm);
    cursor: not-allowed;
}

.form-control-sm {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

/* Select */
.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236B5B54' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
    cursor: pointer;
}

/* Checkbox & Radio */
.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
}

.form-check-input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

.form-check-label {
    font-size: 0.9375rem;
    color: var(--text-dark);
    cursor: pointer;
}

/* Input Group */
.input-group {
    display: flex;
    align-items: stretch;
}

.input-group .form-control {
    border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.input-group .btn {
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.input-group-text {
    padding: 0.75rem 1rem;
    background: var(--bg-warm);
    border: 1.5px solid var(--border-medium);
    border-right: none;
    border-radius: var(--radius-md) 0 0 var(--radius-md);
    color: var(--text-medium);
    font-size: 0.875rem;
}

.input-group .input-group-text + .form-control {
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

/* Form Row */
.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.form-row-3 {
    grid-template-columns: repeat(3, 1fr);
}

/* =============================================
   TABLES
   ============================================= */
.table-container {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 1rem 1.25rem;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

.table th {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-medium);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--bg-warm);
    position: sticky;
    top: 0;
}

.table td {
    font-size: 0.9375rem;
    color: var(--text-dark);
    vertical-align: middle;
}

.table tbody tr {
    transition: background var(--transition-fast);
}

.table tbody tr:hover {
    background: var(--bg-warm);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* Table Actions */
.table-actions {
    display: flex;
    gap: 0.5rem;
}

.table-actions .btn-icon {
    width: 32px;
    height: 32px;
    font-size: 1rem;
}

/* Customer Badge */
.customer-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.customer-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
    color: #fff;
}

.customer-avatar.male {
    background: linear-gradient(135deg, var(--info) 0%, #4A7A8A 100%);
}

.customer-avatar.female {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
}

.customer-name {
    font-weight: 600;
    color: var(--text-dark);
}

.customer-phone {
    font-size: 0.8125rem;
    color: var(--text-light);
}

/* =============================================
   STATUS BADGES
   ============================================= */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-lg);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.badge-success {
    background: var(--success-light);
    color: var(--success);
}

.badge-warning {
    background: var(--warning-light);
    color: var(--accent-dark);
}

.badge-danger {
    background: var(--danger-light);
    color: var(--danger);
}

.badge-info {
    background: var(--info-light);
    color: var(--info);
}

.badge-secondary {
    background: var(--bg-warm);
    color: var(--text-medium);
}

.badge-primary {
    background: var(--primary-subtle);
    color: var(--primary);
}

/* Status Dot */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.success { background: var(--success); }
.status-dot.warning { background: var(--accent); }
.status-dot.danger { background: var(--danger); }
.status-dot.info { background: var(--info); }

/* =============================================
   MODALS
   ============================================= */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(61, 46, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    opacity: 0;
    transition: opacity var(--transition-base);
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow: hidden;
    transform: translateY(20px) scale(0.95);
    transition: transform var(--transition-base);
    box-shadow: var(--shadow-xl);
}

.modal-overlay.active .modal {
    transform: translateY(0) scale(1);
}

.modal-lg {
    max-width: 800px;
}

.modal-xl {
    max-width: 1100px;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, var(--bg-warm) 0%, var(--bg-cream) 100%);
}

.modal-title {
    font-family: var(--font-display);
    font-size: 1.375rem;
    font-weight: 600;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.modal-title .icon {
    color: var(--primary);
}

.modal-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    color: var(--text-medium);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--danger);
    border-color: var(--danger);
    color: #fff;
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    max-height: calc(90vh - 140px);
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    background: var(--bg-warm);
}

/* =============================================
   CALENDAR
   ============================================= */
.calendar-container {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    overflow: hidden;
}

.calendar-header {
    padding: 1.25rem 1.5rem;
    background: var(--bg-warm);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.calendar-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-dark);
}

.calendar-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.calendar-nav-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    color: var(--text-medium);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.calendar-nav-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.calendar-day-header {
    padding: 0.75rem;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-medium);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--bg-cream);
    border-bottom: 1px solid var(--border-light);
}

.calendar-day {
    min-height: 120px;
    padding: 0.5rem;
    border-right: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.calendar-day:nth-child(7n) {
    border-right: none;
}

.calendar-day:hover {
    background: var(--bg-warm);
}

.calendar-day.other-month {
    background: var(--bg-cream);
}

.calendar-day.other-month .day-number {
    color: var(--text-muted);
}

.calendar-day.today {
    background: var(--primary-subtle);
}

.calendar-day.today .day-number {
    background: var(--primary);
    color: #fff;
}

.day-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.calendar-events {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.calendar-event {
    padding: 0.25rem 0.5rem;
    font-size: 0.6875rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    transition: transform var(--transition-fast);
}

.calendar-event:hover {
    transform: scale(1.02);
}

.calendar-event.booked {
    background: var(--info-light);
    color: var(--info);
    border-left: 3px solid var(--info);
}

.calendar-event.checkin {
    background: var(--warning-light);
    color: var(--accent-dark);
    border-left: 3px solid var(--accent);
}

.calendar-event.completed {
    background: var(--success-light);
    color: var(--success);
    border-left: 3px solid var(--success);
}

.calendar-event.cancelled {
    background: var(--danger-light);
    color: var(--danger);
    border-left: 3px solid var(--danger);
    text-decoration: line-through;
}

/* =============================================
   TABS
   ============================================= */
.tabs {
    display: flex;
    gap: 0.25rem;
    background: var(--bg-warm);
    padding: 0.375rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
}

.tab-btn {
    flex: 1;
    padding: 0.75rem 1rem;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-medium);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.tab-btn:hover {
    color: var(--text-dark);
    background: var(--bg-card);
}

.tab-btn.active {
    background: var(--bg-card);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* =============================================
   POS SPECIFIC STYLES
   ============================================= */
.pos-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 1.5rem;
    height: calc(100vh - var(--header-height) - 4rem);
}

.pos-products {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.pos-categories {
    display: flex;
    gap: 0.5rem;
    padding: 1rem 0;
    overflow-x: auto;
    flex-shrink: 0;
}

.category-btn {
    padding: 0.625rem 1.25rem;
    background: var(--bg-card);
    border: 1.5px solid var(--border-light);
    border-radius: var(--radius-lg);
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-medium);
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--transition-fast);
}

.category-btn:hover {
    border-color: var(--primary-light);
    color: var(--primary);
}

.category-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.pos-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
    overflow-y: auto;
    padding: 0.5rem;
    flex: 1;
}

.pos-item-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 1rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: center;
}

.pos-item-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}

.pos-item-card.selected {
    border-color: var(--primary);
    background: var(--primary-subtle);
}

.pos-item-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 0.75rem;
    background: var(--bg-warm);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
}

.pos-item-name {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
    font-size: 0.9375rem;
}

.pos-item-price {
    color: var(--primary);
    font-weight: 700;
    font-size: 1rem;
}

.pos-item-duration {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 0.25rem;
}

/* Cart */
.pos-cart {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.cart-header {
    padding: 1.25rem;
    background: var(--bg-warm);
    border-bottom: 1px solid var(--border-light);
}

.cart-customer {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.cart-customer:hover {
    box-shadow: var(--shadow-sm);
}

.cart-customer-placeholder {
    color: var(--text-muted);
    font-style: italic;
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-warm);
    border-radius: var(--radius-md);
    margin-bottom: 0.75rem;
}

.cart-item-info {
    flex: 1;
}

.cart-item-name {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--text-dark);
}

.cart-item-therapist {
    font-size: 0.8125rem;
    color: var(--text-light);
}

.cart-item-price {
    font-weight: 700;
    color: var(--primary);
}

.cart-item-remove {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--danger-light);
    border: none;
    color: var(--danger);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.cart-item-remove:hover {
    background: var(--danger);
    color: #fff;
}

.cart-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

.cart-empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.cart-summary {
    padding: 1rem 1.25rem;
    background: var(--bg-warm);
    border-top: 1px solid var(--border-light);
}

.cart-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.9375rem;
}

.cart-row.total {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-dark);
    padding-top: 0.75rem;
    border-top: 1px dashed var(--border-medium);
    margin-top: 0.5rem;
}

.cart-actions {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.cart-actions .btn {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
}

/* =============================================
   INVOICE PRINT STYLE
   ============================================= */
.invoice-preview {
    background: #fff;
    padding: 2rem;
    max-width: 400px;
    margin: 0 auto;
    font-family: 'Courier New', monospace;
}

.invoice-header {
    text-align: center;
    padding-bottom: 1rem;
    border-bottom: 2px dashed var(--border-medium);
    margin-bottom: 1rem;
}

.invoice-logo {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.invoice-branch {
    font-size: 0.875rem;
    color: var(--text-medium);
}

.invoice-details {
    font-size: 0.8125rem;
    margin-bottom: 1rem;
}

.invoice-items {
    margin-bottom: 1rem;
}

.invoice-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    padding: 0.5rem 0;
    border-bottom: 1px dotted var(--border-light);
}

.invoice-totals {
    border-top: 2px dashed var(--border-medium);
    padding-top: 1rem;
}

.invoice-total-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.invoice-total-row.grand {
    font-size: 1.125rem;
    font-weight: 700;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-medium);
}

.invoice-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 2px dashed var(--border-medium);
    font-size: 0.8125rem;
    color: var(--text-medium);
}

/* =============================================
   ALERTS & NOTIFICATIONS
   ============================================= */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.alert-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.alert-content {
    flex: 1;
}

.alert-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.alert-message {
    font-size: 0.875rem;
    opacity: 0.9;
}

.alert-success {
    background: var(--success-light);
    color: var(--success);
    border: 1px solid rgba(93, 154, 107, 0.2);
}

.alert-warning {
    background: var(--warning-light);
    color: var(--accent-dark);
    border: 1px solid rgba(212, 168, 83, 0.2);
}

.alert-danger {
    background: var(--danger-light);
    color: var(--danger);
    border: 1px solid rgba(196, 101, 74, 0.2);
}

.alert-info {
    background: var(--info-light);
    color: var(--info);
    border: 1px solid rgba(91, 138, 154, 0.2);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toast {
    padding: 1rem 1.25rem;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 320px;
    animation: slideInRight 0.3s ease;
    border-left: 4px solid var(--primary);
}

.toast.success { border-left-color: var(--success); }
.toast.warning { border-left-color: var(--accent); }
.toast.danger { border-left-color: var(--danger); }

.toast-icon {
    font-size: 1.25rem;
}

.toast.success .toast-icon { color: var(--success); }
.toast.warning .toast-icon { color: var(--accent); }
.toast.danger .toast-icon { color: var(--danger); }

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    font-size: 0.9375rem;
}

.toast-message {
    font-size: 0.8125rem;
    color: var(--text-medium);
}

.toast-close {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--bg-warm);
    border: none;
    color: var(--text-light);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    transition: all var(--transition-fast);
}

.toast-close:hover {
    background: var(--danger);
    color: #fff;
}

/* =============================================
   CHARTS & GRAPHS PLACEHOLDER
   ============================================= */
.chart-container {
    position: relative;
    height: 300px;
    background: linear-gradient(135deg, var(--bg-warm) 0%, var(--bg-cream) 100%);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.chart-placeholder {
    text-align: center;
    color: var(--text-muted);
}

.chart-placeholder-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    opacity: 0.5;
}

/* Simple Bar Chart */
.simple-bar-chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    height: 200px;
    padding: 1rem;
    gap: 0.5rem;
}

.bar-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    max-width: 60px;
}

.bar {
    width: 100%;
    background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    transition: height 0.5s ease;
    position: relative;
}

.bar:hover {
    opacity: 0.9;
}

.bar-value {
    position: absolute;
    top: -1.5rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-dark);
    white-space: nowrap;
}

.bar-label {
    margin-top: 0.5rem;
    font-size: 0.6875rem;
    color: var(--text-medium);
    text-align: center;
}

/* =============================================
   TIMELINE / ACTIVITY LOG
   ============================================= */
.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0.5rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-light);
}

.timeline-item {
    position: relative;
    padding-bottom: 1.5rem;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: -1.625rem;
    top: 0.25rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary);
    border: 2px solid var(--bg-card);
    box-shadow: 0 0 0 2px var(--primary-light);
}

.timeline-dot.secondary { background: var(--secondary); box-shadow: 0 0 0 2px var(--secondary-light); }
.timeline-dot.accent { background: var(--accent); box-shadow: 0 0 0 2px var(--accent-light); }

.timeline-time {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-bottom: 0.25rem;
}

.timeline-content {
    font-size: 0.9375rem;
    color: var(--text-dark);
}

.timeline-detail {
    font-size: 0.8125rem;
    color: var(--text-medium);
    margin-top: 0.25rem;
}

/* =============================================
   EMPTY STATES
   ============================================= */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-state-icon {
    font-size: 4rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.empty-state-description {
    color: var(--text-medium);
    max-width: 400px;
    margin: 0 auto 1.5rem;
}

/* =============================================
   LOADING STATES
   ============================================= */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.skeleton {
    background: linear-gradient(90deg, var(--bg-warm) 25%, var(--bg-cream) 50%, var(--bg-warm) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

.skeleton-text {
    height: 1rem;
    margin-bottom: 0.5rem;
}

.skeleton-title {
    height: 1.5rem;
    width: 60%;
    margin-bottom: 0.75rem;
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

/* =============================================
   PAGINATION
   ============================================= */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    margin-top: 1.5rem;
}

.page-btn {
    min-width: 36px;
    height: 36px;
    padding: 0 0.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-medium);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.page-btn:hover:not(:disabled) {
    background: var(--bg-warm);
    border-color: var(--primary-light);
    color: var(--primary);
}

.page-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-info {
    padding: 0 1rem;
    font-size: 0.875rem;
    color: var(--text-medium);
}

/* =============================================
   LOGIN PAGE
   ============================================= */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bg-cream) 0%, var(--bg-warm) 50%, var(--primary-subtle) 100%);
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -30%;
    width: 80%;
    height: 150%;
    background: radial-gradient(ellipse, rgba(196, 101, 74, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

.login-page::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -20%;
    width: 60%;
    height: 100%;
    background: radial-gradient(ellipse, rgba(139, 154, 125, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.login-container {
    width: 100%;
    max-width: 440px;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

.login-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
}

.login-header {
    padding: 2.5rem 2rem 2rem;
    text-align: center;
    background: linear-gradient(135deg, var(--bg-warm) 0%, var(--bg-cream) 100%);
    border-bottom: 1px solid var(--border-light);
}

.login-logo {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.25rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    box-shadow: 0 8px 24px rgba(196, 101, 74, 0.3);
}

.login-title {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
}

.login-subtitle {
    color: var(--text-medium);
    font-size: 0.9375rem;
}

.login-body {
    padding: 2rem;
}

.login-footer {
    padding: 1.25rem 2rem;
    background: var(--bg-warm);
    text-align: center;
    font-size: 0.8125rem;
    color: var(--text-light);
}

/* =============================================
   ANIMATIONS
   ============================================= */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Animate on scroll / load */
.animate-in {
    animation: slideInUp 0.4s ease forwards;
    opacity: 0;
}

.animate-delay-1 { animation-delay: 0.1s; }
.animate-delay-2 { animation-delay: 0.2s; }
.animate-delay-3 { animation-delay: 0.3s; }
.animate-delay-4 { animation-delay: 0.4s; }

/* =============================================
   UTILITIES
   ============================================= */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.text-primary { color: var(--primary); }
.text-secondary { color: var(--secondary); }
.text-success { color: var(--success); }
.text-warning { color: var(--accent); }
.text-danger { color: var(--danger); }
.text-muted { color: var(--text-muted); }

.bg-primary { background: var(--primary); }
.bg-secondary { background: var(--secondary); }
.bg-warm { background: var(--bg-warm); }

.fw-normal { font-weight: 400; }
.fw-medium { font-weight: 500; }
.fw-semibold { font-weight: 600; }
.fw-bold { font-weight: 700; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.p-0 { padding: 0; }
.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-grid { display: grid; }

.flex-1 { flex: 1; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

.align-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }

.w-100 { width: 100%; }
.h-100 { height: 100%; }

.rounded { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }

.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }

.cursor-pointer { cursor: pointer; }

.divider {
    height: 1px;
    background: var(--border-light);
    margin: 1.5rem 0;
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 1400px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .pos-layout {
        grid-template-columns: 1fr 360px;
    }
}

@media (max-width: 1200px) {
    :root {
        --sidebar-width: 260px;
    }

    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .pos-layout {
        grid-template-columns: 1fr;
        height: auto;
    }

    .pos-cart {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        max-height: 50vh;
        border-radius: var(--radius-xl) var(--radius-xl) 0 0;
        z-index: 100;
        transform: translateY(calc(100% - 60px));
        transition: transform var(--transition-base);
    }

    .pos-cart.open {
        transform: translateY(0);
    }

    .mobile-cart-toggle {
        display: flex;
    }

    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .content-area {
        padding: 1rem;
    }

    .main-header {
        padding: 0 1rem;
    }

    .header-search {
        display: none;
    }

    .stats-grid,
    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
    }

    .modal {
        margin: 1rem;
        max-height: calc(100vh - 2rem);
    }

    .calendar-day {
        min-height: 80px;
    }

    .calendar-event {
        font-size: 0.5625rem;
        padding: 0.125rem 0.25rem;
    }
}

@media (max-width: 576px) {
    .login-container {
        padding: 1rem;
    }

    .login-header,
    .login-body {
        padding: 1.5rem;
    }

    .page-title {
        font-size: 1.25rem;
    }

    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.8125rem;
    }

    .table th,
    .table td {
        padding: 0.75rem;
        font-size: 0.8125rem;
    }
}

/* =============================================
   PRINT STYLES
   ============================================= */
@media print {
    .sidebar,
    .main-header,
    .btn,
    .no-print {
        display: none !important;
    }

    .main-content {
        margin-left: 0;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }

    body {
        background: #fff;
    }
}

/* =============================================
   MEDICAL RECORDS
   ============================================= */
.medical-record-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    margin-bottom: 1rem;
    overflow: hidden;
    transition: all var(--transition-fast);
}

.medical-record-card:hover {
    box-shadow: var(--shadow-md);
}

.medical-record-header {
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, var(--primary-subtle) 0%, var(--bg-warm) 100%);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.medical-record-date {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.medical-record-date .date-icon {
    width: 40px;
    height: 40px;
    background: var(--primary);
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.medical-record-date .date-day {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
}

.medical-record-date .date-month {
    font-size: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.medical-record-date .date-info h4 {
    font-size: 1rem;
    margin-bottom: 0.125rem;
}

.medical-record-date .date-info span {
    font-size: 0.75rem;
    color: var(--text-light);
}

.medical-record-body {
    padding: 1.25rem;
}

.medical-section {
    margin-bottom: 1.25rem;
}

.medical-section:last-child {
    margin-bottom: 0;
}

.medical-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-light);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.medical-section-content {
    font-size: 0.9375rem;
    color: var(--text-dark);
    line-height: 1.6;
}

/* Bekam Points Diagram */
.bekam-points-container {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.body-diagram {
    position: relative;
    width: 180px;
    height: 280px;
    background: var(--bg-warm);
    border-radius: var(--radius-md);
    flex-shrink: 0;
    overflow: hidden;
}

.body-diagram svg {
    width: 100%;
    height: 100%;
}

.body-diagram .point {
    position: absolute;
    width: 16px;
    height: 16px;
    background: var(--primary);
    border: 2px solid #fff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(196, 101, 74, 0.4);
    transition: all var(--transition-fast);
}

.body-diagram .point:hover {
    transform: translate(-50%, -50%) scale(1.2);
    background: var(--primary-dark);
}

.body-diagram .point.sunnah {
    background: var(--secondary);
    box-shadow: 0 2px 4px rgba(139, 154, 125, 0.4);
}

.body-diagram .point.sunnah:hover {
    background: var(--secondary-dark);
}

.bekam-points-list {
    flex: 1;
}

.bekam-point-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0;
    border-bottom: 1px solid var(--border-light);
}

.bekam-point-item:last-child {
    border-bottom: none;
}

.bekam-point-number {
    width: 24px;
    height: 24px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
}

.bekam-point-number.sunnah {
    background: var(--secondary);
}

.bekam-point-info {
    flex: 1;
}

.bekam-point-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-dark);
}

.bekam-point-detail {
    font-size: 0.75rem;
    color: var(--text-light);
}

/* Treatment Notes */
.treatment-notes {
    background: var(--bg-warm);
    border-radius: var(--radius-md);
    padding: 1rem;
    border-left: 3px solid var(--primary);
}

.treatment-notes.warning {
    border-left-color: var(--accent);
    background: var(--warning-light);
}

.treatment-notes.success {
    border-left-color: var(--success);
    background: var(--success-light);
}

/* Vitals Grid */
.vitals-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.vital-item {
    background: var(--bg-warm);
    border-radius: var(--radius-md);
    padding: 0.875rem;
    text-align: center;
}

.vital-icon {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

.vital-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-dark);
}

.vital-label {
    font-size: 0.6875rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.vital-item.warning .vital-value {
    color: var(--accent-dark);
}

.vital-item.danger .vital-value {
    color: var(--danger);
}

/* Photo Attachments */
.photo-attachments {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.photo-thumbnail {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    border: 2px solid var(--border-light);
    transition: all var(--transition-fast);
}

.photo-thumbnail:hover {
    border-color: var(--primary);
    transform: scale(1.05);
}

.photo-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-add {
    width: 80px;
    height: 80px;
    border: 2px dashed var(--border-medium);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.photo-add:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-subtle);
}

.photo-add-icon {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.photo-add-text {
    font-size: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* Allergy & Warning Tags */
.medical-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.medical-tag {
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-lg);
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.medical-tag.allergy {
    background: var(--danger-light);
    color: var(--danger);
}

.medical-tag.condition {
    background: var(--warning-light);
    color: var(--accent-dark);
}

.medical-tag.note {
    background: var(--info-light);
    color: var(--info);
}

/* History Timeline for Medical */
.medical-timeline {
    position: relative;
    padding-left: 2.5rem;
}

.medical-timeline::before {
    content: '';
    position: absolute;
    left: 1rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, var(--primary) 0%, var(--border-light) 100%);
}

.medical-timeline-item {
    position: relative;
    padding-bottom: 1.5rem;
}

.medical-timeline-item:last-child {
    padding-bottom: 0;
}

.medical-timeline-dot {
    position: absolute;
    left: -1.75rem;
    top: 0;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary);
    border: 3px solid var(--bg-card);
    box-shadow: 0 0 0 2px var(--primary-light);
}

.medical-timeline-item:first-child .medical-timeline-dot {
    width: 22px;
    height: 22px;
    left: -1.85rem;
}

/* Login Logo Update */
.login-logo {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.login-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
