/* Smart Books Internal Audit - Premium Styles */
:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --secondary: #64748b;
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --success: #22c55e;
    --danger: #ef4444;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--bg-card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.02);
    z-index: 10;
}

.brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-item {
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 500;
    color: var(--secondary);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-item:hover {
    background-color: #f1f5f9;
    color: var(--primary);
}

.nav-item.active {
    background-color: #eff6ff;
    color: var(--primary);
}

/* Main Content */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    position: relative;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.page-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--text-main);
}

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
}

/* Cards & Forms */
.card {
    background: var(--bg-card);
    border-radius: 1rem;
    padding: 1.5rem;
    border: 1px solid var(--border);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    margin-bottom: 1.5rem;
    animation: fadeIn 0.4s ease-out;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-main);
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.75rem;
}

/* Checklist Items */
.checklist-item {
    display: flex;
    align-items: flex-start;
    padding: 1rem;
    border-bottom: 1px solid #f1f5f9;
    gap: 1.5rem;
}

.checklist-item:last-child {
    border-bottom: none;
}

.item-content {
    flex: 1;
}

.item-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.item-desc {
    font-size: 0.875rem;
    color: var(--secondary);
    line-height: 1.5;
}

.item-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 200px;
}

.toggle-group {
    display: flex;
    background: #f1f5f9;
    padding: 0.25rem;
    border-radius: 0.375rem;
}

.toggle-btn {
    flex: 1;
    text-align: center;
    padding: 0.25rem;
    font-size: 0.875rem;
    border-radius: 0.25rem;
    cursor: pointer;
    font-weight: 500;
}

.toggle-btn.yes.selected {
    background: var(--success);
    color: white;
}

.toggle-btn.no.selected {
    background: var(--danger);
    color: white;
}

.remarks-input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    font-size: 0.875rem;
}

/* Data Tables */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background: #f8fafc;
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--secondary);
    border-bottom: 1px solid var(--border);
}

td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.input-cell {
    width: 100%;
    padding: 0.375rem;
    border: 1px solid transparent;
    border-radius: 0.25rem;
    background: transparent;
}

.input-cell:focus {
    background: white;
    border-color: var(--primary);
    outline: none;
}

.input-cell:hover {
    background: #f8fafc;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Intro Dashboard */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 1rem;
    border: 1px solid var(--border);
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin: 0.5rem 0;
}

.toggle-btn.na.selected {
    background: var(--secondary);
    color: white;
}

/* Delete Button */
.btn-delete {
    background: #fee2e2;
    color: #ef4444;
    border: none;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    cursor: pointer;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.btn-delete:hover {
    background: #fecaca;
}

/* Bulk Delete UI */
.btn-danger {
    background: #ef4444;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.25rem;
    cursor: pointer;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-danger:hover {
    background: #dc2626;
}

.checkbox-cell {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.btn-delete:hover {
    background: #fecaca;
}

/* Draft Dashboard */
.draft-list {
    display: grid;
    gap: 1rem;
    margin-top: 1.5rem;
}

.draft-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    transition: all 0.2s;
}

.draft-item:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.draft-info {
    flex: 1;
}

.draft-title {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-main);
}

.draft-meta {
    font-size: 0.75rem;
    color: var(--secondary);
    margin-top: 0.25rem;
}

.draft-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-sm {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
}

/* Sidebar Footer */
.sidebar-footer {
    margin-top: auto;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    font-size: 0.75rem;
    color: var(--secondary);
    line-height: 1.5;
}

.sidebar-footer div {
    margin-bottom: 0.125rem;
}

.sidebar-footer .contact-title {
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.7rem;
}

/* Contact Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s;
}

.modal-content {
    background-color: white;
    padding: 2rem;
    border-radius: 1rem;
    width: 90%;
    max-width: 400px;
    text-align: center;
    position: relative;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    line-height: 1;
}

.close-btn:hover {
    color: var(--text-main);
}

/* Login Overlay */
#login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #f8fafc;
    display: flex;
    /* Flex by default, JS will hide it */
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.login-card {
    background: white;
    padding: 2.5rem;
    border-radius: 1rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-input {
    width: 100%;
    padding: 0.75rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    font-size: 1rem;
}

.login-footer {
    margin-top: 1.5rem;
    font-size: 0.875rem;
    color: var(--secondary);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: #eff6ff;
}

.btn-logout {
    margin-top: 1rem;
    background: #fef2f2;
    color: var(--danger);
    border: 1px solid #fee2e2;
    width: 100%;
    justify-content: center;
}

.btn-logout:hover {
    background: #fee2e2;
}

/* Registration & Payment Views */
.auth-view {
    display: none;
    /* Hidden by default */
    width: 100%;
}

.auth-view.active {
    display: block;
    animation: fadeIn 0.3s;
}

.qr-container {
    background: #f1f5f9;
    padding: 1rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border);
    margin: 1rem 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    font-size: 0.875rem;
    color: var(--secondary);
}

.text-danger {
    color: var(--danger);
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.form-group {
    text-align: left;
    margin-bottom: 1rem;
}

.form-label {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    display: block;
    color: var(--text-main);
}