* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Arial, sans-serif;
    background: #eceff1;
    color: #222;
}

.app {
    max-width: 1200px;
    margin: 30px auto;
    padding: 20px;
}

h1 {
    text-align: center;
    margin-bottom: 20px;
}

h2 {
    margin-top: 0;
}

/* Navigation */

.nav {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 25px;
}

.nav a {
    text-decoration: none;
    color: #2563eb;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 5px;
}

.nav a:hover {
    background: #dbeafe;
}

/* Cards */

.card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,.1);
}

/* Forms */

label {
    display: block;
    font-weight: 600;
}

label input,
label select {
    margin-top: 6px;
    width: 100%;
    font-weight: normal;
}

input,
select,
button {
    font-size: 16px;
    padding: 10px;
    border-radius: 5px;
}

input,
select {
    border: 1px solid #ccc;
}

/* Add Sale Form */

.sale-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-bottom: 20px;
    align-items: end;
}

.sale-form-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
}

.sale-form-actions button {
    min-width: 220px;
}

/* =========================
   Sale Action Buttons
========================= */

.sale-actions {
  white-space: nowrap;
}

.sale-actions a {
  display: inline-block;
  margin-right: 4px;
  padding: 5px 10px;
  border-radius: 4px;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.2s ease, transform 0.1s ease;
}

.sale-actions a:hover {
  text-decoration: none;
  transform: translateY(-1px);
}


/* Sale Action Buttons */

.sale-actions a:active {
  transform: translateY(0);
}

.btn-edit {
  background: #0d6efd;
}

.btn-edit:hover {
  background: #0b5ed7;
}

.btn-void {
  background: #dc3545;
}

.btn-void:hover {
  background: #bb2d3b;
}

.btn-refund {
  background: #fd7e14;
}

.btn-refund:hover {
  background: #e66a00;
}


.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 24px;
}

.form-actions button,
.form-actions .button {
    min-width: 160px;
    text-align: center;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 10px 14px;
    font-size: 16px;
    border-radius: 5px;
    font-weight: 600;
    text-decoration: none;
}

.form-actions .button.secondary {
    background: #555;
    color: white;
}

@media (max-width: 768px) {
    .form-actions {
        flex-direction: column;
    }

    .form-actions button,
    .form-actions .button {
        width: 100%;
    }
}

/* Dashboard Metrics */

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
}

.metric-card {
    background: #f8fafc;
    border: 1px solid #dbeafe;
    border-radius: 8px;
    padding: 24px;
    text-align: center;
}

.metric-label {
    color: #555;
    margin-bottom: 10px;
}

.metric-value {
    font-size: 30px;
    font-weight: bold;
    color: #2563eb;
}

/* Buttons */

button,
.button,
.button-link {
    border: none;
    background: #2563eb;
    color: white;
    text-decoration: none;
    display: inline-block;
    padding: 10px 14px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
}

button:hover,
.button:hover,
.button-link:hover {
    opacity: .9;
}

button.secondary {
    background: #555;
}

button.danger {
    background: #b91c1c;
}

.remove-btn {
    background: #b91c1c;
    padding: 6px 10px;
    font-size: 14px;
}

/* Admin Tools */

.admin-tools-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.admin-tools-grid .button-link {
    display: block;
    text-align: center;
    padding: 16px;
    font-size: 18px;
}

/* Tables */

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

thead {
    background: #f5f5f5;
}

th,
td {
    padding: 12px;
    border-bottom: 1px solid #ddd;
    text-align: left;
}

tbody tr:hover {
    background: #fafafa;
}

/* Totals */

.totals {
    margin-top: 20px;
    text-align: right;
}

.totals p {
    margin: 8px 0;
}

.grand {
    font-size: 24px;
    font-weight: bold;
}

/* Action Buttons */

.actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 15px;
}

/* Status Colors */

.status-active {
    color: #166534;
    font-weight: bold;
}

.status-voided {
    color: #b91c1c;
    font-weight: bold;
}

.status-refunded {
    color: #92400e;
    font-weight: bold;
}

/* Messages */

.error {
    color: #b91c1c;
    font-weight: 600;
}

.success {
    color: #166534;
    font-weight: 600;
}

/* Receipt Page */

.receipt {
    max-width: 450px;
    margin: 0 auto;
}

.receipt h1,
.receipt p {
    text-align: center;
}

.receipt-table {
    width: 100%;
    margin-top: 20px;
}

.receipt-totals {
    margin-top: 20px;
    text-align: right;
}

.receipt-actions {
    text-align: center;
    margin-top: 20px;
}

/* Mobile */

@media (max-width: 768px) {

    .app {
        padding: 12px;
    }

    .nav {
        flex-direction: column;
        align-items: stretch;
    }

    .nav a {
        text-align: center;
    }

    .sale-form,
    .admin-tools-grid {
        grid-template-columns: 1fr;
    }

    .sale-form-actions {
        grid-column: span 1;
    }

    .sale-form-actions button {
        width: 100%;
    }

    .metrics-grid {
        grid-template-columns: 1fr;
    }

    .actions {
        justify-content: flex-start;
    }

    .actions a,
    .actions button {
        width: 100%;
    }

    .totals {
        text-align: left;
    }

    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        font-size: 14px;
    }
}

@media print {

    .nav,
    .receipt-actions {
        display: none;
    }

    body {
        background: white;
    }

    .app {
        max-width: none;
        margin: 0;
        padding: 0;
    }

    .card {
        box-shadow: none;
        border: none;
    }
    /* DiamondPiper */
}