:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --success-color: #10b981;
    --text-color: #1e293b;
    --text-muted: #64748b;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
    --input-bg: #ffffff;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.5;
    padding: 2.5rem 1.25rem;
}

.main-layout {
    display: flex;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    align-items: flex-start;
}

.container {
    flex: 1;
    max-width: 800px;
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
}

.search-sidebar {
    width: 320px;
    position: sticky;
    top: 2rem;
}

.search-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

.search-card h3 {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.search-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.search-result {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.result-card {
    background: #f8fafc;
    border-radius: 8px;
    padding: 1rem;
    font-size: 0.875rem;
}

.result-card p {
    margin-bottom: 0.5rem;
}

.result-card strong {
    color: var(--text-color);
}

.download-link-btn {
    width: 100%;
    margin-top: 1rem;
    padding: 0.625rem;
    background: var(--success-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.download-link-btn:hover {
    background: #059669;
}

header {
    text-align: center;
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.logo-container {
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: center;
}

.logo {
    height: 80px;
    width: auto;
    object-fit: contain;
}

h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.5rem;
    letter-spacing: -0.025em;
    text-transform: uppercase;
}

.subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.address {
    font-size: 0.8125rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0.5rem auto 0;
    line-height: 1.5;
    font-weight: 400;
}

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

.form-section h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.form-section h3::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

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

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.form-row.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.required-star {
    color: #ef4444;
    margin-left: 2px;
}

label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-color);
}

input[type="text"],
input[type="tel"],
input[type="email"],
select {
    width: 100%;
    max-width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--input-bg);
    font-size: 0.9375rem;
    color: var(--text-color);
    transition: all 0.2s ease;
    box-shadow: var(--shadow);
}

select {
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

input.invalid,
select.invalid {
    border-color: #ef4444 !important;
    background-color: #fef2f2 !important;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1) !important;
}

.shake {
    animation: shake 0.4s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
    40%, 60% { transform: translate3d(4px, 0, 0); }
}

/* Radio buttons */
.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    padding: 0.5rem 0;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    cursor: pointer;
    font-size: 0.9375rem;
    color: var(--text-color);
    transition: color 0.15s;
}

.radio-label:hover {
    color: var(--primary-color);
}

.radio-label input[type="radio"] {
    width: 1.125rem;
    height: 1.125rem;
    accent-color: var(--primary-color);
}

.fee-note {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background-color: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    font-size: 0.875rem;
    color: #1d4ed8;
    font-weight: 600;
    display: none;
    animation: slideIn 0.3s ease-out;
}

/* Status Badges & Toggle */
.status-badge {
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
    display: inline-block;
}

.status-active {
    background: #ecfdf5;
    color: #059669;
}

.status-inactive {
    background: #fef2f2;
    color: #dc2626;
}

.btn-status {
    background: #f1f5f9;
    color: #64748b;
}

.btn-status.inactive {
    background: #dc2626;
    color: white;
}

.btn-status:hover {
    background: #e2e8f0;
}

/* Reports Dashboard */
.report-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    border: 1px solid #e2e8f0;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 150px;
}

.filter-group label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.filter-group select, 
.filter-group input {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.875rem;
    background: white;
}

.date-inputs {
    display: flex;
    gap: 0.5rem;
}

.date-inputs input {
    width: 130px;
}

.search-group {
    flex: 1;
    min-width: 200px;
}

.filter-actions {
    display: flex;
    gap: 0.75rem;
}

.filter-actions .action-btn {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    color: white;
    font-weight: 500;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-actions .btn-view {
    background: #10b981;
}

.filter-actions .btn-view:hover {
    background: #059669;
}

.filter-actions .btn-print:hover {
    background: #dc2626 !important;
}

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

/* File uploads */
.file-input-wrapper {
    position: relative;
    border: 1.5px dashed var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    background-color: var(--bg-color);
    cursor: pointer;
    transition: all 0.2s ease;
}

.file-input-wrapper:hover {
    border-color: var(--primary-color);
    background-color: rgba(37, 99, 235, 0.02);
}

.file-input-wrapper input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.file-label {
    font-size: 0.875rem;
    color: var(--text-color);
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.file-info {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.error-message {
    font-size: 0.75rem;
    color: #ef4444;
    font-weight: 500;
    margin-top: 0.25rem;
    display: none;
}

/* Footer & Button */
.form-footer {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.terms-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.terms-container {
    margin-bottom: 1.5rem;
    padding: 1.25rem;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    animation: fadeIn 0.3s ease-out;
}

.terms-container h4 {
    font-size: 0.9375rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-color);
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.terms-scroll-box {
    max-height: 250px;
    overflow-y: auto;
    font-size: 0.8125rem;
    color: var(--text-muted);
    line-height: 1.6;
    padding-right: 0.75rem;
}

.terms-scroll-box p {
    margin-bottom: 1rem;
}

.terms-scroll-box p strong {
    color: var(--text-color);
}

/* Custom Scrollbar for Terms */
.terms-scroll-box::-webkit-scrollbar {
    width: 6px;
}
.terms-scroll-box::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}
.terms-scroll-box::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}
.terms-scroll-box::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.terms-group input {
    margin-top: 0.25rem;
    width: 1.125rem;
    height: 1.125rem;
    accent-color: var(--primary-color);
}

.terms-group label {
    font-size: 0.875rem;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1.5;
}

.submit-btn {
    width: 100%;
    padding: 0.875rem 1.5rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2);
}

.submit-btn:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.3);
}

.submit-btn:active {
    transform: translateY(0);
}

.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Success Message */
.success-message {
    animation: fadeIn 0.5s ease-out;
}

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

/* Responsive */
@media (max-width: 1024px) {
    .main-layout {
        flex-direction: column;
        align-items: center;
    }
    .search-sidebar {
        width: 100%;
        max-width: 800px;
        position: static;
        margin-bottom: 2rem;
    }
    .container {
        width: 100%;
    }
}

@media (max-width: 640px) {
    .container {
        padding: 1.5rem;
        border-radius: 0;
    }
    
    body {
        padding: 0;
    }
    
    .form-row, 
    .form-row.grid-3, 
    .grid-3 {
        grid-template-columns: 1fr;
    }
    
    .radio-group {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .modal-content {
        padding: 1.5rem;
        margin: 1rem;
        max-width: calc(100% - 2rem);
    }
    
    h1 {
        font-size: 1.25rem;
    }
    
    .logo {
        height: 60px;
    }
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: white;
    padding: 2.5rem;
    border-radius: 12px;
    width: 100%;
    max-width: 400px;
    position: relative;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1);
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
}

/* Dashboard Styles */
.admin-dashboard {
    display: flex;
    min-height: 100vh;
    width: 100%;
    background: #f8fafc;
}

.sidebar {
    width: 260px;
    background: #1e293b;
    color: white;
    padding: 2rem 1.25rem;
    flex-shrink: 0;
}

.sidebar-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.menu-item {
    width: 100%;
    padding: 0.75rem 1rem;
    text-align: left;
    background: transparent;
    color: #cbd5e1;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

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

.dashboard-content {
    flex-grow: 1;
    padding: 2rem;
    overflow-y: auto;
}

.content-header {
    margin-bottom: 2rem;
}

.table-container {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

th {
    text-align: left;
    padding: 1rem;
    background: #f1f5f9;
    color: #475569;
    font-weight: 600;
}

td {
    padding: 1rem;
    border-bottom: 1px solid #f1f5f9;
    color: #1e293b;
}

.view-btn {
    padding: 0.4rem 0.8rem;
    background: #f1f5f9;
    color: var(--primary-color);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
}

@media (max-width: 768px) {
    .admin-dashboard {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        height: auto;
    }
}

/* Action Buttons Styling */
.action-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

.action-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    background: #f1f5f9;
}

.action-btn i {
    pointer-events: none;
}

.btn-view { color: #6366f1; }
.btn-edit { color: #f59e0b; }
.btn-delete { color: #ef4444; }
.btn-download { color: #10b981; }
.btn-print { color: #64748b; }

.action-btn:hover {
    background: #e2e8f0;
    transform: translateY(-1px);
}

.action-btn.btn-delete:hover { background: #fee2e2; }
.action-btn.btn-view:hover { background: #e0e7ff; }
.action-btn.btn-edit:hover { background: #ffedd5; }
.action-btn.btn-download:hover { background: #d1fae5; }

/* Grid adjustments for edit modal */
.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

/* Global Loader Overlay */
.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(4px);
    display: none; /* Hidden by default */
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 9999;
    gap: 1.5rem;
}

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

.loader-text {
    font-weight: 600;
    color: #1e293b;
    font-size: 1rem;
}

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