/* Order Page CSS - Clean Redesign */

:root {
    --green: #005A42;
    --green-light: #007B5A;
    --green-bg: #e8f5f0;
    --border: #dee2e6;
    --text-dark: #2c3e50;
    --text-muted: #6c757d;
    --bg-light: #f8f9fa;
    --danger: #dc3545;
    --success: #28a745;
}

/* ===== Top Actions ===== */
.top-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.btn-clear-order {
    background: #fff;
    color: var(--danger);
    border: 1px solid var(--danger);
    border-radius: 8px;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-clear-order:hover {
    background: var(--danger);
    color: #fff;
}

.btn-save-next {
    background: var(--success);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
}

.btn-save-next:hover {
    background: #218838;
    color: #fff;
    text-decoration: none;
}

.btn-save-next.btn-lg {
    padding: 12px 32px;
    font-size: 16px;
}

/* ===== Stats Bar ===== */
.stats-bar {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.stat-pill {
    background: var(--green-bg);
    border: 1px solid #b8ddd0;
    border-radius: 8px;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-pill .stat-label {
    font-size: 14px;
    color: var(--text-muted);
}

.stat-pill .stat-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--green);
}

/* ===== Secondary Actions ===== */
.secondary-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.btn-add-medicine {
    background: #fff;
    color: var(--green);
    border: 1px solid var(--green);
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
}

.btn-add-medicine:hover {
    background: var(--green);
    color: #fff;
    text-decoration: none;
}

.btn-print {
    background: #fff;
    color: var(--green);
    border: 1px solid var(--green);
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-print:hover {
    background: var(--green);
    color: #fff;
}

/* ===== Order Summary Header ===== */
.order-summary-header {
    background: var(--green);
    color: #fff;
    padding: 14px 20px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px 8px 0 0;
}

/* ===== Order Table ===== */
.order-table-wrapper {
    overflow-x: auto;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border-radius: 0 0 8px 8px;
    background: #fff;
    margin-bottom: 30px;
}

.order-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 700px;
}

.order-table thead tr {
    background: var(--bg-light);
    border-bottom: 2px solid var(--border);
}

.order-table thead th {
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 600;
    text-align: left;
    color: var(--text-dark);
    white-space: nowrap;
}

.order-table tbody tr {
    border-bottom: 1px solid #eee;
    transition: background 0.15s;
}

.order-table tbody tr:hover {
    background: var(--bg-light);
}

.order-table tbody td {
    padding: 12px 16px;
    font-size: 13px;
    color: var(--text-dark);
    vertical-align: middle;
}

/* Column widths */
.col-no { width: 60px; text-align: center; }
.col-potency { width: 90px; }
.col-size { width: 80px; }
.col-medicine { min-width: 180px; }
.col-powers { min-width: 200px; }
.col-action { width: 80px; text-align: center; }

/* Badges */
.badge-potency {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-lm {
    background: #e3f2fd;
    color: #1565c0;
}

.badge-ch {
    background: #f3e5f5;
    color: #7b1fa2;
}

.badge-size {
    display: inline-block;
    background: var(--green-bg);
    color: var(--green);
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

/* Medicine name */
.medicine-name-text {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 13px;
}

.medicine-surname-text {
    color: var(--text-muted);
    font-size: 12px;
    font-style: italic;
}

/* Powers input */
.powers-input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.powers-input:focus {
    outline: none;
    border-color: var(--green);
    box-shadow: 0 0 0 2px rgba(0, 90, 66, 0.1);
}

.powers-input.input-error {
    border-color: var(--danger);
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.15);
    animation: shake 0.4s ease;
}

.powers-input.input-saving {
    background: #f0f0f0;
    opacity: 0.7;
}

.powers-input.input-saved {
    border-color: var(--success);
    box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.15);
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

/* Delete button */
.btn-delete {
    background: none;
    border: 1px solid var(--danger);
    color: var(--danger);
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
}

.btn-delete:hover {
    background: var(--danger);
    color: #fff;
}

.btn-delete:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===== Checkout Section ===== */
.checkout-section {
    text-align: center;
    padding: 40px 20px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    margin-bottom: 30px;
}

.checkout-section h4 {
    color: var(--green);
    margin-bottom: 8px;
}

.checkout-section p {
    color: var(--text-muted);
    margin-bottom: 20px;
}

/* ===== Empty & Login States ===== */
.empty-state,
.login-state {
    text-align: center;
    padding: 60px 20px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.empty-icon,
.login-icon {
    font-size: 64px;
    color: #ccc;
    margin-bottom: 20px;
    display: block;
}

.empty-state p,
.login-state p {
    color: var(--text-muted);
    margin-bottom: 20px;
    font-size: 16px;
}

.login-state h3 {
    color: var(--green);
    margin-bottom: 10px;
}

.login-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .top-actions {
        flex-direction: column;
    }

    .btn-clear-order,
    .btn-save-next {
        width: 100%;
        text-align: center;
        justify-content: center;
    }

    .stats-bar {
        flex-direction: column;
        gap: 10px;
    }

    .secondary-actions {
        flex-direction: column;
    }

    .btn-add-medicine,
    .btn-print {
        width: 100%;
        text-align: center;
        justify-content: center;
    }
}
