:root {
    --bg-page: #f1f5f9;
    --card-bg: #ffffff;
    --border-color: #cbd5e1;
    --border-light: #e2e8f0;
    
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    
    --brand-primary: #0284c7;
    --brand-dark: #0369a1;
    --brand-soft: #f0f9ff;
    
    --radius-main: 12px;
    --radius-small: 6px;
    --shadow-card: 0 4px 12px rgba(0, 0, 0, 0.05);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--bg-page);
    color: var(--text-primary);
    min-height: 100vh;
    padding: 30px 16px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.app-container {
    width: 100%;
    max-width: 960px;
}

/* HEADER */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 24px;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 10px;
}

.icon-logo {
    font-size: 1.5rem;
}

.app-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.app-badge {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: #e2e8f0;
    padding: 4px 10px;
    border-radius: 20px;
}

/* INTRO */
.intro-section {
    text-align: center;
    margin-bottom: 28px;
}

.intro-section h1 {
    font-size: 1.85rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.intro-section p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    max-width: 640px;
    margin: 0 auto;
    line-height: 1.5;
}

/* MAIN CARD */
.calc-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-main);
    box-shadow: var(--shadow-card);
    padding: 24px;
}

/* TABS */
.tab-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 24px;
    background: #f8fafc;
    padding: 6px;
    border-radius: var(--radius-small);
    border: 1px solid var(--border-light);
}

.tab-item {
    background: transparent;
    border: none;
    padding: 10px 14px;
    border-radius: var(--radius-small);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all 0.2s;
}

.tab-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.tab-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.tab-item.active {
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.tab-item.active .tab-title {
    color: var(--brand-primary);
}

/* GRID CONTENT */
.content-grid {
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    gap: 28px;
}

.section-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.field-box {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.field-box label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.field-box input,
.field-box select {
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-small);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}

.field-box input:focus,
.field-box select:focus {
    border-color: var(--brand-primary);
}

.field-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.btn-calculate {
    width: 100%;
    padding: 12px;
    background: var(--brand-primary);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-small);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 8px;
}

.btn-calculate:hover {
    background: var(--brand-dark);
}

/* OUTPUT */
.output-section {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.result-badge-card {
    background: var(--brand-soft);
    border: 1px solid rgba(2, 132, 199, 0.2);
    border-radius: var(--radius-small);
    padding: 16px;
    text-align: center;
}

.badge-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--brand-primary);
    letter-spacing: 0.05em;
}

.badge-value {
    font-size: 2.8rem;
    font-weight: 700;
    color: var(--brand-primary);
    line-height: 1.1;
    margin: 4px 0;
}

.badge-subtext {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.text-preview-box {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.btn-copy {
    background: transparent;
    border: 1px solid var(--border-color);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-primary);
}

.btn-copy:hover {
    background: #f1f5f9;
}

textarea {
    width: 100%;
    height: 180px;
    padding: 12px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-small);
    background: #f8fafc;
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--text-primary);
    outline: none;
    resize: none;
}

/* FOOTER */
.app-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* TOAST */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--text-primary);
    color: #ffffff;
    padding: 10px 16px;
    border-radius: var(--radius-small);
    font-size: 0.85rem;
    font-weight: 500;
}

.hidden { display: none !important; }

/* RESPONSIVE */
@media (max-width: 720px) {
    .content-grid { grid-template-columns: 1fr; }
    .tab-container { grid-template-columns: 1fr; }
}