/* Workbench Web Application Styles */

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

:root {
    /* IT Theme (default) - matches main app */
    --accent-color: #1f6feb;
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-hover: #1a5bb8;
    --secondary-color: #764ba2;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    --bg-color: #f8fafc;
    --text-color: #1f2937;
    --text-light: #6b7280;
    --border-color: #e5e7eb;
    --sidebar-bg: #ffffff;
    --sidebar-text: #1f2937;
    --card-bg: #ffffff;
    --sidebar-active-bg: #dbeafe;
    --sidebar-active-text: #1e40af;
    --sidebar-active-border: #1f6feb;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
        'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
        sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    margin: 0;
    font-size: 0.875rem; /* Better base font size */
}

.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 256px; /* w-64 equivalent (16rem = 256px) */
    background-color: #ffffff; /* bg-white */
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    border-right: 1px solid #e5e7eb; /* border-gray-200 */
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.sidebar-header {
    padding: 1.5rem; /* Better padding */
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 0.75rem;
    width: 100%;
}

.company-logo {
    max-width: 180px; /* Scaled to fit sidebar width better (256px - padding) */
    max-height: 120px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.logo {
    font-size: 1.5rem; /* text-2xl */
    font-weight: 700; /* font-bold */
    color: #1f2937; /* text-gray-800 */
    margin: 0;
    text-align: center;
    width: 100%;
}

.sidebar-header p {
    font-size: 0.875rem; /* text-sm */
    color: #6b7280; /* text-gray-500 */
    margin: 0;
}

.sidebar-nav {
    flex: 1;
    padding: 1.5rem 0.75rem; /* Better padding */
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem; /* Better padding */
    color: #374151; /* text-gray-700 */
    text-decoration: none;
    transition: all 0.2s;
    border-right: 2px solid transparent;
    border-radius: 0.5rem; /* rounded-lg */
    font-size: 0.875rem; /* text-sm */
    font-weight: 500; /* font-medium */
    margin-bottom: 0.25rem;
}

.nav-link:hover {
    background-color: #f3f4f6; /* hover:bg-gray-100 */
    color: #111827; /* text-gray-700 */
}

.nav-link.active {
    background-color: var(--sidebar-active-bg);
    color: var(--sidebar-active-text);
    border-right-color: var(--sidebar-active-border);
    font-weight: 500;
}

.nav-icon {
    margin-right: 0.75rem; /* Better spacing */
    font-size: 1rem; /* Better icon size */
    width: 1.25rem;
    text-align: center;
}

/* Navigation Section (for nested items) */
.nav-section {
    margin-top: 0.32rem; /* Reduced to match 80% zoom (0.4rem * 0.8) */
}

.nav-link-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-link-primary {
    flex: 1;
    font-weight: 500;
}

.nav-link-primary:hover {
    background-color: #dbeafe;
    color: #1e40af;
}

.nav-link-primary.active {
    background-color: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
    border-right: 2px solid var(--sidebar-active-border);
}

.nav-toggle {
    background: none;
    border: none;
    padding: 0.24rem 0.48rem; /* Reduced to match 80% zoom (0.3rem * 0.8, 0.6rem * 0.8) */
    color: #6b7280;
    cursor: pointer;
    font-size: 0.64rem; /* Reduced to match 80% zoom (0.8rem * 0.8) */
    transition: color 0.2s;
    margin-right: 0.32rem; /* Reduced to match 80% zoom (0.4rem * 0.8) */
}

.nav-toggle:hover {
    color: #374151;
}

.nav-sub-items {
    margin-left: 0.64rem; /* Reduced to match 80% zoom (0.8rem * 0.8) - equivalent to ml-4 in Tailwind */
    margin-top: 0.16rem; /* Reduced to match 80% zoom (0.2rem * 0.8) */
}

.nav-link-sub {
    padding-left: 1rem; /* Better indentation (ml-4 equivalent) */
    color: #4b5563; /* text-gray-600 */
    font-size: 0.875rem; /* text-sm */
}

.nav-link-sub:hover {
    background-color: #f9fafb;
    color: #1f2937;
}

.nav-link-sub.active {
    background-color: var(--sidebar-active-bg);
    color: var(--sidebar-active-text);
    border-right-color: var(--sidebar-active-border);
}

.nav-link-sub .nav-icon {
    font-size: 0.875rem; /* Slightly smaller icons for sub-items */
    width: 1rem;
}

.sidebar-footer {
    border-top: 1px solid var(--border-color);
    padding: 0.64rem 0; /* Reduced to match 80% zoom (0.8rem * 0.8) */
}

.user-info {
    padding: 0.48rem 0.96rem; /* Reduced to match 80% zoom (0.6rem * 0.8, 1.2rem * 0.8) */
    font-size: 0.56rem; /* Reduced to match 80% zoom (0.7rem * 0.8) */
    color: var(--sidebar-text);
    opacity: 0.8;
}

.username {
    font-weight: 500;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 256px; /* w-64 equivalent (16rem = 256px) */
    padding: 1.5rem; /* Better padding */
    min-height: 100vh;
    background-color: #f3f4f6; /* bg-gray-100 */
}

/* Cards - Enhanced to match main app */
.card {
    background: var(--card-bg);
    border-radius: 0.5rem;
    padding: 1.5rem; /* Better padding */
    margin-bottom: 1.5rem; /* Better spacing */
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    border: 1px solid var(--border-color);
}

.card h1,
.card h2 {
    margin-bottom: 0.5rem;
    color: #1f2937; /* text-gray-800 */
    font-size: 1.5rem; /* text-2xl */
    font-weight: 700; /* font-bold */
    line-height: 1.2;
}

.card h2 {
    font-size: 1.25rem; /* text-xl */
}

.card p {
    color: #4b5563; /* text-gray-600 */
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-color);
    font-size: 0.875rem;
}

/* Input Fields - Enhanced to match main app */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="date"],
input[type="password"],
input[type="search"],
textarea {
    width: 100%;
    padding: 0.5rem 1rem; /* px-4 py-2 equivalent */
    border: 1px solid #d1d5db; /* border-gray-300 */
    border-radius: 0.5rem; /* rounded-lg */
    font-size: 0.875rem;
    font-family: inherit;
    background-color: #ffffff;
    color: var(--text-color);
    transition: all 0.2s;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
textarea:focus {
    outline: none;
    border-color: transparent;
    box-shadow: 0 0 0 2px var(--accent-color); /* focus:ring-2 focus:ring-blue-500 */
}

input[type="text"]:disabled,
input[type="email"]:disabled,
input[type="tel"]:disabled,
input[type="number"]:disabled,
input[type="date"]:disabled,
input[type="password"]:disabled,
input[type="search"]:disabled,
textarea:disabled {
    background-color: #f3f4f6; /* bg-gray-100 */
    cursor: not-allowed;
    opacity: 0.6;
}

/* Search Input with Icon */
.search-input-wrapper {
    position: relative;
}

.search-input-wrapper input[type="text"],
.search-input-wrapper input[type="search"] {
    padding-left: 2.5rem; /* Space for search icon */
}

.search-input-wrapper::before {
    content: '';
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1rem;
    height: 1rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%239ca3af'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z' /%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    pointer-events: none;
    z-index: 1;
}

/* Select Dropdowns - Enhanced with arrow */
.form-group select,
select {
    width: 100%;
    padding: 0.5rem 2.5rem 0.5rem 1rem; /* Space for dropdown arrow */
    border: 1px solid #d1d5db; /* border-gray-300 */
    border-radius: 0.5rem; /* rounded-lg */
    font-size: 0.875rem;
    font-family: inherit;
    background-color: #ffffff;
    color: var(--text-color);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%239ca3af'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7' /%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 1rem 1rem;
    transition: all 0.2s;
}

.form-group select:focus,
select:focus {
    outline: none;
    border-color: transparent;
    box-shadow: 0 0 0 2px var(--accent-color);
}

.form-group select:disabled,
select:disabled {
    background-color: #f3f4f6;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Select wrapper for custom styling */
.select-wrapper {
    position: relative;
}

.select-wrapper::after {
    content: '';
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1rem;
    height: 1rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%239ca3af'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7' /%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    pointer-events: none;
    z-index: 1;
    transition: transform 0.2s;
}

.select-wrapper:focus-within::after {
    transform: translateY(-50%) rotate(180deg);
}

/* Form group inputs inherit from base input styles above */
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* Readonly field styling for view modals */
.readonly-field {
    padding: 0.5rem 0.75rem;
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    color: var(--text-color);
    font-size: 0.875rem;
    min-height: 2.5rem;
    display: flex;
    align-items: center;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.readonly-field:empty::before {
    content: '-';
    color: var(--text-light);
}

/* Buttons - Enhanced to match main app */
.btn,
button[type="button"],
button[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem; /* px-4 py-2 */
    background-color: #2563eb; /* bg-blue-600 */
    color: white;
    border: none;
    border-radius: 0.5rem; /* rounded-lg */
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    line-height: 1.5;
}

.btn:hover,
button[type="button"]:hover:not(:disabled),
button[type="submit"]:hover:not(:disabled) {
    background-color: #1d4ed8; /* hover:bg-blue-700 */
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.btn:focus,
button[type="button"]:focus:not(:disabled),
button[type="submit"]:focus:not(:disabled) {
    outline: none;
    box-shadow: 0 0 0 2px var(--accent-color); /* focus:ring-2 focus:ring-blue-500 */
}

.btn:active,
button[type="button"]:active:not(:disabled),
button[type="submit"]:active:not(:disabled) {
    transform: translateY(0);
}

.btn:disabled,
button[type="button"]:disabled,
button[type="submit"]:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-primary {
    background-color: #2563eb; /* bg-blue-600 */
}

.btn-primary:hover {
    background-color: #1d4ed8; /* hover:bg-blue-700 */
}

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

.btn-success:hover {
    background-color: color-mix(in srgb, var(--success-color) 85%, black);
}

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

.btn-danger:hover {
    background-color: color-mix(in srgb, var(--danger-color) 85%, black);
}

.btn-warning {
    background-color: var(--warning-color);
    color: white;
}

.btn-warning:hover {
    background-color: color-mix(in srgb, var(--warning-color) 85%, black);
}

.btn-info {
    background-color: var(--info-color);
    color: white;
}

.btn-info:hover {
    background-color: color-mix(in srgb, var(--info-color) 85%, black);
}

.btn-secondary {
    background-color: var(--text-light);
}

.btn-block {
    display: block;
    width: 100%;
    text-align: center;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Tables - Enhanced to match main app */
.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg);
    min-width: 100%;
}

table thead {
    background-color: #f9fafb; /* bg-gray-50 */
}

table th {
    padding: 0.75rem 1rem; /* px-3 py-3 */
    text-align: left;
    font-weight: 500; /* font-medium */
    color: #6b7280; /* text-gray-500 */
    border-bottom: 1px solid #e5e7eb; /* divide-gray-200 */
    font-size: 0.75rem; /* text-xs */
    text-transform: uppercase;
    letter-spacing: 0.05em; /* tracking-wider */
    white-space: nowrap;
}

table th.sortable {
    cursor: pointer;
    user-select: none;
}

table th.sortable:hover {
    background-color: #f3f4f6; /* hover:bg-gray-100 */
}

table th .sort-indicator {
    display: inline-block;
    margin-left: 0.25rem;
    font-size: 0.625rem;
    color: var(--accent-color);
}

table td {
    padding: 0.75rem 1rem; /* px-3 py-3 */
    border-bottom: 1px solid #e5e7eb; /* divide-gray-200 */
    font-size: 0.875rem;
    color: var(--text-color);
}

table tbody tr {
    transition: background-color 0.15s;
}

table tbody tr:hover {
    background-color: #f9fafb; /* hover:bg-gray-50 */
}

table tbody tr:last-child td {
    border-bottom: none;
}

table tbody tr.empty-row td {
    text-align: center;
    color: #6b7280; /* text-gray-500 */
    padding: 2rem 1rem;
    font-style: italic;
}

/* Clickable data rows (open the record on click / Enter) */
table tbody tr.clickable-row {
    cursor: pointer;
}

table tbody tr.clickable-row:focus-visible {
    outline: 2px solid var(--accent-color, #1f6feb);
    outline-offset: -2px;
    background-color: #eff6ff;
}

/* Friendly empty state shown inside an otherwise empty table */
.empty-state {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--text-light, #6b7280);
}

.empty-state .empty-state-icon {
    font-size: 2.25rem;
    display: block;
    margin-bottom: 0.5rem;
}

.empty-state .empty-state-title {
    font-weight: 600;
    color: var(--text-color, #111827);
    margin-bottom: 0.25rem;
}

.empty-state .empty-state-actions {
    margin-top: 1rem;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.alert-success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-info {
    background-color: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

.alert-warning {
    background-color: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
}

.badge-success {
    background-color: #d1fae5;
    color: #065f46;
}

.badge-danger {
    background-color: #fee2e2;
    color: #991b1b;
}

.badge-warning {
    background-color: #fef3c7;
    color: #92400e;
}

.badge-info {
    background-color: #dbeafe;
    color: #1e40af;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--card-bg);
    border-radius: 0.5rem;
    padding: 2rem;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    z-index: 1001;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Ensure selects in modals are clickable and dropdowns appear correctly */
.modal select {
    position: relative;
    z-index: 10;
    pointer-events: auto !important;
    cursor: pointer;
}

.modal select:focus {
    z-index: 11;
}

/* Ensure modal content doesn't block pointer events */
.modal-content {
    pointer-events: auto;
}

/* Ensure modal body allows interactions */
.modal-body {
    pointer-events: auto;
    position: relative;
}

/* Prevent modal body from clipping select dropdowns */
.modal-body select {
    position: relative;
    z-index: 100;
}

/* When select is focused, ensure dropdown appears above everything */
.modal-body select:focus {
    z-index: 101;
    position: relative;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
}

.modal-close:hover {
    color: var(--text-color);
}

/* Search and Filters - Enhanced */
.search-filter-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.search-filter-bar input,
.search-filter-bar select {
    flex: 1;
    min-width: 200px;
}

.search-filter-bar .search-wrapper {
    flex: 1;
    min-width: 200px;
    position: relative;
}

.search-filter-bar .search-wrapper input {
    padding-left: 2.5rem;
}

.search-filter-bar .search-wrapper::before {
    content: '';
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1rem;
    height: 1rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%239ca3af'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z' /%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    pointer-events: none;
    z-index: 1;
}

.search-filter-bar .result-count {
    font-size: 0.875rem;
    color: #6b7280; /* text-gray-500 */
    white-space: nowrap;
}

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

.stat-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
}

.stat-card h3 {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--text-color);
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

.flex {
    display: flex;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }

/* Enhanced Modal Styles */
.modal-large {
    max-width: 900px;
    width: 95%;
}

.modal-body {
    padding: 1.5rem 0;
}

.card-header-gradient {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
}

.card-header-gradient h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.25rem;
}

.card-header-gradient p {
    margin: 0;
    opacity: 0.9;
    font-size: 0.875rem;
}

.card-section {
    background: #f9fafb;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.card-section h4 {
    margin: 0 0 1rem 0;
    font-size: 1.125rem;
    color: var(--text-color);
}

.card-section h5 {
    margin: 1.5rem 0 1rem 0;
    font-size: 1rem;
    color: var(--text-color);
    font-weight: 600;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.modal-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.action-buttons-right {
    display: flex;
    gap: 0.75rem;
}

.linked-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.linked-item:hover {
    background: #f3f4f6;
    border-color: var(--accent-color);
    transform: translateX(4px);
}

.linked-item-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
}

.linked-item-name {
    font-weight: 600;
    color: var(--text-color);
}

.linked-item-type {
    font-size: 0.875rem;
    color: var(--text-light);
}

.linked-item-meta {
    font-size: 0.875rem;
    color: var(--text-light);
}

.linked-item-status {
    font-size: 0.875rem;
}

.text-muted {
    color: var(--text-light);
    font-style: italic;
    padding: 1rem;
    text-align: center;
}

/* Nested Modal Support */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

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

.modal[style*="z-index"] {
    z-index: 1001;
}

/* Custom scrollbar - matches main app */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Modal animations - matches main app */
@keyframes modal-fade-in {
    from { 
        opacity: 0; 
        transform: scale(0.95) translateY(-10px); 
    }
    to { 
        opacity: 1; 
        transform: scale(1) translateY(0); 
    }
}

.modal.active .modal-content {
    animation: modal-fade-in 0.2s ease-out;
}

/* Smart Search Dropdown */
.smart-search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    max-height: 300px;
    overflow-y: auto;
    z-index: 10000;
    margin-top: 4px;
}

.smart-search-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.15s;
}

.smart-search-item:last-child {
    border-bottom: none;
}

.smart-search-item:hover {
    background-color: #f3f4f6;
}

.smart-search-item strong {
    font-weight: 600;
    color: var(--accent-color);
}

.smart-search-add-new {
    color: var(--accent-color);
    font-weight: 500;
}

.smart-search-add-new:hover {
    background-color: #dbeafe;
}

/* Table Filters */
.table-filters {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-color);
}

.table-filters select.column-filter {
    min-width: 150px;
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    background-color: white;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.2s;
}

.table-filters select.column-filter:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(31, 111, 235, 0.1);
}

/* Settings Tabs */
.settings-tab {
    flex: 1;
    padding: 0.64rem 0.96rem; /* Reduced to match 80% zoom */
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-size: 0.7rem; /* Reduced to match 80% zoom */
    font-weight: 500;
    color: var(--text-light);
    transition: all 0.2s;
}

.settings-tab:hover {
    background: #f9fafb;
    color: var(--text-color);
}

.settings-tab.active {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
    background: transparent;
}

.settings-section {
    display: block;
}

/* Page Headers - Enhanced */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.page-header h1,
.page-header h2 {
    font-size: 1.875rem; /* text-3xl */
    font-weight: 700; /* font-bold */
    color: #1f2937; /* text-gray-800 */
    margin: 0 0 0.5rem 0;
}

.page-header p {
    color: #4b5563; /* text-gray-600 */
    font-size: 0.875rem;
    margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 200px;
    }
    
    .main-content {
        margin-left: 200px;
        padding: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }

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

    .modal-large {
        width: 98%;
        max-width: 98%;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}


