* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 10px;
    font-size: 14px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

header h1 {
    font-size: 18px;
    font-weight: 600;
}

nav {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

#authNav {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

nav a {
    color: white;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 4px;
    transition: background 0.3s;
    font-size: 13px;
    white-space: nowrap;
}

nav a:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* User Profile Dropdown */
.user-menu {
    position: relative;
    display: inline-block !important;
    margin-left: 8px;
}

.user-menu-button {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    font-size: 13px;
    border-radius: 4px;
    transition: background 0.3s;
}

.user-menu-button:hover {
    background: rgba(255, 255, 255, 0.1);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    display: flex !important;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    color: white !important;
    border: 2px solid rgba(255, 255, 255, 0.7);
    transition: all 0.3s;
    cursor: pointer;
    flex-shrink: 0;
}

.user-menu-button:hover .user-avatar {
    background: rgba(255, 255, 255, 0.4);
    border-color: rgba(255, 255, 255, 0.7);
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: white;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 180px;
    z-index: 1000;
    display: none;
    overflow: hidden;
}

.user-dropdown.show {
    display: block;
}

.user-dropdown-item {
    display: block;
    padding: 12px 16px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s;
    border-bottom: 1px solid #e9ecef;
    cursor: pointer;
}

.user-dropdown-item:last-child {
    border-bottom: none;
}

.user-dropdown-item:hover {
    background: #f8f9fa;
    color: #667eea;
}

.user-dropdown-item.signout {
    color: #dc3545;
}

.user-dropdown-item.signout:hover {
    background: #fff5f5;
    color: #c82333;
}

.notification-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.3s;
    position: relative;
}

.notification-icon:hover {
    background: rgba(255, 255, 255, 0.2);
}

.notification-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    width: 8px;
    height: 8px;
    display: none;
}

.notification-badge.show {
    display: block;
}

main {
    padding: 10px 15px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 8px;
    padding: 6px 0;
}

.page-header h2 {
    color: #333;
    font-size: 15px;
    font-weight: 600;
    margin: 0;
}

.btn {
    padding: 5px 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
    font-weight: 500;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.table-wrapper {
    overflow-x: auto;
    margin-top: 10px;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    font-size: 12px;
    min-width: 600px;
}

table th,
table td {
    padding: 6px 4px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

table tr:hover {
    background: #f8f9fa;
}

table td {
    color: #495057;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    overflow: auto;
}

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 15px;
    border-radius: 6px;
    width: 95%;
    max-width: 500px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.modal-header h3 {
    color: #333;
    font-size: 15px;
    font-weight: 600;
}

.close {
    color: #aaa;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close:hover {
    color: #000;
}

.form-group {
    margin-bottom: 10px;
}

.form-group label {
    display: block;
    margin-bottom: 4px;
    color: #495057;
    font-weight: 500;
    font-size: 11px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 12px;
    transition: border-color 0.15s ease-in-out;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 70px;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 15px;
}

.alert {
    padding: 10px 12px;
    margin-bottom: 12px;
    border-radius: 4px;
    display: none;
    font-size: 12px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Sweet Alert Styles */
.sweet-alert-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sweet-alert-overlay.show {
    opacity: 1;
}

.sweet-alert-box {
    background: white;
    border-radius: 12px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    transform: scale(0.7) translateY(-50px);
    transition: transform 0.3s ease;
}

.sweet-alert-box.show {
    transform: scale(1) translateY(0);
}

.sweet-alert-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    font-weight: bold;
    animation: scaleIn 0.5s ease;
}

.sweet-alert-icon.success {
    background: #d4edda;
    color: #28a745;
    border: 3px solid #28a745;
}

.sweet-alert-icon.error {
    background: #f8d7da;
    color: #dc3545;
    border: 3px solid #dc3545;
}

.sweet-alert-icon.warning {
    background: #fff3cd;
    color: #ffc107;
    border: 3px solid #ffc107;
}

.sweet-alert-icon.info {
    background: #d1ecf1;
    color: #17a2b8;
    border: 3px solid #17a2b8;
}

.sweet-alert-title {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin: 0 0 15px 0;
}

.sweet-alert-message {
    font-size: 14px;
    color: #6c757d;
    margin: 0 0 25px 0;
    line-height: 1.5;
}

.sweet-alert-button {
    min-width: 100px;
    padding: 10px 20px;
    font-size: 14px;
}

@keyframes scaleIn {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

@media (max-width: 480px) {
    .sweet-alert-box {
        padding: 20px;
        max-width: 90%;
    }
    
    .sweet-alert-icon {
        width: 60px;
        height: 60px;
        font-size: 30px;
    }
    
    .sweet-alert-title {
        font-size: 18px;
    }
    
    .sweet-alert-message {
        font-size: 13px;
    }
}

.status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    display: inline-block;
}

.status-active {
    background: #d4edda;
    color: #155724;
}

.status-cancelled {
    background: #f8d7da;
    color: #721c24;
}

.status-expired {
    background: #fff3cd;
    color: #856404;
}

.status-suspended {
    background: #d1ecf1;
    color: #0c5460;
}

.status-info {
    background: #d1ecf1;
    color: #0c5460;
}

.status-warning {
    background: #fff3cd;
    color: #856404;
}

.status-error {
    background: #f8d7da;
    color: #721c24;
}

.status-debug {
    background: #e2e3e5;
    color: #383d41;
}

.status-success {
    background: #d4edda;
    color: #155724;
}

.status-failed {
    background: #f8d7da;
    color: #721c24;
}

.loading {
    text-align: center;
    padding: 15px;
    color: #6c757d;
    font-size: 13px;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    body {
        padding: 5px;
        font-size: 13px;
    }
    
    header {
        padding: 10px 15px;
        flex-direction: column;
        align-items: flex-start;
    }
    
    header h1 {
        font-size: 16px;
        margin-bottom: 8px;
    }
    
    nav {
        width: 100%;
        gap: 5px;
    }
    
    nav a {
        padding: 6px 10px;
        font-size: 12px;
        flex: 1;
        text-align: center;
    }
    
    main {
        padding: 15px;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .page-header h2 {
        font-size: 16px;
    }
    
    .btn {
        padding: 7px 14px;
        font-size: 12px;
    }
    
    .modal-content {
        margin: 10% auto;
        padding: 15px;
        width: 98%;
    }
    
    .modal-header h3 {
        font-size: 15px;
    }
    
    table {
        font-size: 12px;
    }
    
    table th,
    table td {
        padding: 8px 6px;
    }
    
    table th {
        font-size: 11px;
    }
    
    .form-group {
        margin-bottom: 12px;
    }
    
    .form-group label {
        font-size: 12px;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 7px 10px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 3px;
    }
    
    header {
        padding: 8px 12px;
    }
    
    header h1 {
        font-size: 15px;
    }
    
    nav a {
        padding: 5px 8px;
        font-size: 11px;
    }
    
    main {
        padding: 12px;
    }
    
    .page-header h2 {
        font-size: 15px;
    }
    
    .btn {
        padding: 6px 12px;
        font-size: 11px;
    }
    
    table {
        font-size: 11px;
    }
    
    table th,
    table td {
        padding: 6px 4px;
    }
    
    .user-avatar {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }
    
    .user-dropdown {
        min-width: 160px;
        right: -10px;
    }
    
    .user-dropdown-item {
        padding: 10px 14px;
        font-size: 13px;
    }
    
    .notification-icon {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }
}

/* Advanced Customer Form Styles */
.advanced-modal {
    max-width: 700px !important;
    padding: 0 !important;
}

.advanced-modal .modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    margin: 0;
    border-radius: 6px 6px 0 0;
}

.advanced-modal .modal-header h3 {
    color: white;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
}

.advanced-modal .close {
    color: white;
    font-size: 28px;
}

.advanced-modal .close:hover {
    color: #f0f0f0;
}

/* Progress Indicator */
.form-progress {
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    width: 25%;
    transition: width 0.3s ease;
    border-radius: 2px;
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #666;
}

.progress-steps .step {
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.3s;
}

.progress-steps .step.active {
    background: #667eea;
    color: white;
    font-weight: 600;
}

/* Tab Navigation */
.form-tabs {
    display: flex;
    background: #f8f9fa;
    border-bottom: 2px solid #e0e0e0;
    padding: 0 20px;
    gap: 5px;
}

.tab-btn {
    background: transparent;
    border: none;
    padding: 12px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
    position: relative;
    font-weight: 500;
}

.tab-btn:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
    background: white;
}

.tab-icon {
    font-size: 16px;
}

.tab-label {
    white-space: nowrap;
}

/* Tab Content */
.tab-content-wrapper {
    padding: 20px;
    min-height: 400px;
    max-height: 60vh;
    overflow-y: auto;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Section Header */
.section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
}

.section-header h4 {
    margin: 0;
    color: #333;
    font-size: 15px;
    font-weight: 600;
    flex: 1;
}

.section-icon {
    font-size: 20px;
}

.required-badge, .optional-badge {
    font-size: 10px;
    padding: 4px 8px;
    border-radius: 12px;
    background: #e7f3ff;
    color: #2196F3;
    font-weight: 500;
}

.optional-badge {
    background: #f0f0f0;
    color: #666;
}

/* Form Rows */
.form-row {
    margin-bottom: 15px;
}

.form-row.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* Enhanced Form Groups */
.advanced-modal .form-group {
    position: relative;
}

.advanced-modal .form-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    color: #495057;
    font-weight: 500;
    font-size: 12px;
}

.label-icon {
    font-size: 14px;
}

.required {
    color: #dc3545;
    font-weight: bold;
}

.advanced-modal .form-group input,
.advanced-modal .form-group select,
.advanced-modal .form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 13px;
    transition: all 0.3s;
    background: #fff;
}

.advanced-modal .form-group input:focus,
.advanced-modal .form-group select:focus,
.advanced-modal .form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

.advanced-modal .form-group input:valid:not(:placeholder-shown) {
    border-color: #28a745;
}

.advanced-modal .form-group input:invalid:not(:placeholder-shown):not(:focus) {
    border-color: #dc3545;
}

.field-error {
    display: block;
    color: #dc3545;
    font-size: 11px;
    margin-top: 4px;
    min-height: 16px;
}

.field-hint {
    display: block;
    color: #6c757d;
    font-size: 11px;
    margin-top: 4px;
    line-height: 1.4;
}

/* Checkbox Styling */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 10px;
    border-radius: 6px;
    transition: background 0.3s;
}

.checkbox-label:hover {
    background: #f8f9fa;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #667eea;
}

.checkbox-text {
    font-weight: 500;
    color: #495057;
}

/* GST Required Indicator */
.gst-required {
    color: #dc3545;
    font-weight: bold;
    margin-left: 2px;
}

/* Enhanced Form Actions */
.advanced-modal .form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 15px 20px;
    background: #f8f9fa;
    border-top: 1px solid #e0e0e0;
    border-radius: 0 0 6px 6px;
}

.advanced-modal .form-actions .btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.3s;
}

.btn-info {
    background: #17a2b8;
    color: white;
}

.btn-info:hover {
    background: #138496;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.advanced-modal .form-actions .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.advanced-modal .form-actions .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* Responsive Design for Advanced Form */
@media (max-width: 768px) {
    .advanced-modal {
        max-width: 95% !important;
    }
    
    .form-tabs {
        flex-wrap: wrap;
        padding: 10px;
    }
    
    .tab-btn {
        flex: 1;
        min-width: 80px;
        padding: 10px 8px;
        font-size: 11px;
    }
    
    .tab-label {
        display: none;
    }
    
    .form-row.grid-2 {
        grid-template-columns: 1fr;
    }
    
    .advanced-modal .form-actions {
        flex-wrap: wrap;
    }
    
    .advanced-modal .form-actions .btn {
        flex: 1;
        min-width: 100px;
    }
}

