/* ============================================
   SewBranded — Authenticated / dashboard styles
   Complements style.css (marketing) for app UI
   ============================================ */

body.app-body {
    background: var(--off-white);
    min-height: 100vh;
    font-family: var(--font-display);
    color: var(--charcoal);
}

.app-main {
    padding-top: 6.5rem;
    padding-bottom: 3rem;
    min-height: calc(100vh - 200px);
}

/* --- Cards and panels --- */
.app-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(124, 58, 237, 0.06);
    border: 1px solid var(--grey-100);
}

.app-card + .app-card {
    margin-top: 1.5rem;
}

.app-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px dashed var(--purple-200);
}

.app-card-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--purple-800);
    margin: 0;
}

.app-subtitle {
    color: var(--grey-500);
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

.auth-card {
    background: var(--white);
    padding: 2.5rem 2rem;
    border-radius: var(--radius);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.auth-card h1 {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--purple-800);
    margin-bottom: 0.25rem;
}

.auth-card .auth-lede {
    color: var(--grey-500);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.auth-card .auth-footer {
    text-align: center;
    margin-top: 1.25rem;
    font-size: 0.85rem;
    color: var(--grey-500);
}

.auth-card .auth-footer a {
    color: var(--purple-600);
    font-weight: 600;
}

/* --- Flash messages --- */
.app-flash {
    padding: 0.9rem 1.25rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.app-flash-success {
    background: #ecfdf5;
    border: 2px solid var(--mint);
    color: #065f46;
}

.app-flash-error {
    background: #fef2f2;
    border: 2px solid var(--coral);
    color: #991b1b;
}

.app-flash-info {
    background: var(--purple-100);
    border: 2px solid var(--purple-300);
    color: var(--purple-800);
}

/* --- Form validation errors --- */
.app-error {
    color: var(--coral);
    font-size: 0.8rem;
    margin-top: 0.25rem;
    font-weight: 600;
}

.app-errors {
    background: #fef2f2;
    border: 2px solid var(--coral);
    color: #991b1b;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.app-errors ul {
    margin: 0.5rem 0 0 1.25rem;
    font-weight: 500;
}

/* --- Simple table --- */
.app-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}

.app-table th,
.app-table td {
    padding: 0.85rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--grey-100);
}

.app-table th {
    background: var(--purple-50);
    color: var(--purple-800);
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.app-table tbody tr:last-child td {
    border-bottom: none;
}

.app-table tbody tr:hover {
    background: var(--purple-50);
}

/* --- Pills / status badges --- */
.pill {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-pill);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.pill-draft        { background: var(--grey-100); color: var(--grey-700); }
.pill-submitted    { background: #dbeafe; color: #1e40af; }
.pill-under_review { background: #fef3c7; color: #92400e; }
.pill-approved     { background: #d1fae5; color: #065f46; }
.pill-awaiting_payment { background: #fce7f3; color: #9f1239; }
.pill-paid         { background: var(--mint); color: white; }
.pill-in_production { background: var(--purple-100); color: var(--purple-800); }
.pill-shipped      { background: var(--sky); color: white; }
.pill-completed    { background: var(--mint); color: white; }
.pill-rejected     { background: #fecaca; color: #991b1b; }
.pill-cancelled    { background: var(--grey-200); color: var(--grey-700); }

/* --- Buttons (small sizes) --- */
.btn-sm {
    padding: 0.45rem 0.9rem;
    font-size: 0.8rem;
}

.btn-danger {
    background: var(--coral);
    color: white;
    border: 2px solid var(--coral);
}

.btn-danger:hover {
    background: #ef4444;
}

/* --- Grids --- */
.app-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

.app-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

.app-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

@media (max-width: 900px) {
    .app-grid-2, .app-grid-3, .app-grid-4 { grid-template-columns: 1fr; }
}

/* --- Product card --- */
.product-tile {
    background: var(--white);
    border: 2px solid var(--grey-100);
    border-radius: var(--radius);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    cursor: pointer;
    transition: all .15s ease;
}

.product-tile:hover {
    border-color: var(--purple-400);
    transform: translateY(-2px);
}

.product-tile.selected {
    border-color: var(--purple-600);
    background: var(--purple-50);
    box-shadow: 0 0 0 3px var(--purple-100);
}

.product-tile .qty {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.product-tile input[type="number"] {
    width: 70px;
    padding: 0.35rem 0.5rem;
    border: 2px solid var(--grey-200);
    border-radius: var(--radius-sm);
    font: inherit;
}

/* --- Design preview box --- */
.preview-box {
    background: var(--purple-50);
    border: 2px dashed var(--purple-300);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
}

.preview-box img {
    max-width: 100%;
    max-height: 400px;
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.preview-palette {
    display: flex;
    gap: 0.4rem;
    justify-content: center;
    margin-top: 1rem;
}

.preview-palette span {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
    display: inline-block;
}

/* Admin order page: a design's thread codes and a text design's spec, in plain view. */
.td-codes { display: flex; flex-wrap: wrap; gap: 0.35rem 0.75rem; justify-content: center; margin: 0.5rem 0 0; font-size: 0.8rem; color: var(--grey-700); }
.td-thread { display: inline-flex; align-items: center; gap: 0.3rem; margin-right: 0.6rem; }
.td-thread span { width: 12px; height: 12px; border-radius: 50%; border: 1px solid #ccc; display: inline-block; }
.td-spec { display: grid; grid-template-columns: auto 1fr; gap: 0.25rem 0.75rem; margin: 0.75rem 0 0; font-size: 0.85rem; text-align: left; }
.td-spec dt { color: var(--grey-500); }
.td-spec dd { margin: 0; color: var(--grey-800, #333); }

.price-box {
    background: var(--gradient-soft);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-top: 1.5rem;
}

.price-box dl {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.4rem 1rem;
    margin: 0;
}

.price-box dt { color: var(--grey-700); }
.price-box dd { margin: 0; font-weight: 700; font-family: var(--font-display); }

.price-box .price-total {
    grid-column: 1 / -1;
    border-top: 2px dashed var(--purple-300);
    padding-top: 0.75rem;
    margin-top: 0.75rem;
    display: flex;
    justify-content: space-between;
    font-size: 1.3rem;
}

.price-box .price-total span:last-child {
    color: var(--purple-800);
    font-weight: 800;
}

/* --- Canvas wrapper --- */
.canvas-wrap {
    background: var(--purple-50);
    border: 2px dashed var(--purple-300);
    border-radius: var(--radius);
    padding: 1rem;
    display: inline-block;
    max-width: 100%;
}

.canvas-wrap canvas {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

/* --- Link list (footer link lists in dashboard) --- */
.link-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.link-list li {
    padding: 0.5rem 0;
    border-bottom: 1px dashed var(--grey-200);
}
.link-list li:last-child { border-bottom: none; }
.link-list a {
    color: var(--purple-700);
    text-decoration: none;
    font-weight: 600;
}
.link-list a:hover { color: var(--pink-500); }
