/* /srv/http/SGG/style.css */

:root {
    --primary-color: #2e7d32;
    --primary-light: #60ad5e;
    --primary-dark: #005005;
    --secondary-color: #fbc02d;
    --text-main: #333333;
    --text-muted: #666666;
    --bg-color: #e8ebf0; /* Darkened from #f5f7fa */
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.6);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    --error-color: #d32f2f;
    --error-bg: #ffebee;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-main);
    line-height: 1.6;
    background-color: var(--bg-color);
    background-image: 
        linear-gradient(rgba(0, 0, 0, 0.03), rgba(0, 0, 0, 0.03)),
        url('https://www.transparenttextures.com/patterns/cubes.png');
    background-blend-mode: multiply;
    
    /* Flex layout to push footer to bottom */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Ensure main content pushes the footer down when short */
.container-main {
    flex: 1 0 auto;
}

.login-container {
    width: 100%;
    max-width: 450px;
    padding: 20px;
    margin: auto;
}

.login-glass {
    background: #ffffff;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.login-glass:hover {
    transform: translateY(-5px);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 10px;
}

.login-header p {
    font-size: 14px;
    color: var(--text-muted);
}

.error-message {
    background-color: var(--error-bg);
    color: var(--error-color);
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 20px;
    text-align: center;
    border-left: 4px solid var(--error-color);
    animation: fadeIn 0.3s ease;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-main);
}

.input-group input {
    width: 100%;
    padding: 12px 15px;
    font-size: 16px;
    border: 1px solid #ddd;
    border-radius: 10px;
    background-color: #fafafa;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.2);
}

.btn-primary {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
    color: white;
    background-color: var(--primary-color);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.1s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 14px 0 rgba(46, 125, 50, 0.39);
}

.btn-primary:hover {
    background-color: var(--primary-light);
    box-shadow: 0 6px 20px rgba(46, 125, 50, 0.23);
}

.btn-primary:active {
    transform: scale(0.98);
}

.login-footer {
    margin-top: 30px;
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
}

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

/* Responsive */
@media (max-width: 480px) {
    .login-glass {
        padding: 30px 20px;
    }
}

/* Navbar Styles */
.navbar {
    background-color: var(--primary-dark);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    height: 60px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.navbar-brand {
    color: white;
    font-size: 20px;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: 0.5px;
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    height: 100%;
}

.nav-item {
    position: relative;
    height: 100%;
}

.nav-link {
    display: flex;
    align-items: center;
    color: white;
    text-decoration: none;
    padding: 0 20px;
    height: 100%;
    font-weight: 500;
    transition: background-color 0.3s;
}

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

.dropdown-menu {
    display: none;
    position: absolute;
    top: 60px;
    right: 0;
    background-color: white;
    min-width: 200px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    border-radius: 0 0 8px 8px;
    z-index: 1000;
    /* overflow: hidden; -- Removed to allow submenus to be visible */
}

.nav-item:hover > .dropdown-menu {
    display: block;
    animation: fadeIn 0.2s ease;
}

.dropdown-item {
    color: var(--text-main);
    padding: 12px 20px;
    text-decoration: none;
    display: block;
    font-size: 14px;
    transition: background-color 0.2s;
}

.dropdown-item:hover {
    background-color: var(--bg-color);
    color: var(--primary-dark);
}

.dropdown-divider {
    height: 1px;
    background-color: #eee;
    margin: 4px 0;
}

/* Submenu Styles */
.dropdown-submenu {
    position: relative;
}

.dropdown-submenu > .dropdown-menu {
    top: 0;
    right: 100%; /* Open to the left of the parent */
    left: auto;
    margin-top: 0;
    border-radius: 8px 0 8px 8px;
    background-color: white;
    box-shadow: -5px 0 15px rgba(0,0,0,0.1); /* Shadow to the left */
    display: none;
    min-width: 200px;
}

.dropdown-submenu:hover > .dropdown-menu {
    display: block;
}

.dropdown-submenu > a::after {
    content: " ◂";
    float: left;
    margin-right: 10px;
    font-size: 10px;
    line-height: 18px;
}


.container-main {
    width: 100%;
    max-width: 1200px;
    margin: 40px auto;
    padding: 20px;
    background: #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

/* Unified Small Action Buttons */
.btn-small {
    padding: 6px 10px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 4px;
    color: white;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 30px;
}

.btn-edit {
    background-color: #ffb74d !important;
}
.btn-edit:hover {
    background-color: #ffa726 !important;
}

.btn-del {
    background-color: #e53935 !important;
}
.btn-del:hover {
    background-color: #d32f2f !important;
}

/* Print Styles */
@media print {
    * {
        color: black !important;
        background-color: transparent !important;
        background-image: none !important;
        box-shadow: none !important;
        text-shadow: none !important;
        border-color: black !important;
    }
    
    body {
        background: white !important;
        font-size: 10pt !important;
    }
    
    .navbar, .footer, .no-print, .btn-primary, .btn-small, .dropdown-menu, a[href*="ganado"] {
        display: none !important;
    }
    
    .container-main {
        margin: 0 !important;
        padding: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
    }
    
    .dashboard-grid {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 5px !important;
    }
    
    .col-card {
        border: 1px solid black !important;
        padding: 5px !important;
        margin-bottom: 0 !important;
        page-break-inside: avoid;
    }

    h2 { font-size: 14pt !important; margin: 10px 0 !important; }
    h3 { font-size: 11pt !important; margin: 5px 0 !important; }

    /* Location name box */
    div[style*='background: var(--primary-light)'], 
    div[style*='background:var(--primary-light)'] {
        background: #f0f0f0 !important; /* Light gray for distinction but still B&W */
        border: 1px solid black !important;
        padding: 4px !important;
        font-size: 10pt !important;
    }

    table {
        margin-bottom: 5px !important;
    }

    table th, table td {
        font-size: 8pt !important;
        padding: 2px 4px !important;
        border-bottom: 1px solid black !important;
    }

    tr[style*='background: #f1f8e9'], 
    tr[style*='background:#f1f8e9'],
    thead tr {
        background: #eee !important;
    }

    /* Total rows */
    tr[style*='background: #e3f2fd'], 
    tr[style*='background:#e3f2fd'] {
        background: #ddd !important;
        font-weight: bold !important;
    }

    /* Summary totals at bottom of columns */
    div[style*='background: var(--primary-color)'],
    div[style*='background:var(--primary-color)'] {
        padding: 5px !important;
        font-size: 9pt !important;
        border: 1px solid black !important;
        margin-top: 5px !important;
    }

    /* Gran Total Box */
    div[style*='background: var(--primary-dark)'],
    div[style*='background:var(--primary-dark)'] {
        background: #ccc !important;
        padding: 10px !important;
        margin-top: 15px !important;
        border: 2px solid black !important;
    }
    
    #gran-total-value {
        font-size: 16pt !important;
    }
}
