/* ================================
   Global Styles
================================ */
body, html {
    margin: 0;
    padding: 0;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    color: #333;
    background-color: #fff;
}

.admin-page {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

/* Edge-to-edge widescreen */
@media (min-width: 1200px) {
    .admin-main {
        max-width: 100%;
        padding: 10px;
    }
}

/* Table wrapper */
.table-wrapper {
    width: 100%;
    overflow-x: auto;
    margin: 0;
    padding: 0;
    text-align: left;
}

/* ================================
   Tables
================================ */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 16px;
    min-width: 1300px;
}

.admin-table th,
.admin-table td {
    padding: 6px 6px;
    text-align: left;
    border: 1px solid #ddd;
    vertical-align: middle;
    white-space: nowrap;
}

.admin-table tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

.admin-table td {
    font-size: 13px;
}

.admin-table img {
    max-width: 80px;
    height: auto;
    display: block;
    border-radius: 6px;
}

/* ================================
   Buttons
================================ */
.btn {
    display: inline-block;
    padding: 5px 8px;
    margin: 2px 0;
    border-radius: 5px;
    text-decoration: none;
    font-size: 12px;
    color: white;
    text-align: center;
    min-width: 60px;
}

.btn.edit { background-color: #28a745; }
.btn.delete { background-color: #dc3545; }
.btn.add {
    background-color: #007bff;
    margin-top: 10px;
    font-size: 14px;
    padding: 8px 12px;
}

/* ================================
   Admin Header
================================ */
.admin-back-header {
    background-color: #fdf6e3;
    padding: 10px 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

.admin-back-header .back-button {
    text-decoration: none;
    color: #5a4d3c;
    font-weight: bold;
    font-size: 1.2rem;
}

.admin-back-header .back-logout-button {
    text-decoration: none;
    color: #fff;
    background-color: #c0392b;
    padding: 6px 12px;
    border-radius: 6px;
    font-weight: bold;
}

@media (max-width: 480px) {
    .admin-back-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}

/* ================================
   Forms — CLEANED & FIXED
   Matches dog_edit.php 2-column layout
================================ */

.admin-main {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 20px 48px;
    text-align: center;
    box-sizing: border-box;
}

/* 2-column label blocks */
.admin-form label {
    display: inline-block;
    width: 48%;
    margin-right: 2%;
    margin-bottom: 4px;   /* small gap above input */
    text-align: left;
    vertical-align: top;
}

/* remove right margin from second column */
.admin-form label:nth-child(2n) {
    margin-right: 0;
}

/* inputs under each label */
.admin-form input[type="text"],
.admin-form input[type="number"],
.admin-form input[type="email"],
.admin-form input[type="date"],
.admin-form select,
.admin-form textarea,
.admin-form input[type="file"] {
    width: 100%;
    padding: 8px 10px;
    font-size: 15px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background-color: #f7f3ee;
    box-sizing: border-box;
    margin-bottom: 12px; /* ~1/8" below each input */
    text-align: left;
}

/* textarea sizing */
.admin-form textarea {
    height: 150px;
    resize: vertical;
}

/* Mobile: collapse to 1 column */
@media (max-width: 768px) {
    .admin-form label {
        width: 100%;
        margin-right: 0;
        display: block;
    }
}

/* ================================
   Other
================================ */
.paw-icon {
    width: 26px;
    height: 26px;
    margin-right: 6px;
    vertical-align: middle;
}

.table-wrapper {
    width: 100% !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
    display: block !important;
    white-space: nowrap !important;
}

.admin-table {
    width: max-content !important;
    min-width: 100% !important;
}

@media print {
    .print-btn,
    .filter-form,
    .admin-back-head {
        display: none !important;
    }
    .report-wrap { border: none; }
}

/* ================================
   Updated box_edit layout:
   Narrower 2-column fields + button on its own row
================================ */

/* Narrower columns (half of 48% ≈ 24%) */
.admin-form label {
    width: 35% !important;
    margin-right: 2% !important;
}

/* Inputs follow the same narrow width */
.admin-form label input,
.admin-form label select,
.admin-form label textarea,
.admin-form label input[type="file"] {
    width: 100% !important;
}

/* Button goes on its own row, centered */
.admin-form button {
    display: block;
    width: auto;
    margin: 20px auto 0 auto; /* center it */
}


/* Special layout for treats: description left, two stacked fields right */
.treat-description {
    width: 35% !important;
    vertical-align: top;
}

.treat-right-column {
    display: inline-block;
    width: 35%;
    margin-left: 2%;
    vertical-align: top;
}

.treat-right-column label {
    width: 100% !important;
    display: block;
}


/* Fix indentation of right-column labels in treat edit */
.treat-right-column {
    display: inline-block;
    width: 35%;
    margin-left: 2%;   /* stays — this aligns it correctly across from Description */
    vertical-align: top;
}

/* But the labels INSIDE should NOT inherit first-column behavior */
.treat-right-column label {
    width: 100% !important;     /* full width inside column */
    margin-right: 0 !important; /* prevents extra indentation */
    display: block !important;
}

.treat-description {
    width: 35% !important;
    vertical-align: top;
}

.treat-right {
    width: 35% !important;      /* EXACT same width as other right-side fields */
    margin-right: 0 !important; /* no extra indentation */
    vertical-align: top;
    display: inline-block !important;
}


.save-btn,
.cancel-btn {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.button-row {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 12px !important;
    width: auto !important;
}

/* Save = Green */
.save-btn {
    background-color: #2b7a2b !important;   /* medium green */
    color: #fff !important;
    border: none !important;
}

.save-btn:hover {
    background-color: #3c9a3c !important;   /* lighter on hover */
}

/* Cancel = Red */
.cancel-btn {
    background-color: #b22222 !important;   /* firebrick red */
    color: #fff !important;
    border: none !important;
}

.cancel-btn:hover {
    background-color: #d12f2f !important;   /* brighter red on hover */
}
