:root {
    --primary: #0ea5e9;
    --primary-dark: #0284c7;
    --secondary: #6366f1;
    --accent: #14b8a6;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --dark-bg: #0f172a;
    --dark-surface: #1e293b;
    --sidebar-bg: #0b1120;
    --light-text: #f8fafc;
    --gray-text: #94a3b8;
    --border-color: rgba(255, 255, 255, 0.1);

    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background-color: var(--dark-bg);
    color: var(--light-text);
    overflow: hidden;
}

.demo-container {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.logo-section {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
}

.logo-icon {
    font-size: 1.8rem;
}

.logo-text {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 700;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--gray-text);
    text-decoration: none;
    transition: all 0.3s;
    cursor: pointer;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--light-text);
}

.nav-item.active {
    background: rgba(14, 165, 233, 0.1);
    color: var(--primary);
    border-left-color: var(--primary);
}

.nav-item .icon {
    font-size: 1.2rem;
    width: 24px;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-details strong {
    font-size: 0.9rem;
}

.user-details span {
    font-size: 0.75rem;
    color: var(--gray-text);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.top-bar {
    padding: 20px 30px;
    background: var(--dark-surface);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.search-bar {
    flex: 1;
    max-width: 500px;
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 15px;
    opacity: 0.5;
}

.search-bar input {
    width: 100%;
    padding: 10px 15px 10px 45px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--light-text);
    font-family: inherit;
}

.search-bar input:focus {
    outline: none;
    border-color: var(--primary);
}

.top-actions {
    display: flex;
    gap: 10px;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    cursor: pointer;
    font-size: 1.2rem;
    transition: 0.3s;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Module Views */
.module-view {
    display: none;
    padding: 30px;
    overflow-y: auto;
    flex: 1;
}

.module-view.active {
    display: block;
}

.module-header {
    margin-bottom: 30px;
}

.module-header h1 {
    font-size: 2rem;
    margin-bottom: 5px;
}

.module-header p {
    color: var(--gray-text);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--dark-surface);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    display: flex;
    gap: 15px;
    align-items: center;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-icon.blue {
    background: rgba(14, 165, 233, 0.2);
}

.stat-icon.green {
    background: rgba(16, 185, 129, 0.2);
}

.stat-icon.purple {
    background: rgba(99, 102, 241, 0.2);
}

.stat-icon.orange {
    background: rgba(245, 158, 11, 0.2);
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--gray-text);
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 5px 0;
}

.stat-change {
    font-size: 0.8rem;
}

.stat-change.positive {
    color: var(--success);
}

.stat-change.negative {
    color: var(--warning);
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.dashboard-card {
    background: var(--dark-surface);
    padding: 25px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.dashboard-card h3 {
    margin-bottom: 20px;
    font-size: 1.2rem;
}

/* Appointments */
.appointment-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.appointment-item {
    display: grid;
    grid-template-columns: 60px 1fr auto;
    gap: 15px;
    align-items: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
}

.time {
    font-weight: 600;
    color: var(--primary);
}

.appointment-details {
    display: flex;
    flex-direction: column;
}

.appointment-details strong {
    margin-bottom: 3px;
}

.appointment-details span {
    font-size: 0.85rem;
    color: var(--gray-text);
}

.status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status.pending {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
}

.status.completed {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

/* Chart */
.chart-container {
    height: 200px;
}

.bar-chart-demo {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    height: 100%;
    gap: 10px;
}

.bar {
    flex: 1;
    background: linear-gradient(to top, var(--primary), var(--secondary));
    border-radius: 4px 4px 0 0;
    position: relative;
    min-height: 20%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 10px;
}

.bar-label {
    position: absolute;
    bottom: -25px;
    font-size: 0.75rem;
    color: var(--gray-text);
    white-space: nowrap;
}

/* Tables */
.table-container {
    background: var(--dark-surface);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.table-actions {
    padding: 20px;
    display: flex;
    gap: 15px;
    border-bottom: 1px solid var(--border-color);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.03);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table td {
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
}

.data-table tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-large {
    width: 100%;
    padding: 15px;
    font-size: 1.1rem;
}

.btn-icon {
    background: transparent;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px;
}

.search-input {
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--light-text);
    font-family: inherit;
}

.filter-select {
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--light-text);
    font-family: inherit;
}

/* Patient Detail */
.patient-detail {
    background: var(--dark-surface);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.patient-header {
    padding: 30px;
    display: flex;
    gap: 20px;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.patient-photo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(14, 165, 233, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
}

.patient-info {
    flex: 1;
}

.patient-info h2 {
    margin-bottom: 5px;
}

.patient-info p {
    color: var(--gray-text);
    margin: 3px 0;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 5px;
    padding: 20px 30px 0;
    border-bottom: 1px solid var(--border-color);
}

.tab {
    padding: 10px 20px;
    background: transparent;
    border: none;
    color: var(--gray-text);
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: 0.3s;
}

.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* Timeline */
.timeline {
    padding: 30px;
}

.timeline-item {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 20px;
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 1px solid var(--border-color);
}

.timeline-item:last-child {
    border-bottom: none;
}

.timeline-date {
    color: var(--gray-text);
    font-size: 0.9rem;
}

.timeline-content h4 {
    margin-bottom: 5px;
}

.timeline-content p {
    color: var(--gray-text);
    margin: 5px 0;
    font-size: 0.9rem;
}

.tags {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.tag {
    padding: 4px 10px;
    background: rgba(14, 165, 233, 0.2);
    color: var(--primary);
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Calendar */
.calendar-view {
    background: var(--dark-surface);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    padding: 30px;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
    transition: 0.3s;
    position: relative;
}

.calendar-day.header {
    background: transparent;
    font-weight: 600;
    color: var(--gray-text);
    cursor: default;
}

.calendar-day:not(.header):hover {
    background: rgba(255, 255, 255, 0.08);
}

.calendar-day.today {
    background: var(--primary);
    color: white;
    font-weight: 700;
}

.badge-count {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 18px;
    height: 18px;
    background: var(--warning);
    border-radius: 50%;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Inventory Alerts */
.inventory-alerts {
    margin-bottom: 20px;
}

.alert {
    padding: 15px 20px;
    border-radius: 8px;
    border-left: 4px solid;
}

.alert.warning {
    background: rgba(245, 158, 11, 0.1);
    border-color: var(--warning);
    color: var(--warning);
}

/* Badges */
.badge {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge.success {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.badge.warning {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
}

/* POS */
.pos-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
}

.pos-left,
.pos-right {
    background: var(--dark-surface);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    padding: 25px;
}

.pos-left h3,
.pos-right h3 {
    margin-bottom: 20px;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.product-card {
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: 0.3s;
    border: 2px solid transparent;
}

.product-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary);
}

.product-icon {
    font-size: 2rem;
}

.product-name {
    font-size: 0.85rem;
    text-align: center;
}

.product-price {
    font-weight: 700;
    color: var(--primary);
}

.ticket {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.ticket-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.ticket-divider {
    height: 1px;
    background: var(--border-color);
    margin: 15px 0;
}

.ticket-total {
    display: flex;
    justify-content: space-between;
    font-size: 1.2rem;
    font-weight: 700;
}

/* Reports */
.reports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
}

.report-card {
    background: var(--dark-surface);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    padding: 25px;
}

.report-card h3 {
    margin-bottom: 20px;
}

.line-chart {
    height: 150px;
    margin-bottom: 20px;
}

.chart-svg {
    width: 100%;
    height: 100%;
}

.report-value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.report-change {
    font-size: 0.9rem;
}

.report-change.positive {
    color: var(--success);
}

.service-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.service-item {
    display: grid;
    grid-template-columns: 150px 1fr 50px;
    gap: 15px;
    align-items: center;
}

.progress-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.progress {
    height: 100%;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    border-radius: 4px;
}

/* Demo Notice */
.demo-notice {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--dark-surface);
    padding: 15px 25px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 1000;
}

.demo-notice a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.demo-notice a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .pos-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 70px;
    }

    .sidebar .logo-text,
    .nav-item span:not(.icon),
    .user-details {
        display: none;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}