/* ZW Calendar - Custom Styles */

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --danger-color: #dc2626;
    --success-color: #16a34a;
    --background: #f8fafc;
    --surface: #ffffff;
    --border: #e2e8f0;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --header-height: 56px;
    --sidebar-width: 200px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: var(--background);
    color: var(--text-primary);
    line-height: 1.5;
}

/* App Layout */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.app-header {
    height: var(--header-height);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    flex-shrink: 0;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 24px;
}

.app-header h1 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-color);
}

.main-nav {
    display: flex;
    gap: 4px;
}

.nav-link {
    padding: 6px 12px;
    text-decoration: none;
    color: var(--text-secondary);
    border-radius: 4px;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.nav-link:hover {
    background: var(--background);
    color: var(--text-primary);
}

.nav-link.active {
    background: var(--primary-color);
    color: white;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.year-display {
    font-size: 1.1rem;
    font-weight: 600;
    padding: 0 8px;
    min-width: 50px;
    text-align: center;
}

.app-main {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    padding: 12px;
    overflow-y: auto;
}

.sidebar-section {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.sidebar-section h3,
.legend-title {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

/* Legend */
.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 0;
    font-size: 0.8rem;
}

.legend-color {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    flex-shrink: 0;
}

.legend-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Scheduler Container */
.scheduler-container {
    flex: 1;
    overflow: auto;
    padding: 12px;
    background: var(--background);
}

/* Buttons */
.btn {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-small {
    padding: 5px 10px;
    font-size: 0.75rem;
}

.btn-tiny {
    padding: 3px 8px;
    font-size: 0.7rem;
}

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

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

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

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

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

.btn-danger:hover {
    background: #b91c1c;
}

/* Select Input */
.select-input {
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.8rem;
    background: var(--surface);
    cursor: pointer;
    min-width: 160px;
}

.select-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Sync Status */
.sync-status {
    font-size: 1rem;
    margin-left: 8px;
}

.sync-status.connected {
    color: var(--success-color);
}

.sync-status.disconnected {
    color: var(--danger-color);
}

/* ============ ADMIN PAGES ============ */

.admin-main {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.admin-container {
    max-width: 800px;
    margin: 0 auto;
}

.admin-container h2 {
    font-size: 1.4rem;
    margin-bottom: 8px;
}

.admin-description {
    color: var(--text-secondary);
    margin-bottom: 24px;
    font-size: 0.9rem;
}

.admin-description a {
    color: var(--primary-color);
}

.admin-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
    background: var(--surface);
    border-radius: 8px;
    border: 1px dashed var(--border);
}

/* Asset Color Dot */
.asset-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

/* Status Icons */
.status-legend {
    font-size: 0.8rem;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 0;
}

.status-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    font-size: 11px;
    font-weight: bold;
    border-radius: 50%;
    cursor: pointer;
    line-height: 1;
}

.status-icon.draft {
    color: #888;
    background: transparent;
    border: 1.5px solid #aaa;
}

.status-icon.approved {
    color: #fff;
    background: #16a34a;
    border: none;
}

.status-icon.declined {
    color: #fff;
    background: #dc2626;
    border: none;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 160px;
    }
    
    .header-left {
        gap: 12px;
    }
    
    .nav-link {
        padding: 4px 8px;
        font-size: 0.75rem;
    }
}

@media (max-width: 576px) {
    .sidebar {
        display: none;
    }
    
    .select-input {
        min-width: 120px;
    }
}
