/* Vurdera Styles */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f0f2f5;
    color: #1a1d23;
    line-height: 1.6;
    font-size: 0.9375rem;
}

/* Login */
.login-container {
    max-width: 420px;
    margin: 100px auto;
    padding: 2.5rem;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
    text-align: center;
}

.login-logo {
    margin-bottom: 1rem;
}

.login-logo svg {
    border-radius: 14px;
}

.login-container h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #0f4c75;
    margin-bottom: 0.25rem;
    letter-spacing: -0.02em;
}

.login-container h2 {
    font-size: 0.95rem;
    font-weight: 400;
    color: #7c8498;
    margin-bottom: 2rem;
}

.login-form {
    text-align: left;
}

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

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.35rem;
    font-size: 0.8125rem;
    color: #4a5062;
    letter-spacing: 0.01em;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.6rem 0.85rem;
    border: 1px solid #d4d8e0;
    border-radius: 8px;
    font-size: 0.875rem;
    font-family: inherit;
    background: #fafbfc;
    color: #1a1d23;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #0f4c75;
    box-shadow: 0 0 0 3px rgba(15,76,117,0.1);
    background: #fff;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 2.25rem;
    padding: 0 1.1rem;
    border: none;
    border-radius: 8px;
    font-size: 0.8125rem;
    font-weight: 500;
    font-family: inherit;
    line-height: 1;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    letter-spacing: 0.01em;
    white-space: nowrap;
    vertical-align: middle;
    box-sizing: border-box;
}

.btn-primary {
    background: #0f4c75;
    color: #fff;
}

.btn-primary:hover {
    background: #0a3a5c;
    box-shadow: 0 2px 8px rgba(15,76,117,0.25);
}

.btn-secondary {
    background: #e8eaef;
    color: #3d4455;
}

.btn-secondary:hover {
    background: #d4d8e0;
}

.btn-danger {
    background: #d64545;
    color: #fff;
}

.btn-danger:hover {
    background: #b83b3b;
    box-shadow: 0 2px 8px rgba(214,69,69,0.25);
}

.btn-success {
    background: #1a9a5c;
    color: #fff;
}

.btn-success:hover {
    background: #158049;
    box-shadow: 0 2px 8px rgba(26,154,92,0.25);
}

.btn-sm {
    height: 1.75rem;
    padding: 0 0.65rem;
    font-size: 0.75rem;
    border-radius: 6px;
}

/* Alerts */
.alert {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.8125rem;
    font-weight: 500;
    border-left: 4px solid;
}

.alert-error {
    background: #fef2f2;
    color: #b83b3b;
    border-left-color: #d64545;
}

.alert-success {
    background: #f0faf4;
    color: #158049;
    border-left-color: #1a9a5c;
}

.alert-info {
    background: #eef4fb;
    color: #0f4c75;
    border-left-color: #3b82c4;
}

/* Navigation */
.admin-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #0f2b3d, #163d57);
    padding: 0 1.5rem;
    height: 54px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}

.nav-left, .nav-right {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.admin-nav a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: 500;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    transition: all 0.2s;
}

.admin-nav a:hover {
    color: #fff;
    background: rgba(255,255,255,0.1);
}

.nav-brand {
    font-weight: 700 !important;
    color: #fff !important;
    font-size: 1rem !important;
    margin-right: 0.75rem;
    letter-spacing: -0.02em;
}

.phase-badge {
    padding: 0.25rem 0.7rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #fff;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

/* Main content */
.admin-main {
    max-width: 1240px;
    margin: 1.75rem auto;
    padding: 0 1.5rem;
}

.admin-main h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    color: #0f2b3d;
    letter-spacing: -0.02em;
}

/* Cards */
.card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    padding: 1.5rem;
    margin-bottom: 1rem;
    border: 1px solid #e8eaef;
}

.card h2 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #1a1d23;
    letter-spacing: -0.01em;
}

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

.stat-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    padding: 1.25rem 1.5rem;
    border: 1px solid #e8eaef;
    border-top: 3px solid #0f4c75;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #0f2b3d;
    letter-spacing: -0.02em;
}

.stat-card .stat-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: #7c8498;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 0.15rem;
}

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

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

th, td {
    padding: 0.7rem 0.85rem;
    text-align: left;
    border-bottom: 1px solid #eceef2;
}

th {
    background: #f7f8fa;
    font-weight: 600;
    font-size: 0.7rem;
    color: #7c8498;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid #e8eaef;
    vertical-align: top;
}

tr:hover td {
    background: #f7f8fa;
}

/* Phase controls */
.phase-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem 1.25rem;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    border: 1px solid #e8eaef;
}

.phase-controls .current-phase {
    font-weight: 600;
    color: #0f2b3d;
}

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15,43,61,0.5);
    backdrop-filter: blur(4px);
    z-index: 100;
    align-items: center;
    justify-content: center;
}

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

.modal {
    background: #fff;
    border-radius: 12px;
    padding: 1.75rem;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.modal h2 {
    margin-bottom: 1rem;
    color: #0f2b3d;
}

.modal-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-top: 1.25rem;
}

/* Utility */
.text-muted { color: #7c8498; }
.text-sm { font-size: 0.75rem; }
.mt-1 { margin-top: 0.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }

/* Status indicators */
.status-active { color: #1a9a5c; font-weight: 500; }
.status-withdrawn { color: #d64545; font-weight: 500; }
.status-submitted { color: #1a9a5c; font-weight: 500; }
.status-draft { color: #c4860b; font-weight: 500; }
.status-pending { color: #7c8498; font-weight: 500; }
.status-recused { color: #7c4dba; font-weight: 500; }

/* Checkbox list (assignments) */
.checkbox-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e8eaef;
    border-radius: 8px;
    padding: 0.5rem;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.35rem;
    cursor: pointer;
    font-size: 0.8125rem;
    border-radius: 6px;
}

.checkbox-item:hover {
    background: #f7f8fa;
}

.checkbox-item input[type="checkbox"] {
    width: auto;
}

/* Assignment groups */
.assignment-group + .assignment-group {
    border-top: 1px solid #eceef2;
    padding-top: 0.5rem;
}

/* Split-screen review layout */
.review-layout {
    display: flex;
    gap: 1rem;
    min-height: calc(100vh - 120px);
}

.review-pdf {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.pdf-toolbar {
    display: flex;
    align-items: center;
    padding: 0.6rem 1rem;
    background: #fff;
    border-radius: 12px 12px 0 0;
    border-bottom: 1px solid #eceef2;
    font-size: 0.8125rem;
    border: 1px solid #e8eaef;
    border-bottom: 1px solid #eceef2;
}

.pdf-iframe {
    flex: 1;
    border: none;
    background: #fff;
    border-radius: 0 0 12px 12px;
    min-height: 500px;
    border: 1px solid #e8eaef;
    border-top: none;
}

.review-form-panel {
    flex: 1;
    overflow-y: auto;
    max-height: calc(100vh - 80px);
    padding-right: 0.5rem;
}

/* Category group headers */
.category-header {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    padding: 0.5rem 0;
    border-bottom: 2px solid #0f4c75;
}

.category-header h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #0f2b3d;
    letter-spacing: -0.01em;
    margin: 0;
}

/* Criterion blocks */
.criterion-block {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    padding: 1.25rem 1.5rem;
    margin-bottom: 0.75rem;
    border: 1px solid #e8eaef;
}

.criterion-block h3 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
    color: #0f2b3d;
}

/* Score radio buttons */
.score-radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: 0.35rem;
}

.score-radio {
    cursor: pointer;
}

.score-radio input {
    display: none;
}

.score-radio span {
    display: inline-block;
    padding: 0.35rem 0.55rem;
    border: 1.5px solid #d4d8e0;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    min-width: 2.5rem;
    text-align: center;
    transition: all 0.15s;
    color: #4a5062;
    background: #fafbfc;
}

.score-radio input:checked + span {
    background: #0f4c75;
    color: #fff;
    border-color: #0f4c75;
    box-shadow: 0 2px 6px rgba(15,76,117,0.25);
}

.score-radio:hover span {
    border-color: #0f4c75;
    background: #eef4fb;
}

.score-radio input:disabled + span {
    opacity: 0.5;
    cursor: default;
}

/* Round 1 display box */
.r1-display {
    background: #fdf8ee;
    border: 1px solid #f0dfa8;
    border-radius: 8px;
    padding: 0.6rem 0.85rem;
    margin: 0.5rem 0;
    font-size: 0.8rem;
}
details.r1-display summary {
    cursor: pointer;
    list-style: revert;
}
details.r1-display[open] summary {
    margin-bottom: 0.4rem;
}

/* Form actions */
.form-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    padding: 1rem 0;
    position: sticky;
    bottom: 0;
    background: linear-gradient(transparent, #f0f2f5 30%);
    padding-top: 1.5rem;
}

/* Mobile PDF button — hidden on desktop */
.mobile-pdf-btn {
    display: none;
}

/* Mobile: stack layout */
@media (max-width: 768px) {
    .review-layout {
        flex-direction: column;
    }

    .review-pdf {
        display: none;
    }

    .mobile-pdf-btn {
        display: block;
        margin-bottom: 1rem;
    }

    .review-form-panel {
        max-height: none;
        overflow-y: visible;
    }

    .admin-main {
        padding: 0 0.75rem;
    }

    .admin-nav {
        flex-wrap: wrap;
        height: auto;
        padding: 0.5rem 1rem;
        gap: 0.5rem;
    }

    .nav-left, .nav-right {
        flex-wrap: wrap;
    }

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

    .phase-controls {
        flex-wrap: wrap;
    }

    .score-radio-group {
        gap: 0.15rem;
    }

    .score-radio span {
        padding: 0.25rem 0.35rem;
        font-size: 0.75rem;
        min-width: 2rem;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
    }

    table {
        font-size: 0.75rem;
    }

    th, td {
        padding: 0.4rem 0.5rem;
    }
}
