* { box-sizing: border-box; margin: 0; padding: 0; }
body { 
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; 
    background: #f5f6fa;
    color: #2c3e50;
    line-height: 1.6;
}

/* Layout */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 250px;
    height: 100vh;
    background: #2c3e50;
    color: white;
    padding: 0 0;
    overflow-y: auto;
}
.logo { text-align: center; margin-bottom: 30px; padding: 10px 20px;background: #ffffff; }
.menu { list-style: none; }
.menu li { margin: 5px 0; }
.menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    color: #bdc3c7;
    text-decoration: none;
    transition: all 0.3s;
}
.menu a:hover, .menu a.active {
    background: #34495e;
    color: white;
    border-left: 3px solid #3498db;
}
.menu img { filter: invert(0); }
.menu a:hover img, .menu a.active img { filter: invert(0); }

.content {
    margin-left: 250px;
    min-height: 100vh;
    padding: 20px;
}
.topbar {
    background: white;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: right;
    color: #7f8c8d;
}

/* Login */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #4CAF50 0%, #00b2ba 100%);
}
.login-box {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
}
.login-logo { display: block; margin: 0 auto 20px; }
.login-box h2 { text-align: center; margin-bottom: 30px; color: #2c3e50; }

/* Forms */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 5px; font-weight: 500; color: #555; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    transition: border 0.3s;
}
.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: #3498db;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    background: #95a5a6;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s;
}
.btn:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-primary { background: #3498db; }
.btn-success { background: #2ecc71; }
.btn-danger { background: #e74c3c; }
.btn-block { width: 100%; }
.btn-sm { padding: 5px 10px; font-size: 12px; }

/* Tables */
.table {
    width: 100%;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-collapse: collapse;
}
.table th, .table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #ecf0f1;
}
.table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #7f8c8d;
    text-transform: uppercase;
    font-size: 12px;
}
.table tr:hover { background: #f8f9fa; }
.table a { color: #181818; text-decoration: none; }

/* Dashboard Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}
.stat-card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    border-left: 4px solid #3498db;
}
.stat-card.money { border-left-color: #2ecc71; }
.stat-card h3 {
    font-size: 14px;
    color: #7f8c8d;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}
.stat-value {
    font-size: 32px;
    font-weight: bold;
    color: #2c3e50;
}

/* Status badges */
.status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}
.status-scheduled { background: #fff3cd; color: #856404; }
.status-confirmed { background: #d1ecf1; color: #0c5460; }
.status-completed { background: #d4edda; color: #155724; }
.status-cancelled { background: #f8d7da; color: #721c24; }
.status-no_show { background: #f5c6cb; color: #721c24; }

/* Patient Card */
.patient-header {
    background: white;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}
.patient-meta {
    margin-top: 10px;
    display: flex;
    gap: 20px;
    color: #7f8c8d;
    font-size: 14px;
}
.balance { font-weight: bold; }
.balance.positive { color: #2ecc71; }
.balance.negative { color: #e74c3c; }

/* Tabs */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #ecf0f1;
}
.tab-btn {
    padding: 10px 20px;
    background: none;
    border: none;
    cursor: pointer;
    color: #7f8c8d;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}
.tab-btn.active {
    color: #3498db;
    border-bottom-color: #3498db;
}
.tab-content { display: none; }
.tab-content.active { display: block; }

/* Treatment cards */
.treatment-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    border-left: 3px solid #3498db;
}
.treatment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-weight: 500;
}
.treatment-header .amount {
    color: #2ecc71;
    font-weight: bold;
}
.services {
    color: #3498db;
    margin-bottom: 10px;
    font-size: 14px;
}
.diagnosis {
    color: #555;
    font-size: 14px;
    background: #f8f9fa;
    padding: 10px;
    border-radius: 5px;
}

/* Search */
.search-box {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.search-box form { display: flex; gap: 10px; }
.search-input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}

/* Alerts */
.alert {
    padding: 12px;
    border-radius: 5px;
    margin-bottom: 20px;
    font-size: 14px;
}
.alert-error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

/* Responsive */
@media (max-width: 768px) {
    .sidebar { width: 100%; height: auto; position: relative; }
    .content { margin-left: 0; }
    .stats-grid { grid-template-columns: 1fr; }
}

.treatment-status {
    text-align: right;
}
.badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}
.badge-success { background: #d4edda; color: #155724; }
.badge-warning { background: #fff3cd; color: #856404; }
.badge-danger { background: #f8d7da; color: #721c24; }
.payment-info {
    font-size: 13px;
    color: #666;
    margin-left: 5px;
}
.payment-action {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #ddd;
}

/* Footer */
.app-footer {
    margin-left: 250px;
    margin-top: 40px;
    padding: 20px;
    background: white;
    border-top: 1px solid #ecf0f1;
    font-size: 13px;
    color: #7f8c8d;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.footer-left, .footer-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.app-name {
    font-weight: 600;
    color: #2c3e50;
}

.version {
    background: #ecf0f1;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    color: #7f8c8d;
    font-weight: normal;
}

.copyright {
    color: #95a5a6;
}

.developer {
    color: #bdc3c7;
    font-size: 12px;
}

.php-info {
    font-size: 11px;
    color: #bdc3c7;
    font-family: monospace;
}

/* Адаптивность футера */
@media (max-width: 768px) {
    .app-footer {
        margin-left: 0;
        text-align: center;
    }
    .footer-content {
        flex-direction: column;
    }
    .footer-left, .footer-right {
        flex-direction: column;
        gap: 5px;
    }
}