:root {
    --bg-body: #121212;
    --bg-nav: #1e1e1e;
    --bg-card: #252525;
    --bg-input: #2f2f2f;
    --text-main: #e0e0e0;
    --text-muted: #a0a0a0;
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --danger: #ef4444;
    --success: #22c55e;
    --border: #404040;
}

/* Paper / Print Variables - Light Mode by default for documents */
.paper-theme {
    --primary: #3b82f6;
    --text-dark: #222;
    --text-gray: #666;
    --border-color: #eee;
    --bg-paper: white;
}

/* Base Styles */
body {
    background: var(--bg-body);
    color: var(--text-main);
    font-family: 'Segoe UI', system-ui, sans-serif;
    margin: 0;
    padding: 0;
}

* {
    box-sizing: border-box;
}

/* Utility / Buttons */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--primary);
    color: white;
    text-decoration: none;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background 0.2s;
}

.btn:hover {
    background: var(--primary-hover);
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-secondary {
    background: var(--bg-nav);
    color: var(--text-main);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-input);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-success {
    background: var(--success);
    color: white;
}

/* Forms */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="search"],
select,
textarea {
    padding: 8px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-main);
    font-size: 0.95rem;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
}

/* Tables (Basic) */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.table th {
    background: var(--bg-nav);
    font-weight: 600;
}

/* Standardized View Layout */
.view-header {
    display: flex;
    justify-content: center;
    /* Centered Title */
    align-items: center;
    margin-bottom: 2rem;
    padding: 0 1rem;
    position: relative;
    width: 100%;
}

.view-header h1 {
    margin: 0;
    font-size: 1.8rem;
    color: var(--text-main);
}

.view-header .actions {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
}

.view-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    align-items: end;
}

.view-table-wrapper {
    background: var(--bg-card);
    border-radius: 8px;
    overflow: hidden;
    /* Rounds corners of table */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.view-table {
    width: 100%;
    border-collapse: collapse;
}

.view-table th {
    background: rgba(255, 255, 255, 0.03);
    padding: 0.5rem;
    /* Reduced from 1rem */
    text-align: left;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border);
    font-size: 0.9rem;
}

.view-table td {
    padding: 0.4rem 0.5rem;
    /* Reduced from 1rem */
    border-bottom: 1px solid var(--border);
    color: var(--text-main);
    vertical-align: middle;
    font-size: 0.95rem;
}

.row-clickable {
    cursor: pointer;
    transition: background 0.1s;
}

.row-clickable:hover {
    background: rgba(255, 255, 255, 0.02);
}

.table-loading {
    opacity: 0.6;
    pointer-events: none;
    transition: opacity 0.2s;
}

/* Action Buttons */
.btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border-radius: 4px;
    margin-left: 4px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-edit {
    background: var(--primary);
    /* Blue */
    color: white;
    border: 1px solid var(--primary);
}

.btn-edit:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

.btn-preview {
    background: white;
    color: #000;
    border: 1px solid var(--border);
}

.btn-preview:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.btn-internal {
    background: transparent;
    color: #ef4444;
    border: 1px solid #ef4444;
    opacity: 0.8;
}

.btn-internal:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    opacity: 1;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .view-filters {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }

    .view-header {
        flex-direction: column;
        gap: 1rem;
        margin-bottom: 1rem;
    }

    .view-header .actions {
        position: static;
        transform: none;
        width: 100%;
    }

    .view-header .actions .btn {
        width: 100%;
        text-align: center;
    }

    .hide-mobile {
        display: none !important;
    }

    .show-mobile-only {
        display: block !important;
    }

    .view-table th,
    .view-table td {
        padding: 0.75rem;
    }
}

.show-mobile-only {
    display: none;
}