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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #F8F9FA;
    color: #1A1A1A;
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* Header */
.app-header {
    background: white;
    border-bottom: 1px solid #E5E7EB;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.header-container {
    margin-left: 260px;
    padding: 16px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.back-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.15s;
}

.back-btn:hover {
    background: #F3F4F6;
}

.back-btn .material-icons {
    color: #6B7280;
    font-size: 20px;
}

.header-title h1 {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
}

.header-subtitle {
    font-size: 13px;
    color: #6B7280;
    margin-top: 2px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: #F3F4F6;
    border-radius: 8px;
    font-size: 13px;
    color: #374151;
}

.user-info .material-icons {
    font-size: 18px;
    color: #6B7280;
}

/* Main */
.app-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.app-sidebar {
    width: 260px;
    background: white;
    border-right: 1px solid #E5E7EB;
    flex-shrink: 0;
}

.content-wrapper {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.main-content {
    flex: 1;
    padding: 24px 32px;
    max-width: 1600px;
    width: 100%;
    margin: 0 auto;
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    font-size: 13px;
}

.breadcrumb-item {
    color: #6B7280;
    text-decoration: none;
    transition: color 0.15s;
}

.breadcrumb-item:hover {
    color: #111827;
}

.breadcrumb-separator {
    color: #D1D5DB;
}

.breadcrumb-item.active {
    color: #111827;
    font-weight: 500;
}

/* Page Header */
.page-header {
    margin-bottom: 24px;
}

.page-title {
    font-size: 24px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 4px;
}

.page-subtitle {
    font-size: 14px;
    color: #6B7280;
}

/* Form Container */
.form-container {
    background: white;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.form-body {
    padding: 32px;
}

.form-section {
    margin-bottom: 40px;
}

.form-section:last-child {
    margin-bottom: 0;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #F3F4F6;
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title .material-icons {
    font-size: 20px;
    color: #DC2626;
}

.section-badge {
    padding: 4px 10px;
    background: #FEE2E2;
    color: #DC2626;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-label {
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 4px;
}

.form-label .required {
    color: #DC2626;
}

.form-input,
.form-select {
    padding: 10px 14px;
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    background: white;
    transition: all 0.15s;
}

.form-input:hover,
.form-select:hover {
    border-color: #9CA3AF;
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: #DC2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.form-input::placeholder {
    color: #9CA3AF;
}

.form-select {
    padding: 10px 40px 10px 14px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23374151' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    cursor: pointer;
}

/* Dynamic Table */
.table-section {
    margin-top: 32px;
}

.table-container {
    border: 1px solid #E5E7EB;
    border-radius: 10px;
    overflow: hidden;
}

.table-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: linear-gradient(to bottom, #FAFAFA, #F5F5F5);
    border-bottom: 1px solid #E5E7EB;
}

.table-toolbar-title {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    display: flex;
    align-items: center;
    gap: 8px;
}

.table-toolbar-title .material-icons {
    font-size: 18px;
    color: #6B7280;
}

.table-count {
    font-size: 12px;
    color: #6B7280;
    font-weight: 400;
    margin-left: 8px;
}

.add-row-btn {
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 6px;
    background: #DC2626;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
    font-size: 13px;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
}

.add-row-btn:hover {
    background: #B91C1C;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
    transform: translateY(-1px);
}

.add-row-btn:active {
    transform: translateY(0);
}

.add-row-btn .material-icons {
    font-size: 18px;
}

.dynamic-table {
    background: white;
}

.table-head {
    background: #F9FAFB;
    border-bottom: 1px solid #E5E7EB;
    padding: 14px 20px;
    display: grid;
    grid-template-columns: 140px 1fr 140px 80px;
    gap: 16px;
    align-items: center;
}

.table-head-cell {
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table-body {
    background: white;
}

.table-row {
    padding: 16px 20px;
    display: grid;
    grid-template-columns: 140px 1fr 140px 80px;
    gap: 16px;
    align-items: start;
    border-bottom: 1px solid #F3F4F6;
    transition: background 0.15s;
}

.table-row:last-child {
    border-bottom: none;
}

.table-row:hover {
    background: #FAFBFC;
}

.table-row.has-error {
    background: #FEF2F2;
}

.table-row.has-error:hover {
    background: #FEE2E2;
}

.table-cell {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.table-input {
    padding: 10px 14px;
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    background: white;
    transition: all 0.15s;
    width: 100%;
}

.table-input:hover {
    border-color: #9CA3AF;
}

.table-input:focus {
    outline: none;
    border-color: #DC2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.table-input::placeholder {
    color: #9CA3AF;
}

.table-input.error {
    border-color: #EF4444;
    background: #FEF2F2;
}

.error-message {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #EF4444;
}

.error-message .material-icons {
    font-size: 14px;
}

.remove-row-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    color: #DC2626;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
    margin-top: 3px;
}

.remove-row-btn:hover {
    background: #FEF2F2;
    border-color: #FCA5A5;
    transform: scale(1.05);
}

.remove-row-btn:active {
    transform: scale(0.95);
}

.remove-row-btn .material-icons {
    font-size: 20px;
}

/* Empty State */
.table-empty {
    padding: 60px 20px;
    text-align: center;
    color: #9CA3AF;
}

.table-empty .material-icons {
    font-size: 48px;
    color: #D1D5DB;
    margin-bottom: 12px;
}

.table-empty-text {
    font-size: 14px;
    margin-bottom: 16px;
}

/* Form Footer */
.form-footer {
    padding: 24px 32px;
    border-top: 1px solid #E5E7EB;
    background: #FAFBFC;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    align-items: center;
}

.form-footer-left {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #6B7280;
}

.form-footer-left .material-icons {
    font-size: 16px;
}

.form-footer-right {
    display: flex;
    gap: 12px;
}

.btn {
    padding: 11px 24px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    border: none;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    font-family: 'Inter', sans-serif;
}

.btn .material-icons {
    font-size: 18px;
}

.btn-primary {
    background: #DC2626;
    color: white;
}

.btn-primary:hover {
    background: #B91C1C;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-outline {
    background: white;
    color: #374151;
    border: 1px solid #D1D5DB;
}

.btn-outline:hover {
    background: #F9FAFB;
    border-color: #9CA3AF;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #F3F4F6;
}

::-webkit-scrollbar-thumb {
    background: #D1D5DB;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #9CA3AF;
}

/* Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.table-row {
    animation: slideIn 0.2s ease-out;
}
