/* RA Tracker - Styles */
:root {
    --primary: #1e3a5f;
    --primary-light: #2d5a8a;
    --secondary: #4a90a4;
    --success: #28a745;
    --warning: #ffc107;
    --danger: #dc3545;
    --gray: #6c757d;
    --light-gray: #dee2e6;
    --lighter-gray: #f8f9fa;
    --white: #ffffff;
    --dark: #212529;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.15);
    --radius: 8px;
    --tdy-color: #0066cc;
    --gpc-color: #28a745;
    --other-color: #6f42c1;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--lighter-gray);
    color: var(--dark);
    line-height: 1.6;
}

/* Navigation */
nav {
    background: var(--primary);
    padding: 1rem 0;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--white);
    text-decoration: none;
}

.logo span {
    color: var(--secondary);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--white);
    background: rgba(255, 255, 255, 0.1);
}

/* Main Content */
main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

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

.page-header h1 {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.page-header p {
    color: var(--gray);
}

/* Grid System */
.grid {
    display: grid;
    gap: 1.5rem;
}

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

@media (max-width: 1200px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* Cards */
.card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.card-header h2 {
    font-size: 1.25rem;
    color: var(--primary);
}

/* Summary Cards */
.summary-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.summary-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.summary-card.total {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: var(--white);
}

.summary-card.total .summary-label {
    color: rgba(255, 255, 255, 0.8);
}

.summary-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.summary-icon.tdy {
    background: rgba(0, 102, 204, 0.1);
    color: var(--tdy-color);
}

.summary-icon.gpc {
    background: rgba(40, 167, 69, 0.1);
    color: var(--gpc-color);
}

.summary-icon.other {
    background: rgba(111, 66, 193, 0.1);
    color: var(--other-color);
}

.summary-card.total .summary-icon {
    background: rgba(255, 255, 255, 0.2);
}

.summary-info {
    display: flex;
    flex-direction: column;
}

.summary-label {
    font-size: 0.85rem;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.summary-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark);
}

.summary-card.total .summary-value {
    color: var(--white);
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--dark);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--light-gray);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

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

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-light);
}

.btn-secondary {
    background: var(--gray);
    color: var(--white);
}

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

.btn-success {
    background: var(--success);
    color: var(--white);
}

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

.btn-danger {
    background: var(--danger);
    color: var(--white);
}

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

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: var(--white);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table th,
.data-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--light-gray);
}

.data-table th {
    background: var(--lighter-gray);
    font-weight: 600;
    color: var(--primary);
    white-space: nowrap;
}

.data-table tbody tr:hover {
    background: var(--lighter-gray);
}

.data-table .empty-row td {
    text-align: center;
    color: var(--gray);
    padding: 2rem;
}

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

.status-pending {
    background: rgba(255, 193, 7, 0.2);
    color: #856404;
}

.status-approved {
    background: rgba(0, 123, 255, 0.2);
    color: #004085;
}

.status-completed {
    background: rgba(40, 167, 69, 0.2);
    color: #155724;
}

.status-cancelled {
    background: rgba(220, 53, 69, 0.2);
    color: #721c24;
}

/* Type Badges */
.type-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.type-tdy {
    background: rgba(0, 102, 204, 0.15);
    color: var(--tdy-color);
}

.type-gpc {
    background: rgba(40, 167, 69, 0.15);
    color: var(--gpc-color);
}

.type-other {
    background: rgba(111, 66, 193, 0.15);
    color: var(--other-color);
}

/* Fiscal Year Selector */
.fiscal-year-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.fiscal-year-selector label {
    font-weight: 500;
    color: var(--gray);
}

.fiscal-year-selector select {
    padding: 0.5rem;
    border: 2px solid var(--light-gray);
    border-radius: var(--radius);
    font-size: 0.9rem;
}

/* Monthly Table */
#monthly-table td {
    text-align: right;
}

#monthly-table td:first-child {
    text-align: left;
    font-weight: 600;
}

#monthly-table tfoot td {
    font-weight: 700;
    background: var(--lighter-gray);
}

/* Action Buttons */
.action-btns {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.action-btn.edit {
    background: rgba(0, 123, 255, 0.1);
    color: #007bff;
}

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

.action-btn.delete {
    background: rgba(220, 53, 69, 0.1);
    color: var(--danger);
}

.action-btn.delete:hover {
    background: var(--danger);
    color: white;
}

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 200;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--white);
    border-radius: var(--radius);
    padding: 2rem;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-header h2 {
    color: var(--primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray);
}

.modal-close:hover {
    color: var(--dark);
}

/* Filters */
.filters {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-group label {
    font-weight: 500;
    color: var(--gray);
    white-space: nowrap;
}

.filter-group select,
.filter-group input {
    padding: 0.5rem;
    border: 2px solid var(--light-gray);
    border-radius: var(--radius);
    font-size: 0.9rem;
}

/* Reports */
.chart-container {
    position: relative;
    height: 300px;
    margin-bottom: 1rem;
}

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

.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    text-align: center;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-card .stat-label {
    color: var(--gray);
    font-size: 0.9rem;
}

/* Utility */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.text-center { text-align: center; }
.text-right { text-align: right; }

/* Print Styles */
@media print {
    nav { display: none; }
    .btn { display: none; }
    .card { box-shadow: none; border: 1px solid var(--light-gray); }
}
