/* Zuperoffice Shared Styles — Writer & Calc */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');

*, *::before, *::after {
    margin: 0; padding: 0; box-sizing: border-box;
}

:root {
    --titlebar-bg: #267346;
    --titlebar-text: #fff;
    --ribbon-bg: #f3f3f3;
    --ribbon-border: #d1d1d1;
    --ribbon-tab-active: #fff;
    --ribbon-tab-hover: #e8e8e8;
    --status-bg: #267346;
    --status-text: #fff;
    --accent: #217346;
    --text-primary: #333;
    --text-secondary: #666;
    --canvas-bg: #e8e8e8;
}

html, body {
    width: 100%; height: 100%;
    overflow: hidden;
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 12px;
    color: var(--text-primary);
    background: var(--canvas-bg);
    user-select: none;
    -webkit-user-select: none;
}

/* Title Bar */
#titlebar {
    display: flex; justify-content: space-between; align-items: center;
    height: 32px;
    background: var(--titlebar-bg);
    color: var(--titlebar-text);
    padding: 0 4px 0 10px;
    -webkit-app-region: drag;
}
#titlebar-left { display: flex; align-items: center; gap: 8px; }
#app-icon {
    width: 20px; height: 20px;
    background: rgba(255,255,255,0.2);
    border-radius: 3px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 13px;
}
#doc-title { font-size: 12px; font-weight: 500; }
#save-indicator { font-size: 10px; opacity: 0.7; }
#titlebar-right { display: flex; -webkit-app-region: no-drag; }
.win-btn {
    width: 46px; height: 32px;
    background: none; border: none;
    color: var(--titlebar-text);
    font-size: 12px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.win-btn:hover { background: rgba(255,255,255,0.1); }
.win-btn.close:hover { background: #e81123; }

/* Ribbon */
#ribbon {
    background: var(--ribbon-bg);
    border-bottom: 1px solid var(--ribbon-border);
}
#ribbon-tabs {
    display: flex; gap: 0; padding: 0 6px;
    border-bottom: 1px solid var(--ribbon-border);
}
.tab {
    padding: 6px 14px; background: none; border: none;
    font-size: 12px; cursor: pointer; color: var(--text-primary);
    border-bottom: 2px solid transparent;
    transition: all 0.15s;
}
.tab:hover { background: var(--ribbon-tab-hover); }
.tab.active { border-bottom-color: var(--accent); background: var(--ribbon-tab-active); font-weight: 500; }

.ribbon-panel { display: none; padding: 4px 8px; overflow-x: auto; white-space: nowrap; }
.ribbon-panel.active { display: flex; align-items: flex-end; gap: 2px; }

.ribbon-group {
    display: inline-flex; flex-direction: column; align-items: center;
    padding: 2px 8px;
}
.ribbon-group-content {
    display: flex; gap: 2px; align-items: center;
    min-height: 28px;
}
.ribbon-group-label {
    font-size: 10px; color: var(--text-secondary);
    margin-top: 2px;
}
.ribbon-sep {
    width: 1px; height: 48px;
    background: var(--ribbon-border);
    margin: 0 4px;
    align-self: center;
}
.rbtn {
    width: 28px; height: 28px;
    background: none; border: 1px solid transparent;
    border-radius: 3px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; color: var(--text-primary);
    transition: all 0.1s;
}
.rbtn:hover { background: #e0e0e0; border-color: #c0c0c0; }
.rbtn.active { background: #d4e9ff; border-color: #a0c4e8; }

select {
    height: 24px; border: 1px solid #c0c0c0; border-radius: 3px;
    padding: 0 4px; font-size: 11px; background: #fff;
    cursor: pointer;
}
#font-family { width: 130px; }
#font-size { width: 50px; }

/* Canvas Container */
#canvas-container {
    flex: 1; overflow: hidden; position: relative;
    background: var(--canvas-bg);
}
#doc-canvas, #sheet-canvas {
    display: block; position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
}

/* Status Bar */
#statusbar {
    display: flex; justify-content: space-between; align-items: center;
    height: 24px; padding: 0 12px;
    background: var(--status-bg);
    color: var(--status-text);
    font-size: 11px;
}

/* Layout */
body {
    display: flex; flex-direction: column;
}
#canvas-container { flex: 1; }
