/* ========================================
   RECORDS PAGE STYLES
   ======================================== */

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

body {
    font-family: 'Cormorant Garamond', serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    padding: 20px;
    padding-top: 100px;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* ========================================
   NAVIGATION BAR
   ======================================== */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #1a4a2e 0%, #2d7a4d 100%);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.nav-title {
    color: white;
    font-family: 'Playfair Display', serif;
    font-size: 22px;
    font-weight: 700;
    margin: 0;
}

.nav-links {
    display: flex;
    gap: 15px;
    align-items: center;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

.nav-link.active {
    background: white;
    color: #1a4a2e;
    border-color: #d4af37;
}

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

.nav-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-family: 'Cormorant Garamond', serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.nav-btn-password {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.nav-btn-password:hover {
    background: rgba(255, 255, 255, 0.3);
}

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

.nav-btn-logout:hover {
    background: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.4);
}

@media (max-width: 768px) {
    body {
        padding-top: 140px;
    }

    .top-nav {
        flex-direction: column;
        gap: 15px;
        padding: 15px 20px;
    }

    .nav-left {
        flex-direction: column;
        gap: 15px;
        width: 100%;
        text-align: center;
    }

    .nav-links {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

    .nav-right {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

    .nav-link {
        flex: 1;
        justify-content: center;
        font-size: 14px;
        padding: 8px 12px;
        min-width: 150px;
    }

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

/* ========================================
   HEADER
   ======================================== */
.page-header {
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    padding: 30px 40px;
    text-align: center;
    margin-bottom: 30px;
}

.page-header h1 {
    font-family: 'Playfair Display', serif;
    font-size: 36px;
    color: #1a4a2e;
    margin-bottom: 5px;
}

.subtitle {
    font-size: 18px;
    color: #666;
    margin-bottom: 0;
}

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

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

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

.stat-icon {
    font-size: 40px;
    margin-bottom: 10px;
}

.stat-value {
    font-family: 'Playfair Display', serif;
    font-size: 42px;
    font-weight: 700;
    color: #1a4a2e;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 16px;
    color: #666;
    font-weight: 600;
}

/* ========================================
   SEARCH & FILTER SECTION
   ======================================== */
.search-section {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.search-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 15px;
}

#searchInput {
    flex: 1;
    padding: 14px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    font-family: 'Cormorant Garamond', serif;
    transition: all 0.3s ease;
}

#searchInput:focus {
    outline: none;
    border-color: #1a4a2e;
    box-shadow: 0 0 0 3px rgba(26, 74, 46, 0.1);
}

.filter-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    font-family: 'Cormorant Garamond', serif;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-search, .btn-refresh {
    background: #1a4a2e;
    color: white;
}

.btn-search:hover, .btn-refresh:hover {
    background: #0f2f1d;
    transform: translateY(-2px);
}

.btn-clear {
    background: #f5f5f5;
    color: #666;
}

.btn-clear:hover {
    background: #e0e0e0;
}

.btn-export {
    background: linear-gradient(135deg, #d4af37 0%, #f4d03f 100%);
    color: #1a4a2e;
}

.btn-export:hover {
    background: linear-gradient(135deg, #c49f2f 0%, #d4af37 100%);
    transform: translateY(-2px);
}

/* ========================================
   RECORDS TABLE
   ======================================== */
.records-section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

.table-header h2 {
    font-family: 'Playfair Display', serif;
    color: #1a4a2e;
    font-size: 28px;
}

.record-count {
    background: #d4af37;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
}

.table-container {
    overflow-x: auto;
    margin-bottom: 20px;
}

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

.records-table thead {
    background: #f8f9fa;
}

.records-table th {
    padding: 15px 12px;
    text-align: left;
    font-weight: 700;
    color: #1a4a2e;
    border-bottom: 2px solid #d4af37;
    font-size: 15px;
    white-space: nowrap;
}

.records-table td {
    padding: 15px 12px;
    border-bottom: 1px solid #e0e0e0;
    color: #333;
    font-size: 15px;
}

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

.loading-message {
    text-align: center;
    padding: 60px 20px !important;
    color: #666;
    font-size: 16px;
}

.spinner {
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 3px solid #e0e0e0;
    border-top-color: #1a4a2e;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
}

.status-printed {
    background: #d4edda;
    color: #155724;
}

.status-not-printed {
    background: #fff3cd;
    color: #856404;
}

.action-btn {
    padding: 6px 12px;
    margin: 0 3px;
    border: none;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-edit {
    background: #007bff;
    color: white;
}

.btn-edit:hover {
    background: #0056b3;
}

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

.btn-delete:hover {
    background: #a71d2a;
}

/* ========================================
   PAGINATION
   ======================================== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 20px;
}

.btn-page {
    background: #1a4a2e;
    color: white;
}

.btn-page:hover:not(:disabled) {
    background: #0f2f1d;
    transform: translateY(-2px);
}

.btn-page:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.page-info {
    font-weight: 600;
    color: #666;
}

/* ========================================
   MODAL
   ======================================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    border-radius: 16px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

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

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

.modal-header h3 {
    font-family: 'Playfair Display', serif;
    color: #1a4a2e;
    font-size: 24px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 32px;
    color: #999;
    cursor: pointer;
    line-height: 1;
    transition: all 0.2s ease;
}

.modal-close:hover {
    color: #333;
}

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

.form-group label {
    display: block;
    font-weight: 600;
    color: #1a4a2e;
    margin-bottom: 8px;
    font-size: 15px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    font-family: 'Cormorant Garamond', serif;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #1a4a2e;
    box-shadow: 0 0 0 3px rgba(26, 74, 46, 0.1);
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 25px;
}

.btn-primary {
    flex: 1;
    background: linear-gradient(135deg, #1a4a2e 0%, #2d7a4d 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0f2f1d 0%, #1a4a2e 100%);
}

.btn-cancel {
    flex: 1;
    background: #f5f5f5;
    color: #666;
}

.btn-cancel:hover {
    background: #e0e0e0;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    .stats-dashboard {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .search-bar {
        flex-direction: column;
    }
    
    .filter-actions {
        justify-content: stretch;
    }
    
    .filter-actions .btn {
        flex: 1;
    }
    
    .records-table {
        font-size: 13px;
    }
    
    .records-table th,
    .records-table td {
        padding: 10px 8px;
    }
}

@media (max-width: 480px) {
    .page-header {
        padding: 25px 20px;
    }
    
    .page-header h1 {
        font-size: 28px;
    }
    
    .stats-dashboard {
        grid-template-columns: 1fr;
    }
    
    .stat-value {
        font-size: 36px;
    }
}