        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        :root {
            --primary-color: #1e3a8a;
            --secondary-color: #3b82f6;
            --success-color: #10b981;
            --warning-color: #f59e0b;
            --danger-color: #ef4444;
            --dark: #1f2937;
            --light: #f9fafb;
        }

        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
            min-height: 100vh;
        }

        /* Login/Register Page */
        .auth-container {
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 100vh;
            padding: 20px;
        }

        .auth-box {
            background: white;
            padding: 40px;
            border-radius: 20px;
            box-shadow: 0 20px 60px rgba(0,0,0,0.1);
            width: 100%;
            max-width: 450px;
        }

        .logo {
            text-align: center;
            margin-bottom: 30px;
        }

        .logo h1 {
            color: var(--primary-color);
            font-size: 2em;
            margin-bottom: 10px;
        }

        .logo p {
            color: #6b7280;
            font-size: 14px;
        }

        .form-group {
            margin-bottom: 20px;
        }

        .form-group label {
            display: block;
            margin-bottom: 8px;
            color: var(--dark);
            font-weight: 500;
        }

        .form-group input, .form-group select, .form-group textarea {
            width: 100%;
            padding: 12px;
            border: 1px solid #e5e7eb;
            border-radius: 8px;
            font-size: 14px;
            transition: all 0.3s ease;
        }

        .form-group input:focus, .form-group select:focus {
            outline: none;
            border-color: var(--secondary-color);
            box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
        }

        .btn {
            padding: 12px 24px;
            border: none;
            border-radius: 8px;
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
            text-decoration: none;
            display: inline-block;
        }

        .btn-primary {
            background: var(--primary-color);
            color: white;
            width: 100%;
        }

        .btn-primary:hover {
            background: #1e40af;
            transform: translateY(-2px);
            box-shadow: 0 10px 20px rgba(30, 58, 138, 0.3);
        }

        .btn-secondary {
            background: #f3f4f6;
            color: var(--dark);
        }

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

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

        /* Main Application */
        .app-container {
            display: none;
            height: 100vh;
            background: white;
        }

        .top-nav {
            background: var(--primary-color);
            color: white;
            padding: 15px 30px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        }

        .nav-left {
            display: flex;
            align-items: center;
            gap: 30px;
        }

        .nav-brand {
            font-size: 1.5em;
            font-weight: bold;
        }

        .nav-menu {
            display: flex;
            gap: 20px;
        }

        .nav-item {
            color: white;
            text-decoration: none;
            padding: 8px 16px;
            border-radius: 6px;
            transition: background 0.3s;
        }

        .nav-item:hover, .nav-item.active {
            background: rgba(255,255,255,0.1);
        }

        .nav-right {
            display: flex;
            align-items: center;
            gap: 20px;
        }

        .user-info {
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .subscription-badge {
            background: var(--warning-color);
            color: white;
            padding: 4px 12px;
            border-radius: 20px;
            font-size: 12px;
            font-weight: bold;
        }

        .main-layout {
            display: flex;
            height: calc(100vh - 65px);
        }

        .sidebar {
            width: 320px;
            background: var(--light);
            border-right: 1px solid #e5e7eb;
            padding: 20px;
            overflow-y: auto;
            flex-shrink: 0;
        }

        .content-area {
            flex: 1;
            padding: 30px;
            overflow-y: auto;
            overflow-x: hidden;
            background: white;
            min-width: 0;
        }

        /* Sections */
        .section {
            display: none;
            animation: fadeIn 0.3s ease;
            width: 100%;
            max-width: 100%;
            overflow-x: hidden;
        }

        .section.active {
            display: block;
        }

        #patients.section {
            display: none;
        }

        #patients.section.active {
            display: flex;
        }

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

        /* Dashboard Cards */
        .dashboard-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
            gap: 20px;
            margin-bottom: 30px;
        }

        .dashboard-card {
            background: white;
            padding: 25px;
            border-radius: 12px;
            border: 1px solid #e5e7eb;
            transition: all 0.3s ease;
        }

        .dashboard-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 10px 30px rgba(0,0,0,0.1);
        }

        .card-icon {
            width: 50px;
            height: 50px;
            border-radius: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 24px;
            margin-bottom: 15px;
        }

        .card-icon.blue { background: #dbeafe; color: #2563eb; }
        .card-icon.green { background: #d1fae5; color: #059669; }
        .card-icon.yellow { background: #fed7aa; color: #ea580c; }
        .card-icon.purple { background: #e9d5ff; color: #9333ea; }

        .card-value {
            font-size: 32px;
            font-weight: bold;
            color: var(--dark);
            margin-bottom: 5px;
        }

        .card-label {
            color: #6b7280;
            font-size: 14px;
        }

        /* Client List */
        .client-list {
            background: white;
            border-radius: 12px;
            border: 1px solid #e5e7eb;
            overflow: hidden;
        }

        .client-item {
            padding: 15px;
            border-bottom: 1px solid #e5e7eb;
            cursor: pointer;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .client-item:hover {
            background: #f9fafb;
            padding-left: 25px;
        }

        .client-item.active {
            background: var(--secondary-color);
            color: white;
        }

        .client-avatar {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            background: var(--primary-color);
            color: white;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 600;
            font-size: 16px;
            flex-shrink: 0;
        }

        .client-item.active .client-avatar {
            background: white;
            color: var(--secondary-color);
        }

        .client-info {
            flex: 1;
            min-width: 0;
        }

        .client-name {
            font-weight: 600;
            margin-bottom: 5px;
        }

        .client-phone {
            font-size: 12px;
            color: #6b7280;
        }

        .client-item.active .client-phone {
            color: rgba(255,255,255,0.8);
        }

        /* Tooth Chart */
        .tooth-chart {
            background: white;
            padding: 30px;
            border-radius: 12px;
            border: 1px solid #e5e7eb;
            margin-bottom: 30px;
        }

        .jaw {
            display: flex;
            justify-content: center;
            margin: 20px 0;
            padding: 15px;
            background: #f9fafb;
            border-radius: 10px;
        }

        .tooth {
            width: 45px;
            height: 45px;
            margin: 0 4px;
            border: 2px solid #6b7280;
            border-radius: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            font-weight: bold;
            font-size: 13px;
            background: white;
            transition: all 0.3s ease;
        }

        .tooth:hover {
            transform: scale(1.15);
            box-shadow: 0 5px 15px rgba(0,0,0,0.2);
        }

        .tooth.healthy { background: #d1fae5; border-color: #10b981; }
        .tooth.cavity { background: #fed7aa; border-color: #f59e0b; }
        .tooth.filled { background: #dbeafe; border-color: #3b82f6; }
        .tooth.crown { background: #fecaca; border-color: #ef4444; }
        .tooth.missing { background: #f3f4f6; border-color: #9ca3af; opacity: 0.5; }
        .tooth.root-canal { background: #e9d5ff; border-color: #a855f7; }

        /* Pricing Plans */
        .pricing-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
            gap: 30px;
            margin-top: 30px;
        }

        .pricing-card {
            background: white;
            border: 2px solid #e5e7eb;
            border-radius: 16px;
            padding: 30px;
            text-align: center;
            transition: all 0.3s ease;
            position: relative;
        }

        .pricing-card.featured {
            border-color: var(--secondary-color);
            transform: scale(1.05);
            box-shadow: 0 20px 40px rgba(0,0,0,0.1);
        }

        .pricing-card.featured::before {
            content: 'Ամենահայտնի';
            position: absolute;
            top: -12px;
            left: 50%;
            transform: translateX(-50%);
            background: var(--secondary-color);
            color: white;
            padding: 4px 16px;
            border-radius: 20px;
            font-size: 12px;
            font-weight: bold;
        }

        .plan-name {
            font-size: 24px;
            font-weight: bold;
            color: var(--dark);
            margin-bottom: 10px;
        }

        .plan-price {
            font-size: 48px;
            font-weight: bold;
            color: var(--primary-color);
            margin-bottom: 5px;
        }

        .plan-price span {
            font-size: 16px;
            color: #6b7280;
        }

        .plan-features {
            list-style: none;
            margin: 30px 0;
            text-align: left;
        }

        .plan-features li {
            padding: 10px 0;
            border-bottom: 1px solid #f3f4f6;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .plan-features li:before {
            content: '✓';
            color: var(--success-color);
            font-weight: bold;
        }

        /* Modal */
        .modal {
            display: none;
            position: fixed;
            z-index: 1000;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0,0,0,0.5);
            animation: fadeIn 0.3s;
        }

        .modal-content {
            background-color: white;
            margin: 5% auto;
            padding: 30px;
            border-radius: 16px;
            width: 90%;
            max-width: 500px;
            animation: slideIn 0.3s;
        }

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

        .modal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
        }

        .modal-title {
            font-size: 20px;
            font-weight: bold;
            color: var(--dark);
        }

        .close {
            font-size: 28px;
            color: #9ca3af;
            cursor: pointer;
            background: none;
            border: none;
        }

        .close:hover {
            color: var(--dark);
        }

        /* Tables */
        .table-wrapper {
            overflow-x: auto;
            -webkit-overflow-scrolling: touch;
        }

        .data-table {
            width: 100%;
            background: white;
            border-radius: 12px;
            overflow: hidden;
            border: 1px solid #e5e7eb;
            min-width: 600px;
        }

        .data-table thead {
            background: #f9fafb;
        }

        .data-table th {
            padding: 15px;
            text-align: left;
            font-weight: 600;
            color: var(--dark);
            border-bottom: 1px solid #e5e7eb;
        }

        .data-table td {
            padding: 15px;
            border-bottom: 1px solid #f3f4f6;
        }

        .data-table tr:hover {
            background: #f9fafb;
        }

        /* Stats */
        .stats-row {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 20px;
            margin-bottom: 30px;
        }

        .stat-box {
            background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
            color: white;
            padding: 25px;
            border-radius: 12px;
            text-align: center;
        }

        .stat-number {
            font-size: 36px;
            font-weight: bold;
            margin-bottom: 5px;
        }

        .stat-label {
            font-size: 14px;
            opacity: 0.9;
        }

        /* Search Bar */
        .search-bar {
            position: relative;
            margin-bottom: 20px;
        }

        .search-bar input {
            width: 100%;
            padding: 12px 45px 12px 15px;
            border: 1px solid #e5e7eb;
            border-radius: 8px;
            font-size: 14px;
        }

        .search-bar button {
            position: absolute;
            right: 5px;
            top: 50%;
            transform: translateY(-50%);
            background: var(--secondary-color);
            color: white;
            border: none;
            padding: 8px 15px;
            border-radius: 6px;
            cursor: pointer;
        }

        /* Loading Spinner */
        .spinner {
            border: 3px solid #f3f4f6;
            border-top: 3px solid var(--secondary-color);
            border-radius: 50%;
            width: 40px;
            height: 40px;
            animation: spin 1s linear infinite;
            margin: 20px auto;
        }

        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }

        /* Mobile Menu Toggle */
        .mobile-menu-toggle {
            display: none;
            background: rgba(255, 255, 255, 0.2);
            border: none;
            color: white;
            font-size: 24px;
            cursor: pointer;
            padding: 8px 12px;
            border-radius: 6px;
            line-height: 1;
            transition: background 0.3s;
            z-index: 1001;
        }

        .mobile-menu-toggle:hover {
            background: rgba(255, 255, 255, 0.3);
        }

        .mobile-menu-toggle:active {
            background: rgba(255, 255, 255, 0.4);
        }

        /* Sidebar Toggle */
        .sidebar-toggle {
            background: var(--secondary-color);
            border: none;
            color: white;
            font-size: 16px;
            cursor: pointer;
            padding: 6px 12px;
            border-radius: 6px;
            transition: all 0.3s;
        }

        .sidebar-toggle:hover {
            background: var(--primary-color);
        }

        .sidebar-content {
            overflow: hidden;
            transition: max-height 0.3s ease, opacity 0.3s ease;
        }

        .sidebar-content.collapsed {
            max-height: 0 !important;
            opacity: 0;
        }

        /* Responsive */
        @media (max-width: 1024px) {
            .top-nav {
                padding: 15px 20px;
            }

            .nav-left {
                gap: 15px;
            }

            .nav-brand {
                font-size: 1.2em;
            }

            .nav-menu {
                gap: 10px;
            }

            .nav-item {
                padding: 6px 12px;
                font-size: 14px;
            }

            .subscription-badge {
                display: none;
            }

            .content-area {
                padding: 20px;
            }

            .dashboard-grid {
                grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            }

            .sidebar {
                width: 280px;
            }
        }

        @media (max-width: 768px) {
            .mobile-menu-toggle {
                display: block !important;
                order: -1;
            }

            .nav-left {
                gap: 15px;
            }

            .nav-menu {
                display: none;
                position: fixed;
                top: 65px;
                left: 0;
                right: 0;
                background: var(--primary-color);
                flex-direction: column;
                padding: 20px;
                box-shadow: 0 4px 6px rgba(0,0,0,0.1);
                z-index: 1000;
                gap: 0;
                animation: slideDown 0.3s ease;
            }

            .nav-menu.active {
                display: flex !important;
            }

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

            .nav-item {
                width: 100%;
                text-align: left;
                padding: 15px;
                border-bottom: 1px solid rgba(255,255,255,0.1);
            }

            .nav-right {
                gap: 10px;
            }

            .user-info span {
                display: none;
            }

            .main-layout {
                flex-direction: column;
                height: auto;
            }

            .sidebar {
                width: 100%;
                border-right: none;
                border-bottom: 1px solid #e5e7eb;
                max-height: 50vh;
                padding: 15px;
            }

            .content-area {
                padding: 15px;
                width: 100%;
                overflow-x: hidden;
            }

            /* Patients section specific */
            #patients {
                flex-direction: column;
                width: 100% !important;
            }

            #patients .sidebar {
                width: 100%;
                max-height: none;
            }

            #patients .sidebar-toggle {
                display: block !important;
            }

            #patients .sidebar-content {
                max-height: 400px;
            }

            #patients .content-area {
                width: 100%;
                min-height: 50vh;
            }

            .pricing-grid {
                grid-template-columns: 1fr;
            }

            .pricing-card.featured {
                transform: scale(1);
            }

            .dashboard-grid {
                grid-template-columns: 1fr;
            }

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

            .jaw {
                flex-wrap: wrap;
                gap: 5px;
            }

            .tooth {
                width: 35px;
                height: 35px;
                font-size: 11px;
                margin: 2px;
            }

            .data-table {
                font-size: 12px;
            }

            .data-table th,
            .data-table td {
                padding: 10px 5px;
            }

            .modal-content {
                width: 95%;
                margin: 10% auto;
                padding: 20px;
            }

            .tab-buttons {
                overflow-x: auto;
                flex-wrap: nowrap;
            }

            .tab-btn {
                padding: 8px 15px;
                font-size: 14px;
                white-space: nowrap;
            }

            .auth-box {
                padding: 30px 20px;
            }

            .toast-container {
                right: 10px;
                left: 10px;
            }

            .toast {
                min-width: auto;
                width: 100%;
            }

            .btn {
                padding: 10px 16px;
                font-size: 13px;
            }
        }

        @media (max-width: 480px) {
            .nav-brand {
                font-size: 0.9em;
            }

            .top-nav {
                padding: 10px 12px;
            }

            .nav-left {
                gap: 10px;
                flex: 1;
            }

            .mobile-menu-toggle {
                font-size: 20px;
                padding: 6px 10px;
                flex-shrink: 0;
            }

            .btn-secondary {
                padding: 8px 12px;
                font-size: 12px;
            }

            .card-value {
                font-size: 24px;
            }

            .stat-number {
                font-size: 28px;
            }

            .tooth {
                width: 30px;
                height: 30px;
                font-size: 10px;
                margin: 1px;
            }

            .tooth-chart {
                padding: 15px;
            }

            .jaw {
                padding: 10px;
            }

            h2 {
                font-size: 20px;
            }

            h3 {
                font-size: 18px;
            }

            .nav-menu {
                top: 50px;
            }
        }

        @media (max-width: 360px) {
            .nav-brand {
                font-size: 0.8em;
            }

            .mobile-menu-toggle {
                font-size: 18px;
                padding: 5px 8px;
            }

            .top-nav {
                padding: 8px 10px;
            }
        }

        .tab-buttons {
            display: flex;
            gap: 10px;
            margin-bottom: 20px;
            border-bottom: 2px solid #e5e7eb;
        }

        .tab-btn {
            padding: 10px 20px;
            background: none;
            border: none;
            color: #6b7280;
            cursor: pointer;
            font-weight: 500;
            border-bottom: 3px solid transparent;
            transition: all 0.3s;
        }

        .tab-btn.active {
            color: var(--primary-color);
            border-bottom-color: var(--primary-color);
        }

        .tab-content {
            display: none;
        }

        .tab-content.active {
            display: block;
        }

        /* Toast Notifications */
        .toast-container {
            position: fixed;
            top: 20px;
            right: 20px;
            z-index: 10000;
            display: flex;
            flex-direction: column;
            gap: 10px;
        }

        .toast {
            background: white;
            padding: 16px 20px;
            border-radius: 8px;
            box-shadow: 0 4px 12px rgba(0,0,0,0.15);
            display: flex;
            align-items: center;
            gap: 12px;
            min-width: 300px;
            animation: slideIn 0.3s ease;
        }

        @keyframes slideIn {
            from {
                transform: translateX(400px);
                opacity: 0;
            }
            to {
                transform: translateX(0);
                opacity: 1;
            }
        }

        @keyframes slideOut {
            from {
                transform: translateX(0);
                opacity: 1;
            }
            to {
                transform: translateX(400px);
                opacity: 0;
            }
        }

        .toast.success {
            border-left: 4px solid var(--success-color);
        }

        .toast.error {
            border-left: 4px solid var(--danger-color);
        }

        .toast.warning {
            border-left: 4px solid var(--warning-color);
        }

        .toast.info {
            border-left: 4px solid var(--secondary-color);
        }

        .toast-icon {
            font-size: 20px;
        }

        .toast-message {
            flex: 1;
            font-size: 14px;
            color: var(--dark);
        }

        .toast-close {
            background: none;
            border: none;
            font-size: 18px;
            color: #9ca3af;
            cursor: pointer;
            padding: 0;
            width: 20px;
            height: 20px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .toast-close:hover {
            color: var(--dark);
        }

        /* Loading Spinner */
        .loading-overlay {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0,0,0,0.5);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 9999;
        }

        .spinner {
            width: 50px;
            height: 50px;
            border: 4px solid #f3f4f6;
            border-top: 4px solid var(--primary-color);
            border-radius: 50%;
            animation: spin 1s linear infinite;
        }

        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }
