/* Admin Panel Styles */

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    color: #333;
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #2c2a88, #3d7644);
}

.login-box {
    background: white;
    padding: 3rem;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
}

.login-box h1 {
    text-align: center;
    color: #2c2a88;
    margin-bottom: 2rem;
    font-size: 2rem;
}

/* Admin Layout */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    background: #2c2a88;
    color: white;
    padding: 2rem 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    padding: 0 1.5rem 2rem;
    border-bottom: 1px solid #3d7644;
    margin-bottom: 2rem;
}

.sidebar-header h2 {
    color: #a8d4ae;
    font-size: 1.3rem;
}

.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav a {
    display: block;
    color: white;
    text-decoration: none;
    padding: 1rem 1.5rem;
    transition: background-color 0.3s ease;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background-color: #3d7644;
    border-right: 3px solid #a8d4ae;
}

.sidebar-nav i {
    margin-right: 0.5rem;
    width: 20px;
}

.main-content {
    flex: 1;
    margin-left: 250px;
    padding: 2rem;
}

.admin-header {
    background: white;
    padding: 1rem 2rem;
    margin: -2rem -2rem 2rem -2rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-header h1 {
    color: #2c2a88;
    font-size: 1.8rem;
}

.admin-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.admin-user span {
    color: #666;
}

.admin-user a {
    color: #dc3545;
    text-decoration: none;
    font-weight: 500;
}

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

.dashboard-card {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-align: center;
}

.dashboard-card h3 {
    font-size: 2.5rem;
    color: #2c2a88;
    margin-bottom: 0.5rem;
}

.dashboard-card p {
    color: #666;
    font-weight: 500;
}

.dashboard-card.pending {
    border-left: 4px solid #ffc107;
}

.dashboard-card.success {
    border-left: 4px solid #28a745;
}

.dashboard-card.info {
    border-left: 4px solid #17a2b8;
}

.dashboard-card.warning {
    border-left: 4px solid #fd7e14;
}

/* Tables */
.table-container {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.table-header {
    padding: 1.5rem;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.table-header h2 {
    color: #2c2a88;
    font-size: 1.3rem;
}

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

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

th {
    background: #f8f9fa;
    font-weight: 600;
    color: #2c2a88;
}

tr:hover {
    background: #f8f9fa;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.btn-primary {
    background: #2c2a88;
    color: white;
}

.btn-primary:hover {
    background: #1f1a66;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

.btn-warning {
    background: #ffc107;
    color: #212529;
}

.btn-warning:hover {
    background: #e0a800;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

/* Forms */
.form-container {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #2c2a88;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3d7644;
    box-shadow: 0 0 0 0.2rem rgba(61, 118, 68, 0.25);
}

.form-group textarea {
    height: 120px;
    resize: vertical;
}

/* Status Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 0.25rem;
    text-transform: uppercase;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
}

.badge-danger {
    background: #f8d7da;
    color: #721c24;
}

.badge-info {
    background: #d1ecf1;
    color: #0c5460;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

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

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

    .admin-header {
        margin-left: -2rem;
        margin-right: -2rem;
    }

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

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

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

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 2rem;
    border-radius: 10px;
    width: 90%;
    max-width: 800px;
    max-height: 90%;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    animation: slideIn 0.3s ease;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #dee2e6;
}

.modal-header h3 {
    color: #2c2a88;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.modal-close:hover {
    background-color: #f8f9fa;
    color: #dc3545;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #dee2e6;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -60%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

/* Image Preview Styles */
.image-preview {
    max-width: 150px;
    max-height: 150px;
    border-radius: 8px;
    border: 2px solid #dee2e6;
    margin-top: 0.5rem;
}

.current-image {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 5px;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #2c2a88;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mb-2 { margin-bottom: 2rem; }
.mt-2 { margin-top: 2rem; }
.d-none { display: none; }
.d-block { display: block; }

/* Invoice Styles */
.admin-content {
    background: transparent;
}

.content-header {
    background: white;
    padding: 1.5rem 2rem;
    margin-bottom: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left h2 {
    color: #2c2a88;
    font-size: 1.8rem;
    margin: 0 0 0.5rem 0;
}

.header-left p {
    color: #666;
    margin: 0;
}

.header-right {
    display: flex;
    gap: 10px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: 2rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(135deg, #2c2a88, #3d7644);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    background: linear-gradient(135deg, #2c2a88, #3d7644);
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(44, 42, 136, 0.3);
}

.stat-content {
    flex: 1;
}

.stat-content h3 {
    margin: 0 0 0.5rem 0;
    font-size: 2.2rem;
    color: #2c2a88;
    font-weight: 700;
    line-height: 1;
}

.stat-content p {
    margin: 0;
    color: #6c757d;
    font-size: 0.95rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
    margin-bottom: 2rem;
}

.table-header {
    padding: 1.5rem 2rem;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.table-header h3 {
    margin: 0;
    color: #2c2a88;
    font-size: 1.3rem;
    font-weight: 600;
}

.table-filters {
    display: flex;
    gap: 10px;
}

.table-filters select {
    padding: 0.5rem 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 0.9rem;
    background: white;
    color: #495057;
}

.table-filters select:focus {
    outline: none;
    border-color: #2c2a88;
    box-shadow: 0 0 0 2px rgba(44, 42, 136, 0.2);
}

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

.admin-table th,
.admin-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
    vertical-align: middle;
}

.admin-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #2c2a88;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.admin-table tbody tr:hover {
    background: #f8f9fa;
}

.patient-info strong {
    color: #2c2a88;
    font-weight: 600;
}

.patient-info small {
    color: #6c757d;
    font-size: 0.8rem;
}

.action-buttons {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
    border-radius: 3px;
    min-width: auto;
}

.btn-info {
    background: #17a2b8;
    color: white;
}

.btn-info:hover {
    background: #138496;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.status-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
}

.status-draft { 
    background: #fff3cd; 
    color: #856404; 
    border: 1px solid #ffeaa7;
}

.status-sent { 
    background: #d1ecf1; 
    color: #0c5460; 
    border: 1px solid #bee5eb;
}

.status-paid { 
    background: #d4edda; 
    color: #155724; 
    border: 1px solid #c3e6cb;
}

.status-cancelled { 
    background: #f8d7da; 
    color: #721c24; 
    border: 1px solid #f5c6cb;
}

.status-pending { 
    background: #ffeaa7; 
    color: #856404; 
    border: 1px solid #fdd835;
}

.status-overdue { 
    background: #f8d7da; 
    color: #721c24; 
    border: 1px solid #f5c6cb;
}

/* Invoice Form Styles */
.invoice-form {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

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

.invoice-form .form-section {
    margin-bottom: 0;
}

.invoice-form .services-section,
.invoice-form .totals-section,
.invoice-form .notes-section {
    grid-column: 1 / -1;
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .invoice-form .form-grid {
        grid-template-columns: 1fr;
    }
}

.form-section {
    margin-bottom: 2rem;
}

.form-section h3 {
    color: #2c2a88;
    margin: 0 0 2rem 0;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    font-size: 1.3rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    border-left: 5px solid #3d7644;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.form-section h3 i {
    margin-right: 1rem;
    color: #3d7644;
    font-size: 1.5rem;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: #2c2a88;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-group label i {
    color: #3d7644;
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    background-color: #fff;
}

.form-control:focus {
    outline: none;
    border-color: #2c2a88;
    box-shadow: 0 0 0 2px rgba(44, 42, 136, 0.2);
}

/* Services Section */
.services-section .service-select {
    margin-bottom: 0.5rem;
}

.services-section .custom-service-input {
    margin-top: 0.5rem;
}

.services-section .total-display {
    font-weight: bold;
}

.service-item {
    position: relative;
    padding-top: 2rem;
}

.service-item .service-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr auto;
    gap: 1rem;
    align-items: center;
}

@media (max-width: 992px) {
    .service-item .service-row {
        grid-template-columns: 1fr;
    }
}

.service-item {
    margin-bottom: 1.5rem;
    padding: 2rem;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    position: relative;
    transition: all 0.3s ease;
}

.service-item:hover {
    border-color: #2c2a88;
    box-shadow: 0 8px 25px rgba(44, 42, 136, 0.15);
    transform: translateY(-2px);
}

.service-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #2c2a88, #3d7644);
    border-radius: 12px 12px 0 0;
}

.service-row {
    display: grid;
    grid-template-columns: 3fr 0.8fr 1.2fr 1.2fr auto;
    gap: 1.5rem;
    align-items: end;
}

.service-name-field {
    grid-column: span 1;
}

.service-field {
    display: flex;
    flex-direction: column;
}

.service-field label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #2c2a88;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.service-field label::before {
    content: '';
    width: 3px;
    height: 12px;
    background: #3d7644;
    border-radius: 2px;
}

.service-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 2rem;
}

.custom-service {
    margin-top: 0.75rem;
    border: 2px dashed #ced4da;
    background: #fff;
}

.custom-service:focus {
    border-color: #2c2a88;
    border-style: solid;
}

/* Totals Section */
.totals-grid {
    max-width: 500px;
    margin-left: auto;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 2px solid #e9ecef;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    position: relative;
}

.totals-grid::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #2c2a88, #3d7644);
    border-radius: 16px 16px 0 0;
}

.total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid #e9ecef;
    transition: all 0.2s ease;
}

.total-row:hover {
    background: rgba(44, 42, 136, 0.02);
    margin: 0 -1rem;
    padding: 1rem;
    border-radius: 8px;
}

.total-row:last-child {
    border-bottom: none;
}

.total-row label {
    font-weight: 600;
    color: #2c2a88;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.total-row label::before {
    content: '•';
    color: #3d7644;
    font-weight: bold;
}

.total-row input {
    width: 160px;
    text-align: right;
    padding: 0.75rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    background: white;
    transition: all 0.2s ease;
}

.total-row input:focus {
    border-color: #2c2a88;
    box-shadow: 0 0 0 3px rgba(44, 42, 136, 0.1);
    outline: none;
}

.total-row span {
    font-weight: 700;
    color: #2c2a88;
    font-size: 1.1rem;
    background: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: 2px solid #e9ecef;
    min-width: 120px;
    text-align: right;
}

.total-final {
    background: linear-gradient(135deg, #2c2a88, #3d7644);
    color: white;
    padding: 1.5rem 2rem;
    border-radius: 12px;
    font-size: 1.3rem;
    font-weight: bold;
    border: none;
    margin-top: 1.5rem;
    box-shadow: 0 6px 20px rgba(44, 42, 136, 0.4);
    position: relative;
    overflow: hidden;
}

.total-final::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.total-final:hover::before {
    left: 100%;
}

.total-final label,
.total-final span {
    color: white;
    font-size: 1.3rem;
    position: relative;
    z-index: 1;
}

.total-final label::before {
    content: '₹';
    margin-right: 0.5rem;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-start;
    padding-top: 2rem;
    border-top: 1px solid #dee2e6;
    margin-top: 2rem;
}

.form-actions .btn {
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

.form-actions .btn i {
    margin-right: 0.5rem;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    backdrop-filter: blur(2px);
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    animation: modalSlideIn 0.3s ease-out;
}

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

.modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
    border-radius: 12px 12px 0 0;
}

.modal-header h3 {
    margin: 0;
    color: #2c2a88;
    font-size: 1.2rem;
    font-weight: 600;
}

.close {
    color: #6c757d;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.close:hover {
    color: #dc3545;
    background: #f8f9fa;
}

.modal form {
    padding: 2rem;
}

.modal .form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #dee2e6;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .main-content {
        margin-left: 250px;
        padding: 1.5rem;
    }
}

@media (max-width: 992px) {
    .form-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .service-row {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }
    
    .service-field:nth-child(1) {
        grid-column: 1 / -1;
    }
    
    .totals-grid {
        max-width: 100%;
        margin: 0;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .main-content {
        margin-left: 0;
        padding: 1rem;
    }
    
    .content-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
        text-align: center;
    }
    
    .header-right {
        justify-content: center;
    }
    
    .service-row {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .service-actions {
        justify-content: center;
        padding-top: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .table-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .table-filters {
        justify-content: stretch;
    }
    
    .table-filters select {
        flex: 1;
    }
    
    .action-buttons {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .admin-table {
        font-size: 0.8rem;
    }
    
    .admin-table th,
    .admin-table td {
        padding: 0.75rem 0.5rem;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .form-actions .btn {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .stat-card {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }
    
    .stat-content h3 {
        font-size: 1.5rem;
    }
    
    .service-item {
        padding: 1rem;
    }
    
    .modal-content {
        width: 95%;
        margin: 5% auto;
    }
    
    .modal form {
        padding: 1.5rem;
    }
}/* D
ashboard Invoice Cards */
.dashboard-card.invoice {
    border-left: 4px solid #fd7e14;
}

.dashboard-card.revenue {
    border-left: 4px solid #28a745;
}

.dashboard-card.invoice h3 {
    color: #fd7e14;
}

.dashboard-card.revenue h3 {
    color: #28a745;
}/* Ad
ditional Invoice Styling Improvements */

/* Text center utility for empty states */
.text-center {
    text-align: center;
}

/* Empty state styling */
.admin-table tbody tr td[colspan] {
    padding: 3rem 2rem;
    color: #6c757d;
    font-style: italic;
    background: #f8f9fa;
}

/* Service selection improvements */
.service-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

/* Total display styling */
.total-display {
    background-color: #e9ecef !important;
    font-weight: 600;
    color: #495057;
}

/* Button hover effects */
.btn {
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

/* Invoice number styling */
.admin-table tbody tr td:first-child strong {
    font-family: 'Courier New', monospace;
    background: #f8f9fa;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

/* Amount styling */
.admin-table tbody tr td:nth-child(5) strong {
    color: #28a745;
    font-size: 1.1rem;
}

/* Loading states */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn:disabled::before {
    display: none;
}

/* Focus improvements */
.form-control:focus,
.btn:focus {
    box-shadow: 0 0 0 3px rgba(44, 42, 136, 0.2);
}

/* Service item animations */
.service-item {
    transition: all 0.3s ease;
}

.service-item:hover {
    transform: translateY(-2px);
}

/* Success/Error message styling */
.alert {
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: 8px;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.alert-error {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.alert i {
    font-size: 1.2rem;
}

/* Improved table responsiveness */
@media (max-width: 768px) {
    .admin-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    .admin-table thead,
    .admin-table tbody,
    .admin-table th,
    .admin-table td,
    .admin-table tr {
        display: block;
    }
    
    .admin-table thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    
    .admin-table tr {
        border: 1px solid #dee2e6;
        margin-bottom: 1rem;
        border-radius: 8px;
        background: white;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
    
    .admin-table td {
        border: none;
        position: relative;
        padding-left: 50% !important;
        white-space: normal;
    }
    
    .admin-table td:before {
        content: attr(data-label) ": ";
        position: absolute;
        left: 1rem;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        font-weight: 600;
        color: #2c2a88;
    }
}

/* Print styles for invoice views */
@media print {
    .no-print {
        display: none !important;
    }
    
    .invoice-container {
        box-shadow: none;
        border: none;
    }
    
    .btn {
        display: none;
    }
}/* Add Ser
vice Button Styling */
.add-service-container {
    text-align: center;
    margin: 2rem 0;
    padding: 2rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px dashed #ced4da;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.add-service-container:hover {
    border-color: #2c2a88;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(44, 42, 136, 0.1);
}

.add-service-container .btn {
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: linear-gradient(135deg, #6c757d, #495057);
    border: none;
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
    transition: all 0.3s ease;
}

.add-service-container .btn:hover {
    background: linear-gradient(135deg, #2c2a88, #3d7644);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(44, 42, 136, 0.4);
}

.add-service-container .btn i {
    margin-right: 0.75rem;
    font-size: 1.2rem;
}

/* Form Control Improvements */
.form-control {
    transition: all 0.3s ease;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 0.875rem;
    font-size: 0.95rem;
    background: white;
}

.form-control:hover {
    border-color: #ced4da;
}

.form-control:focus {
    border-color: #2c2a88;
    box-shadow: 0 0 0 3px rgba(44, 42, 136, 0.1);
    background: #fff;
}

/* Select Dropdown Styling */
select.form-control {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%232c2a88' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.75rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 3rem;
    cursor: pointer;
}

/* Total Display Field Styling */
.total-display {
    background: linear-gradient(135deg, #e9ecef 0%, #f8f9fa 100%) !important;
    font-weight: 700 !important;
    color: #2c2a88 !important;
    border: 2px solid #dee2e6 !important;
    text-align: right;
    font-family: 'Courier New', monospace;
}

/* Service Delete Button */
.service-actions .btn-danger {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.service-actions .btn-danger:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
}/* In
dividual Stat Card Colors */
.stat-card:nth-child(1) .stat-icon {
    background: linear-gradient(135deg, #17a2b8, #138496);
}

.stat-card:nth-child(1)::before {
    background: linear-gradient(135deg, #17a2b8, #138496);
}

.stat-card:nth-child(2) .stat-icon {
    background: linear-gradient(135deg, #fd7e14, #e0a800);
}

.stat-card:nth-child(2)::before {
    background: linear-gradient(135deg, #fd7e14, #e0a800);
}

.stat-card:nth-child(3) .stat-icon {
    background: linear-gradient(135deg, #28a745, #20c997);
}

.stat-card:nth-child(3)::before {
    background: linear-gradient(135deg, #28a745, #20c997);
}

.stat-card:nth-child(4) .stat-icon {
    background: linear-gradient(135deg, #6f42c1, #e83e8c);
}

.stat-card:nth-child(4)::before {
    background: linear-gradient(135deg, #6f42c1, #e83e8c);
}

/* Hover effects for stat cards */
.stat-card:nth-child(1):hover {
    box-shadow: 0 8px 30px rgba(23, 162, 184, 0.2);
}

.stat-card:nth-child(2):hover {
    box-shadow: 0 8px 30px rgba(253, 126, 20, 0.2);
}

.stat-card:nth-child(3):hover {
    box-shadow: 0 8px 30px rgba(40, 167, 69, 0.2);
}

.stat-card:nth-child(4):hover {
    box-shadow: 0 8px 30px rgba(111, 66, 193, 0.2);
}

/* Enhanced form field focus states */
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(44, 42, 136, 0.15);
}

/* Loading animation for buttons */
.btn.loading {
    position: relative;
    color: transparent;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Success animation */
@keyframes successPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.stat-card.success-pulse {
    animation: successPulse 0.6s ease-in-out;
}/* En
hanced Input Placeholders */
.form-control::placeholder {
    color: #adb5bd;
    font-style: italic;
    opacity: 0.7;
}

.form-control:focus::placeholder {
    opacity: 0.5;
}

/* Textarea Styling */
textarea.form-control {
    resize: vertical;
    min-height: 100px;
    line-height: 1.6;
}

/* Number Input Styling */
input[type="number"].form-control {
    text-align: right;
    font-family: 'Courier New', monospace;
    font-weight: 600;
}

input[type="number"].form-control.quantity-input {
    text-align: center;
    font-size: 1.1rem;
}

/* Date Input Styling */
input[type="date"].form-control {
    cursor: pointer;
}

/* Required Field Indicator */
.form-group label:has(+ input[required])::after,
.form-group label:has(+ select[required])::after,
.form-group label:has(+ textarea[required])::after {
    content: '*';
    color: #dc3545;
    margin-left: 0.25rem;
    font-weight: bold;
}

/* Service Field Label Icons */
.service-field label i {
    width: 20px;
    text-align: center;
}

/* Improved Button Styling */
.btn {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    letter-spacing: 0.3px;
    text-transform: none;
}

.btn i {
    margin-right: 0.5rem;
}

/* Form Section Spacing */
.form-section:last-of-type {
    margin-bottom: 0;
}

/* Grid Improvements for Better Alignment */
.form-grid .form-section {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* Totals Section Label Icons */
.total-row label i {
    width: 20px;
    text-align: center;
    margin-right: 0.5rem;
}

.total-final label::before {
    display: none;
}

.total-final label i {
    margin-right: 0.75rem;
    font-size: 1.4rem;
}

/* Service Item Number Badge */
.service-item {
    position: relative;
    counter-increment: service-counter;
}

.services-container {
    counter-reset: service-counter;
}

.service-item::after {
    content: counter(service-counter);
    position: absolute;
    top: -10px;
    left: -10px;
    width: 30px;
    height: 30px;
    background: linear-gradient(135deg, #2c2a88, #3d7644);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
    box-shadow: 0 2px 8px rgba(44, 42, 136, 0.3);
    z-index: 1;
}

/* Responsive Adjustments for Service Row */
@media (max-width: 1200px) {
    .service-row {
        grid-template-columns: 2fr 0.7fr 1fr 1fr auto;
        gap: 1rem;
    }
}

@media (max-width: 992px) {
    .service-row {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }
    
    .service-name-field {
        grid-column: 1 / -1;
    }
    
    .service-actions {
        grid-column: 1 / -1;
        justify-content: center;
        padding-top: 0.5rem;
    }
}

/* Enhanced Focus States */
.form-control:focus {
    transform: translateY(-1px);
}

/* Smooth Animations */
* {
    transition: all 0.2s ease;
}

button, .btn, input[type="submit"] {
    transition: all 0.3s ease;
}

/* Print Button Styling */
.btn-info {
    background: linear-gradient(135deg, #17a2b8, #138496);
}

.btn-info:hover {
    background: linear-gradient(135deg, #138496, #117a8b);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(23, 162, 184, 0.4);
}