:root {
    --primary-color: #7A9139; /* Olive green */
    --primary-hover: #677C2E;
    --bg-light: #F6F7F5;
    --card-bg: #FFFFFF;
    --text-dark: #333333;
    --text-muted: #777777;
    --border-color: #E2E6E0;
    --danger-color: #E74C3C;
    --edit-color: #3498DB;
    --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.05);
    --border-radius: 12px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: var(--font-main);
}

body {
    background-color: #E6EADF;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    color: var(--text-dark);
}

/* Simulated Mobile App Frame */
.admin-frame {
    width: 100%;
    max-width: 480px;
    height: 100vh;
    max-height: 920px;
    background-color: var(--bg-light);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.15);
    border-radius: 24px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
}

@media (max-width: 480px) {
    .admin-frame {
        max-width: 100%;
        height: 100vh;
        max-height: 100%;
        border-radius: 0;
    }
}

/* Header */
.admin-header {
    background-color: var(--primary-color);
    color: #FFFFFF;
    height: 60px;
    padding: 0 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
    flex-shrink: 0;
}

.admin-header .logo {
    font-size: 1.25rem;
    font-weight: 700;
}

.back-btn-link {
    color: #FFFFFF;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: opacity 0.2s;
}

.back-btn-link:hover {
    opacity: 0.85;
}

/* Content Area */
.admin-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    scrollbar-width: none;
}

.admin-content::-webkit-scrollbar {
    display: none;
}

/* Card */
.admin-card {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-color);
}

.section-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #4A4A4A;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

.text-olive {
    color: var(--primary-color);
}

/* Form Styles */
.product-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.form-group label {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    font-size: 0.8rem;
    outline: none;
    background-color: var(--bg-light);
    transition: border-color 0.2s, background-color 0.2s;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    border-color: var(--primary-color);
    background-color: #FFFFFF;
}

.form-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.btn {
    padding: 10px 16px;
    border-radius: 8px;
    border: none;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: opacity 0.2s;
}

.btn:active {
    opacity: 0.9;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-secondary {
    background-color: #ECEFF1;
    color: var(--text-dark);
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

/* Table styling */
.table-container {
    width: 100%;
    overflow-x: auto;
    margin-bottom: 16px;
}

.products-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
}

.products-table th, .products-table td {
    padding: 8px;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
    vertical-align: middle;
}

.products-table th {
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
}

.admin-item-img {
    width: 45px;
    height: 45px;
    border-radius: 6px;
    background-color: var(--bg-light);
    border: 1px solid var(--border-color);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.admin-item-img img, .admin-item-img svg {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

.admin-table-item-name {
    font-weight: 600;
    display: block;
    color: var(--text-dark);
}

.admin-table-item-cat {
    font-size: 0.65rem;
    color: var(--text-muted);
}

.action-btns {
    display: flex;
    gap: 4px;
    justify-content: center;
}

.action-btn {
    border: none;
    border-radius: 4px;
    color: white;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.75rem;
}

.btn-edit {
    background-color: var(--edit-color);
}

.btn-del {
    background-color: var(--danger-color);
}

.db-actions {
    text-align: center;
    padding-top: 8px;
    border-top: 1px dashed var(--border-color);
}

/* Login Screen Styles */
.login-screen-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bg-light);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    z-index: 999;
}

.login-card {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 32px 24px;
    width: 100%;
    max-width: 360px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--border-color);
}

.login-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #E6EADF;
    color: var(--primary-color);
    font-size: 1.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.login-card h2 {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-dark);
}

.login-card p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 24px;
    line-height: 1.4;
}

.login-card .form-group {
    margin-bottom: 16px;
}

.login-card input {
    text-align: center;
    font-size: 0.95rem;
    height: 44px;
}

.btn-login {
    width: 100%;
    height: 44px;
    font-size: 0.85rem;
}

.back-to-shop-login {
    display: block;
    margin-top: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary-color);
    text-decoration: none;
    transition: opacity 0.2s;
}

.back-to-shop-login:hover {
    opacity: 0.8;
}

/* Custom styling for file input */
.file-input-wrapper {
    position: relative;
    width: 100%;
}

.file-input-wrapper input[type="file"] {
    display: none; /* Hide default input */
}

.file-input-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px;
    border-radius: 8px;
    border: 2px dashed var(--primary-color);
    background-color: var(--bg-light);
    color: var(--primary-color);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    text-align: center;
}

.file-input-label:hover {
    background-color: #E6EADF;
}

.file-name-display {
    font-size: 0.75rem;
    color: var(--text-dark);
    margin-top: 4px;
    font-weight: 500;
}
