/* ========== Reset & Base ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f0f2f5;
    color: #333;
    min-height: 100vh;
}

a {
    color: #4a90d9;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ========== Auth Pages ========== */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 80px);
    padding: 20px;
}

.auth-card {
    background: #fff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    width: 100%;
    max-width: 420px;
}

.auth-card h1 {
    text-align: center;
    color: #4a90d9;
    margin-bottom: 8px;
    font-size: 1.6em;
}

.auth-card h2 {
    text-align: center;
    color: #666;
    margin-bottom: 24px;
    font-weight: 400;
    font-size: 1.1em;
}

.auth-link {
    text-align: center;
    margin-top: 20px;
    color: #666;
}

/* ========== Forms ========== */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #444;
    font-size: 0.9em;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.2s;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #4a90d9;
    box-shadow: 0 0 0 3px rgba(74,144,217,0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

/* ========== Buttons ========== */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    text-align: center;
    text-decoration: none;
}

.btn:hover {
    text-decoration: none;
    transform: translateY(-1px);
}

.btn-primary {
    background: #4a90d9;
    color: #fff;
}

.btn-primary:hover {
    background: #3a7bc8;
}

.btn-outline {
    background: transparent;
    color: #4a90d9;
    border: 1px solid #4a90d9;
}

.btn-outline:hover {
    background: #4a90d9;
    color: #fff;
}

.btn-edit {
    background: #f0ad4e;
    color: #fff;
}

.btn-edit:hover {
    background: #ec971f;
}

.btn-danger {
    background: #d9534f;
    color: #fff;
}

.btn-danger:hover {
    background: #c9302c;
}

.btn-full {
    width: 100%;
}

.btn-small {
    padding: 6px 14px;
    font-size: 0.85em;
}

/* ========== Alerts ========== */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.9em;
}

.alert-error {
    background: #fdf0f0;
    color: #d9534f;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background: #f0fdf4;
    color: #27a745;
    border: 1px solid #c3e6cb;
}

/* ========== Navbar ========== */
.navbar {
    background: #fff;
    padding: 14px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    font-size: 1.2em;
    font-weight: 700;
    color: #4a90d9;
}

.nav-brand a {
    color: inherit;
    text-decoration: none;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 14px;
    color: #666;
}

/* ========== Container ========== */
.container {
    max-width: 960px;
    margin: 30px auto;
    padding: 0 20px;
}

/* ========== Page Header ========== */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.page-header h2 {
    color: #333;
}

/* ========== Table ========== */
.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.data-table thead {
    background: #4a90d9;
    color: #fff;
}

.data-table th,
.data-table td {
    padding: 12px 16px;
    text-align: left;
}

.data-table tbody tr {
    border-bottom: 1px solid #f0f0f0;
}

.data-table tbody tr:hover {
    background: #f8fafc;
}

.data-table .actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.inline-form {
    display: inline;
}

.link-public {
    color: #4a90d9;
    font-weight: 500;
}

/* ========== Empty State ========== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    color: #999;
    font-size: 1.1em;
}

/* ========== Report Form ========== */
.report-form {
    background: #fff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 10px;
}

/* ========== Public Link Section ========== */
.public-link-section {
    margin-top: 30px;
    background: #fff;
    padding: 24px;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.public-link-section h3 {
    margin-bottom: 12px;
    color: #444;
}

.link-box {
    display: flex;
    gap: 10px;
}

.link-box input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.9em;
    background: #f8f9fa;
    color: #555;
}

/* ========== Public Report View ========== */
.public-container {
    max-width: 800px;
    margin: 40px auto;
    padding: 0 20px;
}

.report-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    overflow: hidden;
}

.report-header {
    background: #4a90d9;
    color: #fff;
    padding: 30px;
}

.report-header h1 {
    margin-bottom: 10px;
    font-size: 1.6em;
}

.report-meta {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    font-size: 0.85em;
    opacity: 0.9;
}

.report-content {
    padding: 30px;
    line-height: 1.8;
    font-size: 1.05em;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.qr-section {
    padding: 30px;
    text-align: center;
    border-top: 1px solid #eee;
    background: #fafbfc;
}

.qr-section h3 {
    margin-bottom: 16px;
    color: #444;
}

#qrcode {
    display: inline-block;
    padding: 16px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    margin-bottom: 12px;
}

.qr-url {
    font-size: 0.8em;
    color: #999;
    word-break: break-all;
    margin-bottom: 16px;
}

/* ========== Print ========== */
@media print {
    .navbar, .btn, .qr-url {
        display: none !important;
    }
    body {
        background: #fff;
    }
    .report-card {
        box-shadow: none;
    }
    .qr-section {
        page-break-inside: avoid;
    }
    #qrcode {
        box-shadow: none;
    }
}

/* ========== Developer Footer ========== */
.dev-footer {
    text-align: center;
    padding: 20px;
    color: #999;
    font-size: 0.8em;
    margin-top: 40px;
    border-top: 1px solid #eee;
}

.dev-footer a {
    color: #4a90d9;
}

/* ========== Responsive ========== */
@media (max-width: 600px) {
    .navbar {
        padding: 12px 16px;
    }
    .page-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
    .data-table th,
    .data-table td {
        padding: 10px 12px;
        font-size: 0.85em;
    }
    .report-meta {
        flex-direction: column;
        gap: 4px;
    }
    .auth-card {
        padding: 24px;
    }
    .link-box {
        flex-direction: column;
    }
}
