* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: system-ui, sans-serif; background: #f5f5f5; font-size: 10px; }

.header {
    background: #fff;
    border-bottom: 1px solid #ddd;
    padding: 4px 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.header h1 { font-size: 12px; font-weight: 600; }
.back-btn { padding: 2px 6px; background: #eee; border: 1px solid #ccc; border-radius: 3px; font-size: 10px; text-decoration: none; color: #333; }

.toolbar {
    background: #fff;
    border-bottom: 1px solid #ddd;
    padding: 3px 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}
.toolbar select, .toolbar input {
    padding: 2px 4px;
    border: 1px solid #ccc;
    border-radius: 2px;
    font-size: 10px;
}
.toolbar-btn {
    padding: 2px 6px;
    border: 1px solid #ccc;
    background: #fff;
    border-radius: 2px;
    cursor: pointer;
    font-size: 10px;
}
.toolbar-btn:hover { background: #f0f0f0; }
.toolbar-btn.primary { background: #2563eb; color: #fff; border-color: #2563eb; }
.search-box { position: relative; }
.search-box input { width: 120px; padding-left: 18px; }
.search-box i { position: absolute; left: 5px; top: 50%; transform: translateY(-50%); color: #999; font-size: 9px; }

.grid-container { height: calc(100vh - 60px); padding: 4px; }
#grid-wrapper { height: 100%; background: #fff; border-radius: 2px; overflow: hidden; }

/* SUPER COMPACT AG Grid - ABSOLUTELY ZERO PADDING */
.ag-theme-alpine {
    --ag-font-size: 10px;
    --ag-row-height: 16px;
    --ag-header-height: 18px;
    --ag-cell-horizontal-padding: 0px;
    --ag-header-background-color: #f8f8f8;
    --ag-odd-row-background-color: #fff;
    --ag-row-hover-color: #f0f7ff;
    --ag-selected-row-background-color: #e3f2fd;
    --ag-borders: solid 1px;
    --ag-border-color: #e0e0e0;
    --ag-row-border-color: #f0f0f0;
}
.ag-theme-alpine .ag-header-cell,
.ag-theme-alpine .ag-header-cell-comp-wrapper {
    font-weight: 600;
    font-size: 9px;
    text-transform: uppercase;
    color: #666;
    padding: 0 !important;
    margin: 0 !important;
}
.ag-theme-alpine .ag-cell,
.ag-theme-alpine .ag-cell-value,
.ag-theme-alpine .ag-cell-wrapper {
    line-height: 14px;
    padding: 0 !important;
    margin: 0 !important;
}
.ag-theme-alpine .ag-row { 
    border-bottom: 1px solid #f0f0f0;
    margin: 0 !important;
    padding: 0 !important;
}

/* Row type styling with nested borders */
.row-day { background: #f0f4ff !important; font-weight: 600; }
.row-event { 
    background: #fff !important; 
    box-shadow: inset 4px 0 0 0 #60a5fa !important;
}
.row-day-resources {
    background: #fef3c7 !important;
    font-weight: 600;
    font-style: italic;
    box-shadow: inset 4px 0 0 0 #60a5fa !important;
}
.row-resource { 
    background: #fafafa !important; 
    color: #666; 
    font-size: 9px; 
    box-shadow: inset 4px 0 0 0 #60a5fa, inset 8px 0 0 0 #f0f4ff, inset 12px 0 0 0 #fbbf24 !important;
}
.row-resource-detail { 
    background: #f5f5f5 !important; 
    color: #888; 
    font-size: 8px; 
    font-style: italic; 
    box-shadow: inset 4px 0 0 0 #60a5fa, inset 8px 0 0 0 #f0f4ff, inset 12px 0 0 0 #fbbf24, inset 16px 0 0 0 #fafafa, inset 20px 0 0 0 #9ca3af !important;
}

/* Pinned/sticky rows */
.ag-pinned-top-row { 
    background: #fef3c7 !important; 
    border-bottom: 2px solid #f59e0b !important;
}

.type-tag {
    display: inline-block;
    padding: 0 3px;
    border-radius: 2px;
    font-size: 8px;
    font-weight: 600;
    text-transform: uppercase;
    margin-right: 3px;
}
.tag-day { background: #dbeafe; color: #1e40af; }
.tag-event { background: #dcfce7; color: #166534; }
.tag-resource { background: #fef3c7; color: #92400e; }
.tag-video { background: #fce7f3; color: #9d174d; }
.tag-audio { background: #e0e7ff; color: #3730a3; }
.tag-photo { background: #fed7aa; color: #c2410c; }

.expand-btn { cursor: pointer; color: #666; margin-right: 2px; font-size: 8px; }
.expand-btn:hover { color: #000; }
.type-tag.clickable { cursor: pointer; }
.type-tag.clickable:hover { opacity: 0.8; }

.status-bar {
    background: #f8f8f8;
    border-top: 1px solid #ddd;
    padding: 2px 8px;
    font-size: 9px;
    color: #666;
    display: flex;
    gap: 12px;
}

.toast {
    position: fixed;
    bottom: 8px;
    right: 8px;
    padding: 6px 10px;
    background: #333;
    color: #fff;
    border-radius: 3px;
    font-size: 10px;
    z-index: 1000;
}
.toast.success { background: #16a34a; }
.toast.error { background: #dc2626; }

.loading {
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.loading i { font-size: 20px; color: #2563eb; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
