* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Malgun Gothic", "맑은 고딕", "Apple SD Gothic Neo", sans-serif;
    font-size: 14px;
    line-height: 1.4;
    color: #333333;
    background-color: #f7f8fa;
}

a {
    color: #1e5ba8;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Header */
.top-nav {
    background-color: #ffffff;
    border-bottom: 1px solid #dcdcdc;
    height: 48px;
}

.top-nav-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 16px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand-title {
    font-size: 16px;
    font-weight: bold;
    color: #222222;
    text-decoration: none;
}

.user-status {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-name {
    font-weight: 500;
    color: #555555;
}

/* Main Container */
.main-container {
    max-width: 1100px;
    margin: 20px auto;
    padding: 0 16px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 6px 14px;
    font-size: 13px;
    font-family: inherit;
    font-weight: normal;
    text-align: center;
    border-radius: 0;
    border: 1px solid #c0c0c0;
    cursor: pointer;
    background-color: #ffffff;
    color: #333333;
    line-height: 1.2;
}

.btn:hover {
    background-color: #f0f0f0;
    text-decoration: none;
}

.btn-primary {
    background-color: #1e5ba8;
    color: #ffffff;
    border-color: #184b8a;
}

.btn-primary:hover {
    background-color: #184b8a;
}

.btn-secondary {
    background-color: #e9ecef;
    color: #333333;
    border-color: #ced4da;
}

.btn-secondary:hover {
    background-color: #dde2e6;
}

.btn-outline {
    background-color: #ffffff;
    color: #1e5ba8;
    border-color: #b0c4de;
}

.btn-outline:hover {
    background-color: #f0f5ff;
}

.btn-sm {
    padding: 3px 8px;
    font-size: 12px;
}

.btn-block {
    display: block;
    width: 100%;
}

/* Drop Zone */
.upload-section {
    margin-bottom: 24px;
}

.drop-zone {
    border: 2px dashed #b5c0cd;
    background-color: #ffffff;
    padding: 28px 16px;
    text-align: center;
    transition: background-color 0.15s, border-color 0.15s;
    cursor: pointer;
}

.drop-zone.dragover {
    border-color: #1e5ba8;
    background-color: #edf4fc;
}

.drop-zone-text {
    font-size: 14px;
    color: #555555;
    margin-bottom: 12px;
}

.upload-status {
    margin-top: 10px;
    padding: 8px 12px;
    font-size: 13px;
    background-color: #ffffff;
    border: 1px solid #dcdcdc;
    color: #333333;
}

/* Sections */
.section-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #222222;
}

/* Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background-color: #ffffff;
    border: 1px solid #dcdcdc;
    font-size: 13px;
}

.data-table th,
.data-table td {
    padding: 8px 10px;
    border: 1px solid #e2e2e2;
    text-align: left;
    vertical-align: middle;
}

.data-table th {
    background-color: #f1f3f5;
    font-weight: 600;
    color: #444444;
}

.data-table tbody tr:hover {
    background-color: #fbfbfc;
}

.empty-message {
    padding: 32px 16px;
    text-align: center;
    color: #777777;
    background-color: #ffffff;
    border: 1px solid #dcdcdc;
}

/* Login Page */
.login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 450px;
}

.login-box {
    width: 360px;
    background-color: #ffffff;
    border: 1px solid #dcdcdc;
    padding: 28px 24px;
}

.login-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 20px;
    text-align: center;
}

.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    margin-bottom: 4px;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 7px 10px;
    font-size: 14px;
    border: 1px solid #c0c0c0;
    border-radius: 0;
    outline: none;
}

.form-control:focus {
    border-color: #1e5ba8;
}

.alert-error {
    background-color: #fdf2f2;
    color: #c92a2a;
    border: 1px solid #f8d7da;
    padding: 8px 12px;
    margin-bottom: 14px;
    font-size: 13px;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 2px 6px;
    font-size: 12px;
    border-radius: 0;
}

.badge-original {
    background-color: #e3f2fd;
    color: #0d47a1;
    border: 1px solid #bbdefb;
}

.badge-edit {
    background-color: #f1f3f5;
    color: #495057;
    border: 1px solid #dee2e6;
}

/* Header & Breadcrumb for file page */
.page-header {
    margin-bottom: 16px;
}

.breadcrumb {
    font-size: 12px;
    color: #777777;
    margin-bottom: 6px;
}

.page-title {
    font-size: 18px;
    font-weight: bold;
}

/* Edit Page */
.edit-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #ffffff;
    border: 1px solid #dcdcdc;
    padding: 14px 18px;
    margin-bottom: 16px;
}

.file-name {
    font-size: 16px;
    font-weight: bold;
    display: inline-block;
    margin-right: 12px;
}

.version-tag {
    font-size: 13px;
    color: #666666;
}

.editor-container {
    background-color: #ffffff;
    border: 1px solid #dcdcdc;
    min-height: 400px;
    padding: 40px;
    text-align: center;
}

.editor-placeholder {
    font-size: 15px;
    color: #666666;
    padding: 40px 0;
}

/* Edit Page wide mode */
body.wide {
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* 편집 화면은 위 막대를 한 줄로 — 위 공용 막대는 숨기고 edit-header 가 대신 */
body.wide .top-nav {
    display: none;
}

body.wide .main-container {
    max-width: 100%;
    margin: 0;
    padding: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

body.wide .edit-header {
    flex-shrink: 0;
    margin: 0;
    padding: 2px 8px;
    border: 0;
    border-bottom: 1px solid #dcdcdc;
    font-size: 13px;
    line-height: 1.2;
    white-space: nowrap;
}

body.wide .edit-info {
    display: flex;
    align-items: baseline;
    gap: 10px;
    min-width: 0;
    overflow: hidden;
}

body.wide .edit-brand {
    font-weight: bold;
    color: #333333;
    text-decoration: none;
}

body.wide .file-name {
    font-size: 13px;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

body.wide .version-tag {
    font-size: 12px;
}

body.wide .edit-actions {
    gap: 6px;
    flex-shrink: 0;
}

body.wide .edit-actions .btn-sm {
    padding: 1px 8px;
    font-size: 12px;
}

body.wide .edit-actions .user-name {
    font-size: 12px;
    color: #666666;
    margin-left: 6px;
}

body.wide .editor-container {
    flex: 1;
    padding: 0;
    min-height: 0;
    border: 0;
    position: relative;
    display: flex;
    flex-direction: column;
}

#oo-editor {
    width: 100%;
    height: 100%;
    flex: 1;
}

.edit-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.edit-status-msg {
    font-size: 13px;
    color: #555555;
    margin-right: 8px;
}

.btn:disabled,
.btn:disabled:hover {
    opacity: 0.45;
    cursor: not-allowed;
}
