/* flash messages */

.message {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.92rem;
    font-weight: 500;
}

.message.success {
    background: #d1e7dd;
    color: #0a3622;
    border: 1px solid #a3cfbb;
}

.message.error {
    background: #f8d7da;
    color: #58151c;
    border: 1px solid #f1aeb5;
}

.message.warning {
    background: #fff3cd;
    color: #664d03;
    border: 1px solid #ffe69c;
}

.message.info {
    background: #cff4fc;
    color: #055160;
    border: 1px solid #9eeaf9;
}

/* admin layout */

.admin-body {
    background: #f0ece7;
    margin: 0;
}

.admin-shell {
    display: flex;
    min-height: 100vh;
}

/* sidebar */

.admin-sidebar {
    width: 230px;
    background: #1a1512;
    color: #c9b99e;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 24px 20px 22px;
    border-bottom: 1px solid #2e2620;
    color: #f0e8dc;
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.01em;
}

.sidebar-brand-mark {
    width: 30px;
    height: 30px;
    background: #8b6e4e;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 1rem;
    color: #fff;
    flex-shrink: 0;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    color: #a89880;
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
    position: relative;
}

.sidebar-link:hover {
    background: #2a211a;
    color: #e8d8c4;
}

.sidebar-link.is-active {
    background: #2e2218;
    color: #f0e4d2;
    font-weight: 600;
}

.sidebar-icon {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
    opacity: 0.8;
}

.sidebar-link.is-active .sidebar-icon {
    opacity: 1;
}

.sidebar-badge {
    margin-left: auto;
    background: #c0392b;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 999px;
    line-height: 1.5;
}

.sidebar-footer {
    padding: 16px 12px 24px;
    border-top: 1px solid #2e2620;
}

.sidebar-logout {
    display: block;
    width: 100%;
    padding: 8px 4px;
    background: #2a211a;
    color: #a89880;
    border: none;
    border-radius: 8px;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.sidebar-logout:hover {
    background: #3a2e25;
    color: #e8d8c4;
}

/* main content */

.admin-content {
    margin-left: 230px;
    flex: 1;
    padding: 36px 40px;
    min-height: 100vh;
}

.admin-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 28px;
    gap: 16px;
}

.admin-page-title {
    margin: 0 0 4px;
    font-size: 1.7rem;
    font-weight: 700;
    color: #1a1512;
}

.admin-page-sub {
    margin: 0;
    color: #7a6f66;
    font-size: 0.9rem;
}

/* stat cards */

.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 28px;
}

.stat-card {
    background: #fff;
    border-radius: 14px;
    padding: 22px 24px;
    box-shadow: 0 2px 12px rgba(26, 21, 18, 0.06);
    border-left: 4px solid transparent;
}

.stat-new    { border-left-color: #c09060; }
.stat-progress { border-left-color: #5580b8; }
.stat-resolved { border-left-color: #3a8c54; }
.stat-products { border-left-color: #8b5a6e; }

.stat-label {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #8a7f76;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 2.4rem;
    font-weight: 800;
    color: #1a1512;
    line-height: 1;
    margin-bottom: 10px;
}

.stat-action {
    font-size: 0.8rem;
    color: #8b6e4e;
    text-decoration: none;
    font-weight: 600;
}

.stat-action:hover { text-decoration: underline; }

.stat-warn {
    color: #b84040;
}

/* overview panels */

.overview-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.overview-panel {
    background: #fff;
    border-radius: 14px;
    padding: 22px 24px;
    box-shadow: 0 2px 12px rgba(26, 21, 18, 0.06);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.panel-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: #1a1512;
}

.panel-link {
    font-size: 0.82rem;
    color: #8b6e4e;
    text-decoration: none;
    font-weight: 600;
}

.panel-link:hover { text-decoration: underline; }

/* Recent messages list */
.msg-list { display: flex; flex-direction: column; gap: 0; }

.msg-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f0ece7;
}

.msg-row:last-child { border-bottom: none; }

.msg-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #e8d8c4;
    color: #6b4f31;
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.msg-body { flex: 1; min-width: 0; }

.msg-name {
    font-weight: 600;
    font-size: 0.88rem;
    color: #1a1512;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.msg-preview {
    font-size: 0.82rem;
    color: #7a6f66;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.msg-date {
    font-size: 0.78rem;
    color: #a09088;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Low stock list */
.stock-list { display: flex; flex-direction: column; gap: 0; }

.stock-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f0ece7;
}

.stock-row:last-child { border-bottom: none; }

.stock-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: #1a1512;
}

.stock-cat {
    font-size: 0.8rem;
    color: #9a8f86;
}

.stock-qty {
    font-size: 0.8rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 999px;
}

.qty-zero { background: #fde8e8; color: #b84040; }
.qty-low  { background: #fef3e2; color: #a06020; }

.empty-inventory-hint {
    text-align: center;
    padding: 20px 0 4px;
}

/* filter bar */

.dashboard-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.dashboard-filters input,
.dashboard-filters select {
    padding: 10px 14px;
    border: 1px solid #d8d0c8;
    border-radius: 8px;
    background: #fff;
    font-size: 0.92rem;
    height: 42px;
    box-sizing: border-box;
    margin: 0;
}

.dashboard-filters input { flex: 2; min-width: 200px; }
.dashboard-filters select { flex: 1; min-width: 140px; }

/* table styles */

.dashboard-card {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 2px 12px rgba(26, 21, 18, 0.06);
    overflow: hidden;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table thead {
    background: #faf7f3;
    border-bottom: 1px solid #ece5dd;
}

.admin-table th {
    text-align: left;
    font-size: 0.75rem;
    font-weight: 700;
    color: #6b6460;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 13px 16px;
    white-space: nowrap;
}

.admin-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #f2ede8;
    vertical-align: middle;
    font-size: 0.92rem;
}

.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table tbody tr:hover { background: #fdfaf7; }

.customer-name {
    font-weight: 600;
    color: #1a1512;
    line-height: 1.3;
}

.customer-sub {
    color: #8a837d;
    font-size: 0.82rem;
    margin-top: 2px;
    line-height: 1.3;
}

.message-cell {
    max-width: 260px;
    color: #4a4440;
}

.date-cell {
    white-space: nowrap;
    color: #4a4440;
}

.price-cell {
    font-weight: 600;
    color: #1a1512;
}

/* status badges */

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
}

.badge-new      { background: #f0e6d6; color: #6b4f2a; }
.badge-progress { background: #e6eef9; color: #2e5a96; }
.badge-resolved { background: #e2f3e8; color: #276640; }

/* inventory */

.product-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.product-thumb {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid #ece5dd;
}

.product-thumb-placeholder {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    background: #f0ece7;
    border: 1px solid #ece5dd;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.1rem;
    color: #b0a098;
}

.category-tag {
    display: inline-block;
    background: #f0e8dc;
    color: #6b4f2a;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 6px;
}

.stock-tag {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 999px;
}

.stock-ok   { background: #e2f3e8; color: #276640; }
.stock-low  { background: #fef3e2; color: #a06020; }
.stock-zero { background: #fde8e8; color: #b84040; }

.actions-col { width: 130px; }

.inv-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* buttons */

.status-form {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 6px;
}

.status-select {
    flex: 1;
    padding: 7px 10px;
    border: 1px solid #d8d0c8;
    border-radius: 7px;
    background: #fff;
    font-size: 0.84rem;
    height: 34px;
    box-sizing: border-box;
}

.btn-primary,
.btn-save,
.btn-ghost,
.btn-edit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s;
    white-space: nowrap;
}

.btn-primary {
    background: #1a1512;
    color: #fff;
    padding: 10px 20px;
    font-size: 0.9rem;
    height: 42px;
}

.btn-save {
    background: #1a1512;
    color: #fff;
    padding: 0 12px;
    font-size: 0.83rem;
    height: 34px;
    flex-shrink: 0;
}

.btn-ghost {
    background: #ede8e2;
    color: #3a3028;
    padding: 10px 18px;
    font-size: 0.9rem;
    height: 42px;
}

.btn-edit {
    background: #eee8e0;
    color: #3a3028;
    padding: 6px 14px;
    font-size: 0.82rem;
}

.btn-primary:hover,
.btn-save:hover,
.btn-ghost:hover,
.btn-edit:hover {
    opacity: 0.82;
}

.btn-delete-link {
    display: inline-block;
    font-size: 0.82rem;
    color: #b04040;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
}

.btn-delete-link:hover {
    text-decoration: underline;
    color: #8a2828;
}

/* product forms */

.form-card {
    background: #fff;
    border-radius: 14px;
    padding: 30px 32px;
    max-width: 760px;
    box-shadow: 0 2px 12px rgba(26, 21, 18, 0.06);
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 0.84rem;
    font-weight: 700;
    color: #4a4440;
    margin-bottom: 6px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 13px;
    border: 1px solid #d8d0c8;
    border-radius: 8px;
    background: #fff;
    font-size: 0.92rem;
    box-sizing: border-box;
    margin: 0;
}

.form-group textarea {
    min-height: 90px;
    resize: vertical;
}

.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-row-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 2fr;
    gap: 16px;
}

.form-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #f0ece7;
}

/* empty states */

.empty-state {
    text-align: center;
    padding: 40px 14px;
    color: #7a726a;
    font-size: 0.93rem;
}

.empty-inventory {
    text-align: center;
    padding: 52px 20px;
    color: #7a726a;
}

.empty-inventory p {
    margin-bottom: 16px;
    font-size: 0.95rem;
}

/* responsive */

@media (max-width: 1100px) {
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .overview-grid { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
    .admin-sidebar {
        width: 64px;
        overflow: hidden;
    }

    .sidebar-brand span,
    .sidebar-link span:not(.sidebar-icon),
    .sidebar-badge,
    .sidebar-logout { display: none; }

    .sidebar-link { justify-content: center; padding: 12px; }
    .admin-content { margin-left: 64px; padding: 24px 20px; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .form-row-2, .form-row-3 { grid-template-columns: 1fr; }

    .dashboard-filters input { min-width: 100%; }
}

/* sidebar section label */
.sidebar-section-label {
    font-size: 0.65rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #4a3f38;
    padding: 16px 12px 6px;
    font-weight: 600;
}

/* bi icon used as sidebar icon */
.sidebar-icon.bi {
    font-size: 1rem;
    width: 18px;
    display: inline-block;
    text-align: center;
}

/* =========================================================
   AUTH PAGES — login / register / forgot password
   ========================================================= */
.auth-page {
    min-height: calc(100vh - 200px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 16px;
}

.auth-box {
    background: #fff;
    border: 1px solid #e8e0d5;
    border-radius: 4px;
    padding: 48px 44px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 4px 32px rgba(100, 70, 40, 0.07);
}

.auth-box-heading {
    text-align: center;
    margin-bottom: 32px;
}

.auth-box-heading h2 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-style: italic;
    font-weight: 300;
    font-size: 2rem;
    color: #2a1f14;
    margin: 0 0 6px;
}

.auth-box-heading p {
    font-size: 0.85rem;
    color: #7a6a5a;
    margin: 0;
    letter-spacing: 0.03em;
}

.auth-footer-text {
    text-align: center;
    font-size: 0.85rem;
    color: #7a6a5a;
    margin: 0;
}

.auth-footer-text a {
    color: #c9a96e;
    text-decoration: none;
    font-weight: 500;
}

.auth-footer-text a:hover {
    text-decoration: underline;
}

.auth-small-link {
    font-size: 0.8rem;
    color: #9a8878;
    text-decoration: none;
}

.auth-small-link:hover {
    color: #c9a96e;
}

/* Unified login page (Pages/login.php) */
.unified-login-page {
    max-width: 500px;
    margin: 0 auto;
    padding: 0 16px 60px;
}

.login-panel {
    background: #fff;
    border: 1px solid #e8e0d5;
    border-radius: 4px;
    padding: 40px 36px;
    box-shadow: 0 4px 24px rgba(100, 70, 40, 0.06);
}

.login-panel-label {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-style: italic;
    font-size: 1.4rem;
    font-weight: 300;
    color: #2a1f14;
    margin: 0 0 24px;
    text-align: center;
}

/* page-heading used above unified login */
.page-heading {
    text-align: center;
    padding: 48px 16px 32px;
}

.page-heading h1 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-style: italic;
    font-weight: 300;
    font-size: 2.4rem;
    color: #2a1f14;
    margin: 0 0 8px;
}

.page-heading p {
    font-size: 0.9rem;
    color: #7a6a5a;
    margin: 0;
    letter-spacing: 0.04em;
}
