/* === css/erp-tally.css - REVISED MODERN THEME === */
/* Matches styles from inventory.css, invoice.css, and purchase.css */

/* -------------------------
   1. ROOT VARIABLES (Unified Palette)
   ------------------------- */
:root {
    --color-primary: #007bff;
    --color-primary-dark: #0056b3;
    --color-danger: #dc3545;
    --color-danger-dark: #a71d2a;
    --color-bg-light: #f8f9fa;
    --color-bg-dark: #e9ecef;
    --color-border: #ced4da;
    --color-text-dark: #212529;
    --color-text-light: #495057;
    --color-text-white: #ffffff;
    --font-family-sans: Arial, sans-serif;
    --shadow-light: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-card: 0 4px 15px rgba(0,0,0,0.05);
}

/* -------------------------
   2. GLOBAL RESET
   ------------------------- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    font-family: var(--font-family-sans);
    background-color: var(--color-bg-dark);
    color: var(--color-text-dark);
    font-size: 13px; /* Standardized font size */
    line-height: 1.4;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* -------------------------
   3. MAIN LAYOUT CONTAINER
   ------------------------- */
.erp-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* -------------------------
   4. HEADER (Inverted Style)
   ------------------------- */
.erp-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 15px;
    background-color: var(--color-text-white);
    border-bottom: 2px solid var(--color-primary);
    box-shadow: var(--shadow-light);
    flex-shrink: 0;
    z-index: 100;
}

.erp-header .header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.erp-header .header-logo {
    height: 28px;
    /* Removed filter: invert(1) to allow natural logo colors on white bg */
}

.erp-header h1 {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--color-primary);
}

.erp-header .header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.erp-header .user-welcome {
    font-size: 0.85rem;
    color: var(--color-text-light);
    font-weight: normal;
}

/* Logout Button - Standard Action Button Style */
.erp-header .header-logout-btn {
    background-color: var(--color-bg-light);
    color: var(--color-text-dark);
    border: 1px solid var(--color-border);
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 400;
    transition: background-color 0.2s, border-color 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.erp-header .header-logout-btn:hover {
    background-color: var(--color-bg-dark);
    border-color: #adb5bd;
}

/* -------------------------
   5. MAIN CONTENT AREA
   ------------------------- */
.erp-main {
    display: flex;
    flex-grow: 1;
    background-color: var(--color-bg-dark);
    overflow: hidden; /* Prevent double scrollbars */
}

/* -------------------------
   6. LEFT STATUS PANEL (Sidebar Card)
   ------------------------- */
.erp-status-panel {
    flex-basis: 300px;
    flex-shrink: 0;
    background-color: var(--color-text-white);
    border-right: 1px solid var(--color-border);
    padding: 20px;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-light);
    z-index: 10;
}

.erp-status-panel .panel-section {
    margin-bottom: 20px;
}

.erp-status-panel h3 {
    font-size: 1rem;
    font-weight: bold;
    color: var(--color-primary);
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 8px;
    margin-bottom: 15px;
    text-transform: none; /* Removed uppercase enforcement */
}

.erp-status-panel .status-list li {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    margin-bottom: 12px;
    padding-bottom: 4px;
    border-bottom: 1px dashed var(--color-bg-dark);
}

.erp-status-panel .status-list li:last-child {
    border-bottom: none;
}

.erp-status-panel .status-list li span {
    color: var(--color-text-light);
    font-weight: 500;
}

.erp-status-panel .status-list li strong {
    font-weight: bold;
    color: var(--color-text-dark);
}

/* -------------------------
   7. GATEWAY PANEL (Center Stage)
   ------------------------- */
.erp-gateway-panel {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--color-bg-dark);
    padding: 20px;
}

/* -------------------------
   8. GATEWAY MENU BOX (Modern Modal Style)
   ------------------------- */
.gateway-box {
    width: 340px;
    background-color: var(--color-text-white);
    border-radius: 4px; /* Soft corners */
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.gateway-header {
    background-color: var(--color-bg-light); /* Light Grey header */
    color: var(--color-primary); /* Blue text */
    padding: 12px 15px;
    font-weight: bold;
    font-size: 1.1rem;
    text-align: center;
    border-bottom: 1px solid var(--color-border);
}

.gateway-body {
    padding: 10px 0 20px 0;
    flex-grow: 1;
}

.menu-section-title {
    font-size: 0.75rem;
    text-align: center;
    color: var(--color-text-light);
    font-weight: bold;
    margin-top: 15px;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.gateway-list {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: center;
}

.gateway-list li {
    margin-bottom: 1px;
}

.gateway-list li a.menu-item {
    display: block;
    padding: 2px 20px;
    color: var(--color-text-dark);
    font-size: 0.95rem;
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

/* Hover Effect - Clean & Modern */
.gateway-list li a.menu-item:hover,
.gateway-list li a.menu-item:focus,
.gateway-list li a.menu-item.active {
    background-color: #f1f6ff; /* Very light blue tint */
    color: var(--color-primary);
    border-left-color: var(--color-primary);
    font-weight: 500;
    outline: none;
}

/* Hotkey Highlight - Red for contrast */
.gateway-list li a.menu-item span {
    color: var(--color-danger);
    font-weight: bold;
    text-decoration: underline;
}

/* Master Control Warning */
#masterControlLink {
    color: var(--color-text-light); /* Default styling */
}
#masterControlLink:hover {
    color: var(--color-danger);
    background-color: #fff5f5;
    border-left-color: var(--color-danger);
}

/* -------------------------
   9. FOOTER
   ------------------------- */
.erp-footer {
    padding: 10px 15px;
    text-align: center;
    background-color: var(--color-text-white);
    color: var(--color-text-light);
    border-top: 1px solid var(--color-border);
    font-size: 0.8rem;
    flex-shrink: 0;
}

/* -------------------------
   10. MODAL STYLING (Standardized)
   ------------------------- */
.erp-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* Dim backdrop */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(2px);
}

.erp-modal-box {
    width: 380px;
    background-color: var(--color-text-white);
    border-radius: 4px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    animation: modalFadeIn 0.2s ease-out;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-header {
    background-color: var(--color-bg-light);
    color: var(--color-primary);
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--color-border);
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: bold;
}

.close-icon {
    background: none;
    border: none;
    color: var(--color-text-light);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}

.close-icon:hover {
    color: var(--color-danger);
}

.modal-body {
    padding: 20px;
}

#modalReportName {
    font-weight: bold;
    text-align: center;
    margin-bottom: 20px;
    color: var(--color-primary);
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 10px;
    font-size: 1rem;
}

.erp-input-group {
    margin-bottom: 15px;
}

.erp-input-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    font-size: 12px;
    color: var(--color-text-light);
}

.erp-input-group input[type="date"] {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--color-border);
    border-radius: 3px;
    font-family: inherit;
    font-size: 13px;
    background-color: #fff;
}

.erp-input-group input[type="date"]:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(0,123,255,0.15);
}

.modal-footer {
    padding: 12px 20px;
    background-color: var(--color-bg-light);
    text-align: right;
    border-top: 1px solid var(--color-border);
    border-bottom-left-radius: 4px;
    border-bottom-right-radius: 4px;
}

.erp-btn {
    background-color: var(--color-primary);
    color: white;
    border: none;
    padding: 8px 16px;
    font-size: 0.9rem;
    cursor: pointer;
    font-weight: bold;
    border-radius: 3px;
    transition: background-color 0.2s;
}

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