/* =============================
   Notebook - CSS
   Clean, Minimal, Professional
   ============================= */

:root {
    --bg: #f5f6fa;
    --surface: #ffffff;
    --primary: #052362;
    --primary-hover: #0b2870;
    --success: #16a34a;
    --success-bg: #dcfce7;
    --warning: #ea580c;
    --warning-bg: #fff7ed;
    --danger: #dc2626;
    --danger-bg: #fef2f2;
    --info: #083086;
    --info-bg: #eff6ff;
    --text: #1e293b;
    --text-light: #64748b;
    --border: #e2e8f0;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.1);
    --font: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

/* ---- Navbar ---- */
.navbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    font-weight: 800;
    font-size: 1.3rem;
    background: linear-gradient(135deg, #1e293b, #1d4aac);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

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

.nav-links a {
    text-decoration: none;
    color: var(--text);
    font-size: 15px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: var(--radius);
    transition: background 0.15s;
}

.nav-links a:hover {
    background: var(--bg);
}

/* ---- User Dropdown ---- */
.user-dropdown {
    position: relative;
    display: inline-block;
}

.user-dropdown-btn {
    background: transparent;
    color: var(--text-light);
    border: 1px solid var(--border);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.user-dropdown-btn:hover {
    background: var(--bg);
    color: var(--primary);
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.user-dropdown-btn:active {
    transform: translateY(0);
}

.user-icon {
    width: 20px;
    height: 20px;
}

.dropdown-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    z-index: 1000;
    overflow: hidden;
}

.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-header {
    padding: 12px 16px;
    background: var(--bg);
}

.dropdown-user-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
}

.dropdown-user-role {
    font-size: 11px;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

.dropdown-divider {
    height: 1px;
    background-color: var(--border);
}

.dropdown-item {
    display: block;
    width: 100%;
    padding: 10px 16px;
    text-decoration: none;
    font-size: 13px;
    color: var(--text);
    transition: background 0.15s ease, color 0.15s ease;
    text-align: left;
    border: none;
    background: transparent;
    cursor: pointer;
}

.dropdown-item:hover {
    background-color: var(--bg);
}

.dropdown-item.btn-logout {
    color: var(--danger) !important;
}

.dropdown-item.btn-logout:hover {
    background-color: var(--danger-bg);
}

/* ---- Container ---- */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px;
}

/* ---- Page Header ---- */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.page-header h1 {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, #1e293b, #1d4aac);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
    margin: 0;
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s;
}

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

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

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

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

.btn-full {
    width: 100%;
    justify-content: center;
    padding: 12px;
}

.btn-small {
    padding: 4px 10px;
    font-size: 12px;
}

.btn-verify {
    background: var(--success);
    color: #fff;
}

.btn-advance {
    background: var(--primary);
    color: #fff;
    padding: 10px 24px;
    font-size: 15px;
}

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

/* ---- Alerts ---- */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 14px;
    margin-bottom: 16px;
    font-weight: 500;
}

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

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

/* ---- Login ---- */
.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
}

.login-container {
    background: var(--surface);
    border-radius: 8px;
    padding: 40px;
    width: 400px;
    box-shadow: var(--shadow-lg);
}

.login-header {
    text-align: center;
    margin-bottom: 24px;
}

.login-icon {
    font-size: 36px;
    margin-bottom: 8px;
}

.login-header h1 {
    font-size: 2.2rem;
    font-weight: 800;
    background: linear-gradient(135deg, #1e293b, #1d4aac);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
    margin-bottom: 4px;
}

.login-header p {
    color: var(--text-light);
    font-size: 14px;
}

.login-form .form-group {
    margin-bottom: 16px;
}

/* ---- Forms ---- */
.form-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}

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

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: var(--font);
    transition: border-color 0.15s;
}

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

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-help {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 12px;
}

.checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

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

.inline-form {
    display: inline;
}

/* ---- Jobs Grid ---- */
.jobs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.job-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    text-decoration: none;
    color: var(--text);
    transition: box-shadow 0.15s, transform 0.1s;
    display: block;
    cursor: pointer;
}

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

.job-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.job-number {
    font-weight: 700;
    font-size: 15px;
    color: var(--primary);
}

.job-card-body h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.step-label {
    font-size: 13px;
    color: var(--text-light);
}

.job-card-footer {
    margin-top: 12px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
    color: var(--text-light);
}

.job-completed {
    border-left: 3px solid var(--success);
}

/* ---- Badges ---- */
.badge {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

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

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

.badge-info {
    background: var(--info-bg);
    color: var(--info);
}

/* ---- Progress Bar ---- */
.progress-bar-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    margin-bottom: 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow-x: auto;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 80px;
}

.step-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    border: 2px solid var(--border);
    background: var(--surface);
    color: var(--text-light);
    margin-bottom: 6px;
}

.progress-step.completed .step-circle {
    background: var(--success);
    border-color: var(--success);
    color: #fff;
}

.progress-step.current .step-circle {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.2);
}

.progress-step .step-label {
    font-size: 12px;
    font-weight: 600;
    text-align: center;
}

.step-assignee {
    font-size: 11px;
    color: var(--text-light);
    text-align: center;
}

.progress-connector {
    width: 40px;
    height: 2px;
    background: var(--border);
    margin: 0 4px;
    margin-bottom: 24px;
}

.progress-connector.completed {
    background: var(--success);
}

.progress-connector.current {
    background: var(--primary);
}

/* ---- Step Section ---- */
.step-section {
    margin-bottom: 24px;
}

.step-heading {
    font-size: 16px;
    font-weight: 700;
    padding: 12px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius) var(--radius) 0 0;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.assignee-badge {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-light);
    background: var(--bg);
    padding: 2px 8px;
    border-radius: 4px;
}

/* ---- Notes ---- */
.notes-list {
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
}

.note-card {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

.note-card:last-child {
    border-bottom: none;
}

.note-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
}

.note-header strong {
    font-size: 14px;
}

.note-date {
    font-size: 12px;
    color: var(--text-light);
}

.note-content {
    font-size: 14px;
    margin-bottom: 8px;
    line-height: 1.5;
}

.note-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.verification-badge {
    font-size: 11px;
    background: var(--success-bg);
    color: var(--success);
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.unverified-badge {
    font-size: 11px;
    background: var(--warning-bg);
    color: var(--warning);
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.no-notes {
    padding: 16px;
    color: var(--text-light);
    font-size: 13px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
}

/* ---- Add Note / Advance ---- */
.add-note-section,
.advance-section {
    margin-top: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}

.add-note-section h3,
.advance-section h3 {
    margin-bottom: 12px;
    font-size: 15px;
}

/* ---- Tables ---- */
.table-container {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 24px;
    overflow-x: auto;
}

.table-container h3 {
    margin-bottom: 16px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table th {
    background: var(--bg);
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-light);
    border-bottom: 2px solid var(--border);
}

.data-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
}

.row-inactive {
    opacity: 0.5;
}

.role-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
}

.role-admin {
    background: #fef3c7;
    color: #92400e;
}

.role-employee {
    background: var(--info-bg);
    color: var(--info);
}

/* ---- Workflow Steps ---- */
.step-order-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    margin-right: 6px;
}

.requires-verification-tag {
    font-size: 11px;
    color: var(--text-light);
    font-weight: 400;
    margin-left: 4px;
}

.assignment-row {
    padding: 12px;
    background: var(--bg);
    border-radius: var(--radius);
    margin-bottom: 8px;
}

/* ---- Warning ---- */
.warning-text {
    color: var(--warning);
    font-weight: 600;
    font-size: 14px;
}

/* ---- Empty State ---- */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-light);
    grid-column: 1 / -1;
}

.empty-state p {
    margin-bottom: 16px;
    font-size: 15px;
}

/* ---- Audit Section ---- */
.audit-section {
    margin-top: 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}

.audit-section h3 {
    margin-bottom: 8px;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }

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

    .navbar {
        padding: 0 12px;
    }

    .nav-links {
        gap: 8px;
    }

    .container {
        padding: 16px;
    }

    .progress-bar-container {
        padding: 16px 8px;
    }
}

/* ---- Note Bullets ---- */
.note-bullets {
    margin: 4px 0 0 0;
    padding-left: 20px;
    list-style: disc;
}

.note-bullets li {
    margin: 3px 0;
    line-height: 1.5;
}

/* ---- Verify Checklist ---- */
.verify-section {
    margin-top: 10px;
}

.verify-checklist {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 10px;
}

.checklist-label {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    margin: 0 0 8px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.checklist-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 4px 0;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.4;
}

.checklist-item input[type="checkbox"] {
    margin-top: 2px;
    width: 15px;
    height: 15px;
    cursor: pointer;
    flex-shrink: 0;
}

.btn-verify:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* ---- Issue Highlighting ---- */
.issue-minor {
    background-color: var(--info-bg) !important;
    border-left: 4px solid var(--info) !important;
    padding: 6px 12px !important;
    border-radius: var(--radius);
    margin: 6px 0 !important;
    display: inline-block;
    width: 100%;
}

.issue-medium {
    background-color: var(--warning-bg) !important;
    border-left: 4px solid var(--warning) !important;
    padding: 6px 12px !important;
    border-radius: var(--radius);
    margin: 6px 0 !important;
    display: inline-block;
    width: 100%;
}

.issue-critical {
    background-color: var(--danger-bg) !important;
    border-left: 4px solid var(--danger) !important;
    padding: 6px 12px !important;
    border-radius: var(--radius);
    margin: 6px 0 !important;
    display: inline-block;
    width: 100%;
    font-weight: 600;
}

/* Ensure note bullet lists display highlighted issues properly without bullet clutter */
.note-bullets li.issue-general,
.note-bullets li.issue-minor,
.note-bullets li.issue-medium,
.note-bullets li.issue-critical {
    list-style-type: none;
}

.issue-general {
    padding: 4px 0 !important;
    display: inline-block;
    width: 100%;
}

.text-issue-general {
    color: var(--text);
}

.text-issue-minor {
    color: var(--info) !important;
}

.text-issue-medium {
    color: var(--warning) !important;
}

.text-issue-critical {
    color: var(--danger) !important;
}