/* Layout & Typography */
.form-body {
    background-color: #f8fafc; /* bg-background-light or similar slate-50 */
    color: #0f172a; /* text-slate-900 */
    font-family: 'Inter', sans-serif;
}
html.dark .form-body {
    background-color: #0f172a; /* dark:bg-background-dark */
    color: #f1f5f9; /* dark:text-slate-100 */
}

.form-root-container {
    position: relative;
    display: flex;
    height: auto;
    min-height: 100vh;
    width: 100%;
    flex-direction: column;
    overflow-x: hidden;
}

.form-layout-container {
    display: flex;
    height: 100%;
    flex-grow: 1;
    flex-direction: column;
}

.form-main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: 1600px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
    padding: calc(var(--app-header-height) + 1rem) 1rem 2rem 1rem;
}
@media (min-width: 1024px) {
    .form-main-content {
        padding-left: 2.5rem; /* lg:px-10 */
        padding-right: 2.5rem;
    }
}

.form-header-section {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.form-title-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    width: 100%;
}

.form-page-title {
    color: #0f172a;
    font-size: 1.875rem; /* 3xl */
    line-height: 1.25; /* leading-tight */
    font-weight: 900; /* font-black */
    letter-spacing: -0.025em; /* tracking-tight */
    text-transform: uppercase;
    margin: 0;
}
html.dark .form-page-title {
    color: #ffffff;
}

.form-page-subtitle {
    font-size: 0.75rem; /* xs */
    color: #64748b; /* text-slate-500 */
    font-weight: 500;
    letter-spacing: 0.025em; /* tracking-wide */
    text-transform: uppercase;
    margin: 0;
}
html.dark .form-page-subtitle {
    color: #94a3b8; /* text-slate-400 */
}

.form-table-card {
    background-color: #ffffff;
    border-radius: 0.5rem; /* rounded-lg */
    border: 1px solid #e2e8f0; /* border-slate-200 */
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); /* shadow-sm */
    overflow: hidden;
}
html.dark .form-table-card {
    background-color: #0f172a; /* bg-slate-900 */
    border-color: #1e293b; /* border-slate-800 */
}

.form-table-scroll-area {
    overflow-x: auto;
    overflow-y: auto;
    max-height: calc(100vh - 220px);
}

.form-table {
    width: 100%;
    text-align: left;
    border-collapse: collapse;
}

.form-table-header {
    position: sticky;
    top: 0;
    z-index: 10;
}

.form-table-header-row {
    background-color: #f1f5f9; /* bg-slate-100 */
    border-bottom: 1px solid #e2e8f0; /* border-slate-200 */
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); /* shadow-sm */
    color: #64748b; /* text-slate-500 */
}
html.dark .form-table-header-row {
    background-color: #1e293b; /* bg-slate-800 */
    border-color: #334155; /* border-slate-700 */
    color: #94a3b8; /* text-slate-400 */
}

.form-th {
    padding: 12px 8px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    text-align: center;
    white-space: nowrap;
}

.form-table-body {
    /* To handle divide-y equivalent */
}

.form-table-row {
    background-color: #ffffff;
    color: #000000;
    border-bottom: 1px solid #f1f5f9; /* divide-slate-100 */
    transition: background-color 0.15s, color 0.15s;
}
.form-table-row:last-child {
    border-bottom: none;
}
.form-table-row:hover {
    background-color: #f0f9ff; /* hover:bg-sky-50 */
    color: #0ea5e9; /* hover:text-sky-500 */
}
html.dark .form-table-row {
    background-color: #0f172a; /* bg-slate-900 */
    border-bottom-color: rgba(30, 41, 59, 0.5); /* dark:divide-slate-800/50 */
    color: #ffffff;
}
html.dark .form-table-row:hover {
    background-color: rgba(12, 74, 110, 0.3); /* dark:hover:bg-sky-900/30 */
}

.form-td {
    padding: 8px;
    color: inherit;
}
.form-td-num {
    font-size: 0.875rem; /* text-sm */
    color: #94a3b8; /* text-slate-400 */
    font-weight: 500;
    text-align: center;
}

/* Input Fields */
.form-input-control {
    background: transparent;
    border: 1px solid #bae6fd;
    border-radius: 4px;
    width: 100%;
    padding: 8px;
    color: inherit;
    font-size: 0.70rem !important;
    text-align: center;
    resize: none !important;
    overflow: hidden !important;
}

.form-input-control:focus {
    border-color: #bae6fd !important;
    outline: none;
    background: rgba(10, 71, 194, 0.05);
}
html.dark .form-input-control:focus {
    background: rgba(10, 71, 194, 0.2);
}

.form-input-control:disabled {
    border-color: #bae6fd !important;
    opacity: 0.7;
    cursor: not-allowed;
}

.form-input-error {
    border-color: #bae6fd !important;
    background: rgba(239, 68, 68, 0.05) !important;
}

/* File Upload Button */
.form-file-wrapper {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    justify-content: center;
}
.form-file-clear {
    color: #ef4444; /* red-500 */
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;    
    align-items: center;
    justify-content: center;
    transition: color 0.15s;
    font-size: 0.75rem;
    font-weight: 700;
}
.form-file-clear:hover {
    color: #dc2626; /* red-600 */
}
.form-file-clear.is-visible {
    display: flex;
}
.form-file-label {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #f1f5f9; /* bg-slate-100 */
    color: #334155; /* text-slate-700 */
    font-size: 0.75rem; /* text-xs */
    font-weight: 500;
    border-radius: 0.25rem; /* rounded */
    border: 1px solid #cbd5e1; /* border-slate-300 */
    transition: background-color 0.15s, border-color 0.15s;
    width: 100%;
    min-width: 80px;
    white-space: nowrap;
}
.form-file-label:hover {
    background-color: #e2e8f0; /* hover:bg-slate-200 */
}
.form-file-input {
    display: none;
}
.form-file-name {
    font-size: 10px;
    color: #64748b; /* text-slate-500 */
    margin-top: 0.25rem; /* mt-1 */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}
.form-file-name.is-visible {
    display: block;
}

/* Submit Section */
.form-submit-section {
    display: flex;
    justify-content: center;
    margin-top: 80px; /* Approx 2cm distance from the table */
    margin-bottom: 2rem; /* mb-8 */
}

.form-submit-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.25rem; /* rounded */
    background-color: #38bdf8; /* bg-sky-400 */
    color: #ffffff; /* text-white */
    padding-left: 3rem; /* px-12 */
    padding-right: 3rem;
    height: 3rem; /* h-12 */
    font-size: 1rem; /* text-base */
    font-weight: 700; /* font-bold */
    letter-spacing: 0.1em; /* tracking-widest */
    border: none;
    cursor: pointer;
    transition: all 0.15s;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); /* shadow-md */
    overflow: hidden;
}
.form-submit-btn:hover {
    background-color: #0ea5e9; /* hover:bg-sky-500 */
}

/* Alert Box */
.form-alert-box {
    display: none; /* hidden by default */
    margin-bottom: 1rem; /* mb-4 */
    padding: 1rem; /* p-4 */
    border-radius: 0.5rem; /* rounded-lg */
    align-items: center;
    gap: 0.75rem; /* gap-3 */
    font-size: 0.875rem; /* text-sm */
    font-weight: 500;
}
.form-alert-box.is-visible {
    display: flex;
}

.fixed-alert {
    position: fixed;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #ffffff;
    padding: 1rem 2rem;
    border-radius: 0.5rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.alert-message-text {
    text-align: center;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.form-submit-btn.is-loading {
    cursor: not-allowed;
    opacity: 0.9;
}

/* Utilities */
.u-text-center { text-align: center; }
.u-whitespace-nowrap { white-space: nowrap; }
.u-mb-6 { margin-bottom: 1.5rem; }
.u-min-w-40 { min-width: 40px; }
.u-min-w-80 { min-width: 80px; }
.u-min-w-100 { min-width: 100px; }
.u-min-w-110 { min-width: 110px; }
.u-min-w-120 { min-width: 120px; }
.u-min-w-130 { min-width: 130px; }
.u-min-w-140 { min-width: 140px; }
.u-min-w-150 { min-width: 150px; }
.u-min-w-160 { min-width: 160px; }
.u-min-w-190 { min-width: 190px; }
.u-min-w-220 { min-width: 220px; }
.u-min-w-250 { min-width: 250px; }
.u-min-w-260 { min-width: 260px; }

/* Scrollbar styling (moved from inline) */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}
html.dark ::-webkit-scrollbar-thumb {
    background: #334155;
}
html {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}
html.dark {
    scrollbar-color: #334155 transparent;
}
