/* ADMIN PANEL LAYOUT */

.admin-wrapper {
    display: flex;
    width: 100%;
    min-height: 70vh;
}

/* SIDEBAR */

.admin-sidebar {
    width: 260px;
    background-color: var(--light3);
    border-right: 2px solid var(--secondary);
    padding: 25px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.admin-sidebar h3 {
    color: var(--secondary);
    font-size: 22px;
    margin-bottom: 20px;
    font-weight: 600;
}

.admin-sidebar a {
    display: block;
    padding: 12px 14px;
    background-color: var(--secondary);
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 15px;
    font-weight: 500;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.admin-sidebar a:hover {
    background-color: var(--primary);
    transform: translateX(3px);
}

.admin-sidebar .back-link {
    background-color: var(--secondary);
    color: var(--text-light);
}

.admin-sidebar .back-link:hover {
    background-color: var(--primary);
    color: var(--text-light);
}


/* MAIN CONTENT */

.admin-content {
    flex-grow: 1;
    padding: 30px 40px;
}

.admin-content h1 {
    color: var(--primary);
    font-size: 28px;
    margin-bottom: 20px;
}

.admin-wrapper {
    margin-bottom: 80px;
}

.admin-wrapper {
    display: flex;
    align-items: stretch; /* THIS fixes the sidebar gap */
}

.admin-content .admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: var(--light3);
    color: var(--dark);
    font-size: 0.95rem;
}

.admin-content .admin-table th {
    background: var(--secondary);
    color: white;
    padding: 10px;
    text-align: left;
    border-bottom: 2px solid var(--dark);
}

.admin-content .admin-table td {
    padding: 10px;
    border-bottom: 1px solid var(--dark);
}

.admin-content .admin-table tr:hover td {
    background: var(--light2);
}

.admin-content input#newUnitInput {
    background: var(--light3) !important;
    border: 1px solid var(--secondary) !important;
    color: var(--dark) !important;
    padding: 8px !important;
    border-radius: 4px !important;
}

.admin-section {
    max-width: 800px;
}

.admin-title,
.admin-subtitle {
    color: var(--primary);
    margin-bottom: 10px;
}

.units-input-row {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.units-input-row input {
    flex: 1;
    background: var(--light3);
    border: 1px solid var(--secondary);
    color: var(--dark);
    padding: 8px;
}

/* tighten table spacing */
.admin-content .admin-table td {
    padding: 4px 8px;
    line-height: 1.2;
}

.unit-row.selected {
    background: var(--light2);
}
.unit-row {
    cursor: pointer;
}

/* FINAL — correct styling for ALL admin form fields */
.admin-section input,
.admin-section textarea,
.admin-section select {
    background: var(--light3);
    color: var(--text-dark);
    border: 1px solid var(--secondary);
    padding: 8px;
    border-radius: 4px;
}

.field-block {
    display: flex;
    flex-direction: column;
    margin-right: 15px;
}

.field-block label {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--secondary);
}

.store-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
}
.admin-log-widget {
    background: var(--light3);
    color: var(--dark);
    padding: 15px 20px;
    border: 1px solid var(--secondary);
    border-radius: 4px;
    margin-top: 30px;
    font-size: 0.9rem;
}

.admin-log-widget h3 {
    margin-top: 0;
    margin-bottom: 12px;
    color: var(--primary);
    font-size: 20px;
    font-weight: 600;
}

.admin-log-line {
    padding: 6px 0;
    border-bottom: 1px solid var(--dark);
    font-family: monospace;
}

.admin-log-line:last-child {
    border-bottom: none;
}

/* PENDING PAGE BUTTONS — INLINE + NARROWER */
.pending-approve-btn,
.pending-reject-btn {
    display: inline-block;        /* forces inline */
    padding: 4px 10px;            /* narrower buttons */
    border-radius: 4px;
    font-size: 13px;              /* smaller text */
    font-weight: 600;
    text-decoration: none;
    color: white;
    margin-right: 6px;            /* spacing between them */
    white-space: nowrap;          /* prevents wrapping */
    vertical-align: middle;       /* keeps them aligned */
}

/* BLUE APPROVE */
.pending-approve-btn {
    background-color: #007bff;
    border: 1px solid #007bff;
}

.pending-approve-btn:hover {
    filter: brightness(0.9);
}

/* RED REJECT */
.pending-reject-btn {
    background-color: #dc3545;
    border: 1px solid #dc3545;
}

.pending-reject-btn:hover {
    filter: brightness(0.9);
}

/* FORCE PENDING ACTION BUTTONS INLINE */
.admin-table td {
    white-space: nowrap;        /* prevents wrapping */
}

.pending-approve-btn,
.pending-reject-btn {
    display: inline-block;      /* inline buttons */
    padding: 6px 12px;          /* original size restored */
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    color: white;
    margin-right: 6px;          /* spacing between buttons */
    vertical-align: middle;
}

/* BLUE APPROVE */
.pending-approve-btn {
    background-color: #007bff;
    border: 1px solid #007bff;
}

.pending-approve-btn:hover {
    filter: brightness(0.9);
}

/* RED REJECT */
.pending-reject-btn {
    background-color: #dc3545;
    border: 1px solid #dc3545;
}

.pending-reject-btn:hover {
    filter: brightness(0.9);
}

/* SECURITY LOGS PAGE */
.log-file-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.log-file-link {
    display: inline-block;
    padding: 8px 12px;
    background: #222;
    color: #fff;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
}

.log-file-link:hover {
    background: #333;
}

/* LAST 10 LOG EVENTS BOX */
.log-last-10-box {
    background: #222;
    color: #ddd;
    padding: 15px;
    border-radius: 5px;
    max-height: 400px;
    overflow-y: auto;
    margin-top: 20px;
    font-family: monospace;
    font-size: 0.9rem;
    line-height: 1.4rem;
}

.admin-log-box {
    background: #000;
    color: #00ff00;
    padding: 15px;
    border-radius: 4px;
    margin-top: 15px;
    height: 300px;          /* ← THIS IS THE FIX */
    overflow-y: scroll !important;
    font-family: monospace;
    font-size: 0.9rem;
    line-height: 1.4rem;
    border: 1px solid #333;
}

.admin-log-widget-title {
    color: #00ff00;
    margin-top: 20px;
    margin-bottom: 10px;
}

.admin-content {
    width: 100%;
    max-width: 100%;
}

.admin-log-box,
.admin-log-widget {
    width: 100%;
}

.admin-table tbody tr:nth-child(even) {
    background: var(--light1);
}

.admin-table tbody tr:nth-child(odd) {
    background: var(--light2);
}

#confirmModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

#confirmModal .modal-box {
    background: #fff;
    padding: 20px;
    border-radius: 4px;
    min-width: 250px;
    text-align: center;
}

#confirmRecipeModal {
    display: none;
}

/* HELP ITEMS (ADMIN) — minimal, uses existing theme + admin styles */

.help-admin-list {
    max-height: 70vh;
    overflow-y: auto;
    padding-right: 8px;
}

.help-admin-item {
    background: var(--light);
    border: 1px solid var(--border);
    padding: 12px;
    margin-bottom: 10px;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-section-title {
    color: var(--primary);
    margin-top: 20px;
    margin-bottom: 10px;
}

.help-title-main {
    color: var(--secondary);
    margin-bottom: 20px;
}

.help-search {
    max-width: 400px;
    margin-bottom: 20px;
}

.help-container {
    max-height: 70vh;
    overflow-y: auto;
    padding-right: 10px;
}

.help-category-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary);
    margin: 12px 0 4px;
    border-bottom: 1px solid var(--border);
}

.help-category {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.help-item {
    border: 1px solid var(--border);
    padding: 4px 6px;
    margin: 0;
    border-radius: 4px;
    background: var(--light);
    cursor: pointer;
    transition: background 0.2s;
}

.help-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2px 0;
    font-weight: bold;
    color: var(--secondary);
    border-bottom: none;
}

.help-item:hover .help-title-row {
    background: var(--primary-light);
    color: var(--primary);
}

.help-arrow {
    font-size: 1.2rem;
    opacity: 1;
    transition: transform 0.2s;
}

.help-item.open .help-arrow {
    transform: rotate(180deg);
}

.help-body {
    display: none;
    padding: 4px;
    color: var(--text);
}

.help-admin-section #confirmModal {
    z-index: 99999;
}

.hidden {
    display: none;
}

.units-input-row {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.units-input-row input {
    flex: 1;
    background: var(--light3);
    border: 1px solid var(--secondary);
    padding: 8px;
    color: var(--dark);
}

.units-input-row .btn {
    padding: 8px 14px;
}

.unit-row.selected {
    background: var(--light2);
}
