/* Oak Web Admin - Styles */

:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --success: #16a34a;
    --warning: #d97706;
    --danger: #dc2626;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--gray-800);
    background: var(--gray-50);
}

/* Layout */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* Navbar */
.navbar {
    background: var(--gray-900);
    color: white;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    height: 56px;
}

.nav-brand a {
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.25rem;
}

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

.nav-links a {
    color: var(--gray-300);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 0.25rem;
    transition: all 0.15s;
}

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

.nav-user {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--gray-300);
}

/* Login Page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--gray-800), var(--gray-900));
}

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

.login-container h1 {
    color: var(--primary);
    margin-bottom: 0.5rem;
    text-align: center;
}

.login-container h2 {
    color: var(--gray-600);
    font-weight: normal;
    font-size: 1rem;
    margin-bottom: 2rem;
    text-align: center;
}

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

.login-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--gray-700);
}

.login-form input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: 0.375rem;
    font-size: 1rem;
}

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

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--gray-100);
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s;
}

.btn:hover {
    background: var(--gray-200);
}

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

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

.btn-small {
    padding: 0.25rem 0.75rem;
    font-size: 0.8125rem;
}

.btn-block {
    display: block;
    width: 100%;
    text-align: center;
}

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

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

/* Cards */
.card {
    background: white;
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.card h3 {
    margin-bottom: 1rem;
    font-size: 1rem;
    color: var(--gray-700);
}

.form-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
}

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

.alert-error {
    background: #fef2f2;
    color: var(--danger);
    border: 1px solid #fecaca;
}

.alert-success {
    background: #f0fdf4;
    color: var(--success);
    border: 1px solid #bbf7d0;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    text-align: center;
}

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

.stat-label {
    color: var(--gray-500);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.stat-warning .stat-value { color: var(--warning); }
.stat-danger .stat-value { color: var(--danger); }
.stat-success .stat-value { color: var(--success); }
.stat-caution .stat-value { color: #b45309; }
.stat-error .stat-value { color: var(--danger); }

/* Tables */
.table {
    width: 100%;
    background: white;
    border-collapse: collapse;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 1rem;
}

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

.table th {
    background: var(--gray-50);
    font-weight: 600;
    color: var(--gray-600);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

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

.table tbody tr:last-child td {
    border-bottom: none;
}

.table a {
    color: var(--primary);
    text-decoration: none;
}

.table a:hover {
    text-decoration: underline;
}

.table-compact th,
.table-compact td {
    padding: 0.5rem 0.75rem;
}

.row-danger {
    background: #fef2f2 !important;
}

.row-warning {
    background: #fffbeb !important;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 9999px;
    background: var(--gray-100);
    color: var(--gray-700);
}

.badge-success {
    background: #dcfce7;
    color: var(--success);
}

.badge-warning {
    background: #fef3c7;
    color: var(--warning);
}

.badge-danger {
    background: #fee2e2;
    color: var(--danger);
}

.badge-default {
    background: var(--gray-100);
    color: var(--gray-600);
}

/* Filters */
.filters-form {
    background: white;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.filters-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.filter-group label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--gray-600);
}

.filter-group input,
.filter-group select {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    min-width: 150px;
}

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

.filter-actions {
    flex-direction: row;
    gap: 0.5rem;
}

.results-count {
    color: var(--gray-500);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
}

.page-info {
    color: var(--gray-500);
    font-size: 0.875rem;
}

/* Detail Pages */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.page-header h1 {
    margin: 0;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.detail-section {
    background: white;
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.detail-section h2 {
    font-size: 1rem;
    color: var(--gray-600);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--gray-200);
}

.detail-section h3 {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.detail-full {
    grid-column: 1 / -1;
}

.detail-list {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 0.5rem 1rem;
}

.detail-list dt {
    font-weight: 500;
    color: var(--gray-500);
    font-size: 0.875rem;
}

.detail-list dd {
    color: var(--gray-800);
}

.description-text {
    white-space: pre-wrap;
    word-break: break-word;
}

.outcome-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.outcome-list li {
    padding: 0.5rem 0.75rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
}

.outcome-yes {
    background: #fee2e2;
    color: var(--danger);
}

.outcome-no {
    background: var(--gray-100);
    color: var(--gray-500);
}

.tag-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.tag {
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
}

.tag-success {
    background: #dcfce7;
    color: var(--success);
}

.tag-warning {
    background: #fef3c7;
    color: var(--warning);
}

.photo-list {
    list-style: none;
}

.photo-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--gray-100);
}

.photo-list li:last-child {
    border-bottom: none;
}

.code-block {
    background: var(--gray-50);
    padding: 1rem;
    border-radius: 0.375rem;
    font-family: "SF Mono", Monaco, Consolas, monospace;
    font-size: 0.8125rem;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 400px;
    overflow-y: auto;
}

.detail-meta {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-200);
    color: var(--gray-500);
    font-size: 0.875rem;
}

.text-muted {
    color: var(--gray-400);
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem;
    color: var(--gray-400);
    font-size: 0.875rem;
}

/* Headings */
h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 1.5rem;
}

h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-top: 2rem;
    margin-bottom: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .navbar {
        flex-wrap: wrap;
        height: auto;
        padding: 1rem;
    }

    .nav-links {
        order: 3;
        width: 100%;
        margin-left: 0;
        margin-top: 1rem;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }

    .filters-row {
        flex-direction: column;
    }

    .filter-group {
        width: 100%;
    }

    .filter-group input,
    .filter-group select {
        width: 100%;
    }

    .outcome-list {
        grid-template-columns: 1fr;
    }

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