/* ERP shared additions: alerts, modals, forms, generic table polish */

.alert {
    padding: 0.9rem 1.2rem;
    border-radius: 6px;
    margin-bottom: 1.25rem;
    font-size: 0.95rem;
    border: 1px solid transparent;
}
.alert-success { background: #e6f6ec; color: #1d6a3a; border-color: #b4e2c1; }
.alert-error   { background: #fdecea; color: #a32a1f; border-color: #f5b7b1; }
.alert-info    { background: #e8f1fc; color: #1d4d8c; border-color: #b8d3f0; }

.btn { display: inline-block; padding: 0.55rem 1.1rem; border-radius: 4px; border: none; cursor: pointer; font-size: 0.95rem; text-decoration: none; transition: all .2s; }
.btn-primary   { background: #0066cc; color: #fff; }
.btn-primary:hover { background: #004f9e; }
.btn-secondary { background: #f0f3f7; color: #333; border: 1px solid #d4d9e0; }
.btn-secondary:hover { background: #e2e8f0; }
.btn-danger    { background: #e74c3c; color: #fff; }
.btn-danger:hover { background: #c0392b; }
.btn-small     { padding: 0.3rem 0.7rem; font-size: 0.85rem; border-radius: 3px; background: #f0f3f7; border: 1px solid #d4d9e0; color: #333; cursor: pointer; margin-right: 4px; text-decoration: none; display: inline-block; }
.btn-small:hover { background: #e2e8f0; }
.btn-small.danger { background: #fdecea; color: #a32a1f; border-color: #f5b7b1; }

/* Modal */
.modal-backdrop {
    position: fixed; inset: 0; background: rgba(20,30,50,.55);
    display: none; align-items: center; justify-content: center; z-index: 1500;
    padding: 1rem;
}
.modal-backdrop.open { display: flex; }
.modal {
    background: #fff; border-radius: 10px; width: 100%; max-width: 640px;
    max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.modal-header {
    padding: 1.1rem 1.4rem; border-bottom: 1px solid #e9ecef;
    display: flex; justify-content: space-between; align-items: center;
}
.modal-header h3 { font-size: 1.2rem; margin: 0; color: #1e3c72; }
.modal-close { background: none; border: none; font-size: 1.4rem; cursor: pointer; color: #888; }
.modal-body  { padding: 1.4rem; }
.modal-footer { padding: 1rem 1.4rem; border-top: 1px solid #e9ecef; text-align: right; }

/* Forms */
.form-row { margin-bottom: 1rem; }
.form-row label { display: block; font-size: 0.88rem; color: #555; margin-bottom: 0.35rem; font-weight: 500; }
.form-row input, .form-row select, .form-row textarea {
    width: 100%; padding: 0.6rem 0.8rem; border: 1px solid #d4d9e0;
    border-radius: 4px; font-size: 0.95rem; font-family: inherit;
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus {
    outline: none; border-color: #0066cc; box-shadow: 0 0 0 3px rgba(0,102,204,.1);
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 600px) { .form-grid { grid-template-columns: 1fr; } }

/* Module table polish */
.module-table { width: 100%; border-collapse: collapse; }
.module-table th, .module-table td { padding: 0.85rem 1rem; text-align: left; border-bottom: 1px solid #eef1f5; font-size: 0.93rem; }
.module-table th { background: #f7f9fc; color: #555; font-weight: 600; font-size: 0.82rem; text-transform: uppercase; letter-spacing: .5px; }
.module-table tbody tr:hover { background: #fafbfd; }

.badge { display: inline-block; padding: 0.18rem 0.65rem; border-radius: 20px; font-size: 0.78rem; font-weight: 600; }
.badge-success { background: #d4edda; color: #155724; }
.badge-warning { background: #fff3cd; color: #856404; }
.badge-info    { background: #d1ecf1; color: #0c5460; }
.badge-danger  { background: #f8d7da; color: #721c24; }
.badge-muted   { background: #e9ecef; color: #495057; }

.empty-state { text-align: center; padding: 3rem 1rem; color: #888; }
.empty-state .big { font-size: 2.5rem; margin-bottom: 0.5rem; }

/* Cart & checkout */
.cart-table { width: 100%; background: white; border-radius: 8px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.cart-table th, .cart-table td { padding: 1rem; border-bottom: 1px solid #eef1f5; }
.cart-summary {
    background: white; border-radius: 8px; padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,.06); position: sticky; top: 1rem;
}
.cart-summary .row { display: flex; justify-content: space-between; padding: 0.4rem 0; }
.cart-summary .total { font-size: 1.3rem; font-weight: 700; border-top: 2px solid #e9ecef; padding-top: 0.8rem; margin-top: 0.5rem; }

.cart-layout {
    display: grid; grid-template-columns: 2fr 1fr; gap: 2rem; padding: 1.5rem 0;
}
@media (max-width: 900px) { .cart-layout { grid-template-columns: 1fr; } }

.qty-input { width: 70px; text-align: center; padding: 0.4rem; border: 1px solid #d4d9e0; border-radius: 4px; }

.add-to-cart {
    background: #f39c12; color: white; padding: 0.8rem 1.6rem;
    border: none; border-radius: 4px; cursor: pointer; font-size: 1rem; font-weight: 600;
}
.add-to-cart:hover { background: #d68910; }

/* Cards inside Marketing dashboard */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.kpi { background: white; border-radius: 8px; padding: 1.4rem; box-shadow: 0 2px 8px rgba(0,0,0,.06); border-left: 4px solid #0066cc; }
.kpi .label { color: #888; font-size: 0.85rem; text-transform: uppercase; letter-spacing: .5px; }
.kpi .value { font-size: 1.8rem; font-weight: 700; color: #1e3c72; margin-top: 0.4rem; }
.kpi.warn { border-left-color: #f39c12; }
.kpi.good { border-left-color: #27ae60; }
.kpi.bad  { border-left-color: #e74c3c; }

/* Marketing tile nav */
.tile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.tile { background: white; border-radius: 10px; padding: 1.5rem; box-shadow: 0 2px 8px rgba(0,0,0,.06); text-decoration: none; color: #333; transition: all .2s; border: 1px solid #eef1f5; }
.tile:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,.1); border-color: #0066cc; }
.tile .icon { font-size: 2rem; margin-bottom: 0.6rem; }
.tile h3 { color: #1e3c72; margin-bottom: 0.3rem; }
.tile p { color: #666; font-size: 0.9rem; margin: 0; }
