:root {
    --bg-color: #ffffff;
    --sidebar-bg: #fbfbfa;
    --text-main: #37352f;
    --text-muted: #666666;
    --border-color: #e9e9e7;
    --hover-bg: #f4f4f4;
    --primary-btn: #c5a059; /* OSAC Gold */
    --primary-btn-hover: #a8874a;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, "Apple Color Emoji", Arial, sans-serif;
}

body.dark-theme {
    --bg-color: #1a1a1a;
    --sidebar-bg: #111111;
    --text-main: #efefef;
    --text-muted: #aaaaaa;
    --border-color: #333333;
    --hover-bg: #2a2a2a;
}

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

body {
    font-family: var(--font-family);
    color: var(--text-main);
    background-color: var(--bg-color);
    display: flex;
    height: 100vh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

.app-container {
    display: flex;
    width: 100%;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 20px 0;
}

.sidebar-header {
    padding: 0 20px 20px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
}

.nav-section {
    margin-top: 10px;
}

.nav-section h3 {
    font-size: 11px;
    color: var(--text-muted);
    padding: 0 20px;
    margin-bottom: 8px;
    font-weight: 500;
}

.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav li {
    padding: 8px 20px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.1s ease;
    display: flex;
    align-items: center;
    color: var(--text-main);
}

.sidebar-nav li .icon {
    margin-right: 10px;
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.sidebar-nav li:hover {
    background-color: var(--hover-bg);
}

.sidebar-nav li.active {
    background-color: var(--hover-bg);
    font-weight: 500;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 40px 60px 20px;
    max-width: 1000px;
    width: 100%;
    margin: 0 auto;
}

.title-section {
    display: flex;
    align-items: center;
}

.page-icon {
    font-size: 40px;
    margin-right: 16px;
}

.topbar h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.02em;
}

.btn {
    padding: 8px 14px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: background-color 0.2s, color 0.2s;
    display: inline-flex;
    align-items: center;
}

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

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

.btn-update {
    background-color: #f59e0b; /* Amber for update */
    color: white;
}
.btn-update:hover {
    background-color: #d97706;
}

.btn-secondary {
    background-color: transparent;
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--hover-bg);
}

/* Content Area */
.content-area {
    padding: 0 60px 60px;
    max-width: 1000px;
    width: 100%;
    margin: 0 auto;
}

.input-section {
    padding: 0;
    margin-bottom: 40px;
}

/* Notion Page Style Form */
.notion-page-header {
    background: transparent;
    padding: 0;
    border: none;
    margin-bottom: 40px;
}

.notion-title-input {
    font-size: 32px;
    font-weight: 700;
    border: none;
    outline: none;
    width: 100%;
    margin-bottom: 24px;
    color: var(--text-main);
    padding: 0;
    background: transparent;
    letter-spacing: -0.02em;
}
.notion-title-input::placeholder {
    color: #e0e0e0;
}

.notion-properties {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 32px;
}

.property-row {
    display: flex;
    align-items: center;
}

.property-label {
    width: 160px;
    color: var(--text-muted);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.property-value {
    flex: 1;
    max-width: 400px;
}

.clean-input, .clean-select {
    width: 100%;
    border: none;
    outline: none;
    padding: 6px 8px;
    font-size: 14px;
    color: var(--text-main);
    background: transparent;
    border-radius: 4px;
    transition: background-color 0.2s;
    font-family: var(--font-family);
}

.clean-input:hover, .clean-select:hover {
    background-color: var(--hover-bg);
}
.clean-input:focus, .clean-select:focus {
    background-color: #ebeced;
}

.readonly-input {
    color: var(--text-muted);
    pointer-events: none;
}

.notion-page-content {
    margin-bottom: 20px;
}

.clean-textarea {
    width: 100%;
    border: none;
    outline: none;
    padding: 0;
    font-size: 16px;
    line-height: 1.5;
    background: transparent;
    resize: none;
    min-height: 120px;
    font-family: var(--font-family);
    color: var(--text-main);
}
.clean-textarea::placeholder {
    color: #e0e0e0;
}

/* TomSelect Customizations for Notion Style */
.ts-control {
    border: none !important;
    border-radius: 4px;
    font-family: var(--font-family);
    font-size: 14px;
    background-color: transparent !important;
    padding: 6px 8px !important;
    box-shadow: none !important;
    transition: background-color 0.2s;
    min-height: 0 !important;
}
.ts-control:hover {
    background-color: var(--hover-bg) !important;
}
.ts-control.focus {
    background-color: #ebeced !important;
}
.ts-control > input {
    font-family: var(--font-family);
    font-size: 14px;
}
.ts-wrapper.multi .ts-control > div {
    background: #e1e1e1;
    color: var(--text-main);
    border: none;
    border-radius: 3px;
    padding: 2px 6px;
    margin: 0 4px 2px 0;
    font-size: 13px;
}
.ts-dropdown {
    font-family: var(--font-family);
    font-size: 14px;
    border-color: var(--border-color);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
}

/* Table */
.entries-section {
    margin-top: 20px;
}

.table-container {
    overflow-x: auto;
}

.notion-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.notion-table th, .notion-table td {
    border-bottom: 1px solid var(--border-color);
    padding: 12px 8px;
    text-align: left;
    vertical-align: top;
}

.notion-table th {
    font-weight: 500;
    color: var(--text-muted);
    font-size: 13px;
    border-bottom: 2px solid var(--border-color);
}

.notion-table tbody tr:hover {
    background-color: var(--hover-bg);
}

.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 40px !important;
    font-style: italic;
}

.status-pending {
    color: #d97706; /* Amber color */
    font-style: italic;
    font-weight: 500;
}

/* Delete Button */
.btn-delete {
    background: transparent;
    border: none;
    color: #e03e3e;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    opacity: 1; /* Always visible */
    transition: background-color 0.2s;
    margin-left: 4px;
}

.btn-edit {
    background: transparent;
    border: none;
    color: var(--primary-btn);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    opacity: 1; /* Always visible */
    transition: background-color 0.2s;
}

.notion-table tbody tr:hover .btn-delete,
.notion-table tbody tr:hover .btn-edit {
    opacity: 1;
}

.btn-edit:hover {
    background: #e1f5fe;
}
.btn-delete:hover {
    background: #fde8e8;
}

/* PDF Specific hiding/showing */
.pdf-header {
    margin-bottom: 30px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 16px;
}

.pdf-export-mode .action-col {
    display: none !important;
}

.pdf-header h1 {
    font-size: 20px;
    margin-bottom: 4px;
    font-weight: 600;
}

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

/* Hide creator column when viewing a specific creator */
.hide-creator .col-creator {
    display: none;
}

/* Settings and Sync */
.settings-section {
    animation: fadeIn 0.3s ease-in-out;
}

#connection-status {
    font-weight: 500;
}

.mgmt-agent-list {
    list-style: none;
    padding: 0;
    font-size: 13px;
}

.mgmt-agent-list li {
    padding: 6px 10px;
    background: #f9f9f9;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    margin-bottom: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mgmt-agent-list button {
    background: none;
    border: none;
    color: var(--primary-btn);
    cursor: pointer;
    font-size: 11px;
    padding: 2px 4px;
    border-radius: 3px;
}

.mgmt-agent-list button:hover {
    background: var(--hover-bg);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}
