/* ==========================================================================
   Lao Ethnic Garden — Admin Forms (uses layouts.app)
   ========================================================================== */

/* Form container */
.leg-form {
    max-width: 760px;
    margin: 0 auto;
    background: var(--leg-surface);
    border: 1px solid var(--leg-border);
    border-radius: 10px;
    box-shadow: var(--leg-shadow-sm);
    overflow: hidden;
}
.leg-form__header {
    padding: 22px 28px 16px;
    border-bottom: 1px solid var(--leg-border);
    background: linear-gradient(180deg, var(--leg-surface-alt), var(--leg-surface));
}
.leg-form__title {
    font-family: var(--leg-font-heading);
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--leg-primary-dark);
    margin: 0 0 4px 0;
    letter-spacing: -0.02em;
}
:root[data-theme="dark"] .leg-form__title { color: #7dd499; }
.leg-form__subtitle {
    font-size: 0.88rem;
    color: var(--leg-text-muted);
    margin: 0;
}

.leg-form__body {
    padding: 24px 28px;
}

/* Form rows / fields */
.leg-field {
    margin-bottom: 18px;
}
.leg-field--row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.leg-field__label {
    display: block;
    font-family: var(--leg-font-heading);
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--leg-text);
    margin-bottom: 6px;
    letter-spacing: 0.01em;
}
.leg-field__label .required { color: #e11d48; }
.leg-field__hint {
    font-size: 0.75rem;
    color: var(--leg-text-muted);
    margin-top: 4px;
}

.leg-input,
.leg-textarea,
.leg-select {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--leg-border);
    border-radius: 6px;
    background: var(--leg-surface);
    color: var(--leg-text);
    font-family: var(--leg-font-sans);
    font-size: 0.92rem;
    line-height: 1.5;
    transition: all 160ms ease;
    outline: 0;
    box-sizing: border-box;
}
.leg-input:focus,
.leg-textarea:focus,
.leg-select:focus {
    border-color: var(--leg-primary);
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.12);
}
.leg-textarea {
    min-height: 120px;
    resize: vertical;
}
.leg-input--lg {
    font-size: 1.05rem;
    padding: 13px 16px;
    font-weight: 600;
}

/* Image upload box */
.leg-upload {
    position: relative;
    border: 2px dashed var(--leg-border-strong);
    border-radius: 8px;
    padding: 32px 20px;
    text-align: center;
    background: var(--leg-surface-alt);
    cursor: pointer;
    transition: all 200ms ease;
    overflow: hidden;
}
.leg-upload:hover,
.leg-upload.is-drag-over {
    border-color: var(--leg-primary);
    background: rgba(22, 163, 74, 0.06);
}
.leg-upload__icon {
    font-size: 2.5rem;
    margin-bottom: 8px;
}
.leg-upload__text {
    font-weight: 600;
    color: var(--leg-text);
    margin-bottom: 4px;
}
.leg-upload__hint {
    font-size: 0.78rem;
    color: var(--leg-text-muted);
}
.leg-upload__input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}
.leg-upload__progress {
    margin-top: 12px;
    height: 6px;
    background: var(--leg-border);
    border-radius: 3px;
    overflow: hidden;
    display: none;
}
.leg-upload__progress.is-visible { display: block; }
.leg-upload__progress-bar {
    height: 100%;
    background: var(--leg-gradient);
    width: 0%;
    transition: width 240ms ease;
}
.leg-upload__preview {
    margin-top: 14px;
    display: none;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--leg-border);
}
.leg-upload__preview.is-visible { display: block; }
.leg-upload__preview img {
    display: block;
    width: 100%;
    max-height: 360px;
    object-fit: contain;
    background: #0b1220;
}

/* Form footer (actions) */
.leg-form__footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 18px 28px;
    border-top: 1px solid var(--leg-border);
    background: var(--leg-surface-alt);
}
.leg-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 22px;
    border: 1px solid var(--leg-border);
    border-radius: 6px;
    background: var(--leg-surface);
    color: var(--leg-text);
    font-family: var(--leg-font-heading);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: all 180ms ease;
}
.leg-btn:hover {
    background: var(--leg-surface-alt);
    color: var(--leg-text);
    border-color: var(--leg-border-strong);
}
.leg-btn--primary {
    background: var(--leg-gradient);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(22, 163, 74, 0.25);
}
.leg-btn--primary:hover {
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(22, 163, 74, 0.35);
}
.leg-btn--primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ====== Dashboard tiles ====== */
.leg-dashboard__welcome {
    background: var(--leg-gradient);
    color: #fff;
    padding: 28px 32px;
    border-radius: 10px;
    margin-bottom: 24px;
    box-shadow: var(--leg-shadow);
}
.leg-dashboard__welcome h1 {
    font-size: 1.7rem;
    margin: 0 0 6px 0;
    color: #fff;
}
.leg-dashboard__welcome p {
    margin: 0;
    opacity: 0.92;
}

.leg-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}
.leg-stat-card {
    background: var(--leg-surface);
    border: 1px solid var(--leg-border);
    border-radius: 8px;
    padding: 18px 20px;
    box-shadow: var(--leg-shadow-sm);
    transition: all 200ms ease;
}
.leg-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--leg-shadow);
    border-color: var(--leg-primary-light);
}
.leg-stat-card__icon { font-size: 1.6rem; margin-bottom: 6px; }
.leg-stat-card__value {
    font-family: var(--leg-font-heading);
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--leg-primary-dark);
    line-height: 1.1;
}
:root[data-theme="dark"] .leg-stat-card__value { color: #7dd499; }
.leg-stat-card__label {
    font-size: 0.78rem;
    color: var(--leg-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
    margin-top: 4px;
}

.leg-create-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}
.leg-create-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 28px 18px;
    background: var(--leg-surface);
    border: 1px solid var(--leg-border);
    border-radius: 8px;
    text-decoration: none;
    color: var(--leg-text);
    transition: all 220ms cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}
.leg-create-tile:hover {
    transform: translateY(-4px);
    box-shadow: var(--leg-shadow-lg);
    border-color: var(--leg-primary);
    color: var(--leg-primary-dark);
}
.leg-create-tile__icon {
    font-size: 2.6rem;
    margin-bottom: 10px;
    transition: transform 240ms ease;
}
.leg-create-tile:hover .leg-create-tile__icon {
    transform: scale(1.15) rotate(-5deg);
}
.leg-create-tile__title {
    font-family: var(--leg-font-heading);
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--leg-primary-dark);
    margin: 0 0 4px;
}
:root[data-theme="dark"] .leg-create-tile__title { color: #7dd499; }
.leg-create-tile__desc {
    font-size: 0.78rem;
    color: var(--leg-text-muted);
    line-height: 1.4;
}

/* Responsive */
@media (max-width: 575px) {
    .leg-form__header,
    .leg-form__body,
    .leg-form__footer { padding-left: 18px; padding-right: 18px; }
    .leg-field--row { grid-template-columns: 1fr; }
    .leg-form__footer { flex-direction: column-reverse; }
    .leg-form__footer .leg-btn { width: 100%; justify-content: center; }
}
