:root {
    --google-blue: #1a73e8;
    --google-blue-light: #e8f0fe;
    --google-green: #0f9d58;
    --google-gray-50: #f8f9fa;
    --google-gray-100: #f1f3f4;
    --google-gray-200: #e8eaed;
    --google-gray-300: #dadce0;
    --google-gray-600: #5f6368;
    --google-gray-900: #202124;
    --google-border: #e0e0e0;
    --google-surface: #ffffff;
}

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

body {
    font-family: 'Roboto', 'Noto Sans KR', sans-serif;
    background-color: var(--google-surface);
    color: var(--google-gray-900);
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header Section */
.google-header {
    background-color: var(--google-surface);
    display: flex;
    flex-direction: column;
}

.top-bar {
    display: flex;
    align-items: center;
    padding: 8px 16px 4px;
    gap: 12px;
}

.app-logo {
    font-size: 1.5rem;
}

.file-info {
    display: flex;
    flex-direction: column;
}

.file-name {
    font-size: 1.1rem;
    color: var(--google-gray-900);
    font-weight: 400;
    padding: 2px 4px;
    border-radius: 4px;
}

.menu-bar {
    display: flex;
    gap: 12px;
    padding: 0 16px 8px;
    font-size: 0.85rem;
    color: var(--google-gray-600);
}

.menu-item {
    padding: 2px 6px;
    border-radius: 4px;
    cursor: pointer;
}

.menu-item:hover {
    background-color: var(--google-gray-100);
}

/* Formula Bar */
.formula-bar {
    display: flex;
    align-items: center;
    height: 36px;
    border-top: 1px solid var(--google-border);
    border-bottom: 1px solid var(--google-border);
    background-color: var(--google-surface);
}

.cell-address {
    width: 60px;
    text-align: center;
    font-size: 0.85rem;
    color: var(--google-gray-600);
    border-right: 1px solid var(--google-border);
}

.formula-input {
    flex-grow: 1;
    display: flex;
    align-items: center;
    padding: 0 12px;
}

.fx-icon {
    font-family: serif;
    font-style: italic;
    color: var(--google-gray-600);
    margin-right: 8px;
    font-weight: bold;
}

.formula-input input {
    width: 100%;
    border: none;
    outline: none;
    font-size: 0.9rem;
}

/* Grid Area */
.app-body {
    flex-grow: 1;
    overflow: auto;
    background-color: var(--google-gray-100);
}

table.google-grid {
    border-collapse: collapse;
    background-color: white;
    table-layout: fixed;
}

table.google-grid th, table.google-grid td {
    border: 1px solid var(--google-border);
    padding: 0 4px;
    font-size: 0.85rem;
    height: 24px;
    white-space: nowrap;
    overflow: hidden;
}

table.google-grid th {
    background-color: var(--google-gray-50);
    font-weight: 400;
    color: var(--google-gray-600);
    text-align: center;
}

table.google-grid .row-number {
    width: 46px;
    background-color: var(--google-gray-50);
}

/* Cell Selection */
table.google-grid td.selected {
    outline: 2px solid var(--google-blue);
    z-index: 10;
    position: relative;
}

/* Footer & Tabs (The Worksheets) */
.app-footer {
    border-top: 1px solid var(--google-border);
    background-color: var(--google-surface);
}

.sheet-tabs {
    display: flex;
    background-color: var(--google-gray-100);
    padding: 0 16px;
    gap: 1px;
}

.sheet-tab {
    padding: 8px 16px;
    font-size: 0.85rem;
    background-color: transparent;
    cursor: pointer;
    color: var(--google-gray-600);
    position: relative;
    border-right: 1px solid transparent;
    border-left: 1px solid transparent;
}

.sheet-tab:hover {
    background-color: var(--google-gray-200);
}

.sheet-tab.active {
    background-color: var(--google-surface);
    color: var(--google-blue);
    font-weight: 500;
    border-left: 1px solid var(--google-border);
    border-right: 1px solid var(--google-border);
}

.sheet-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background-color: var(--google-blue);
}

.status-bar {
    padding: 4px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--google-gray-600);
    background-color: var(--google-surface);
    border-top: 1px solid var(--google-border);
}

.status-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-right input {
    accent-color: var(--google-blue);
}
