/* ===== THEME: Bharatgas / Bharat Petroleum – logo color scheme ===== */
/* base.html css */
:root {
    /* Primary palette – deep blue (logo blue) */
    --color-primary: #003366;
    --color-primary-dark: #002244;
    --color-primary-darker: #001a33;
    --color-primary-light: #004080;
    /* Accent – bright yellow & red-orange from logo */
    --color-accent-yellow: #FFD700;
    --color-accent-orange: #E85D04;
    /* Sidebar & surfaces – deep blue */
    --color-sidebar: #003366;
    --color-sidebar-active: #004080;
    /* Text */
    --color-text: #1e293b;
    --color-text-muted: #475569;
    --color-text-light: #64748b;
    /* Borders & backgrounds – light warm tint */
    --color-border: #e2e8f0;
    --color-bg-subtle: #FFFDE7;
    --color-bg-card: #ffffff;
    /* Semantic */
    --color-success-bg: #dcfce7;
    --color-success-text: #166534;
    --color-success-border: #bbf7d0;
    --color-error-bg: #ffede8;
    --color-error-text: #c2410c;
    --color-error-border: #ffc4b2;
    /* Focus ring – primary blue */
    --color-focus-ring: rgba(0, 51, 102, 0.25);
}

/* ===== RESET & BASE STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--color-text);
    overflow-x: hidden;
}

/* ===== LOGIN PAGE STYLES ===== */
.login-body {
    background: linear-gradient(180deg, var(--color-primary) 0%, var(--color-primary-darker) 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    position: relative;
}

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

.login-card {
    background: var(--color-bg-card);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    width: 100%;
}

/* Logo Section */
.logo-section {
    text-align: center;
    margin-bottom: 30px;
}

.logo-image {
    max-width: 100%;
    height: auto;
    max-height: 130px;
    object-fit: contain;
}

.bharatgas-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.logo-main {
    background: #FFD700;
    padding: 15px 25px;
    border-radius: 8px;
    position: relative;
}

.logo-text {
    font-size: 28px;
    font-weight: bold;
    color: #003366;
    display: block;
}

.logo-slogan {
    background: #003366;
    color: #ffffff;
    font-size: 10px;
    padding: 4px 8px;
    border-radius: 4px;
    margin-top: 5px;
    text-align: center;
    font-weight: 500;
}

.bp-logo-small {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bp-circle {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, #003366 0%, #FFD700 100%);
    border: 3px solid #003366;
    position: relative;
}

.bp-circle::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    background: #FFD700;
    border-radius: 50%;
}

/* Title Section */
.title-section {
    text-align: center;
    margin-bottom: 25px;
}

.page-title {
    font-size: 28px;
    font-weight: bold;
    color: var(--color-text);
    margin-bottom: 8px;
}

.page-subtitle {
    font-size: 14px;
    color: var(--color-text-muted);
}

/* Alert Messages */
.alert {
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}

.alert-success {
    background: var(--color-success-bg);
    color: var(--color-success-text);
    border: 1px solid var(--color-success-border);
}

.alert-error {
    background: var(--color-error-bg);
    color: var(--color-error-text);
    border: 1px solid var(--color-error-border);
}

.close-alert {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: 16px;
    padding: 0;
    margin-left: 10px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.close-alert:hover {
    opacity: 1;
}

/* Form Styles */
.login-form {
    margin-top: 20px;
}

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

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

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 15px;
    color: var(--color-text-light);
    font-size: 16px;
    z-index: 1;
}

.form-group input {
    width: 100%;
    padding: 12px 15px 12px 45px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s, box-shadow 0.3s;
    background: var(--color-bg-card);
}

.form-group input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-focus-ring);
}

.form-group input::placeholder {
    color: var(--color-text-light);
}

/* Sign In Button */
.signin-btn {
    width: 100%;
    background: var(--color-primary);
    color: #ffffff;
    border: none;
    padding: 14px 20px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: background 0.3s, transform 0.1s;
    margin-top: 10px;
}

.signin-btn:hover {
    background: var(--color-primary-dark);
    transform: translateY(-1px);
}

.signin-btn:active {
    transform: translateY(0);
}

.signin-btn i {
    font-size: 14px;
}

/* Footer */
.login-footer {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
}

/* ===== DASHBOARD PAGE STYLES ===== */
.dashboard-body {
    display: flex;
    min-height: 100vh;
    background: var(--color-bg-subtle);
}

/* Sidebar Styles */
.sidebar {
    width: 230px;
    background: var(--color-sidebar);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar-header {
    background: var(--color-sidebar);
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.logo-image-sidebar {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Small logo that appears when sidebar is collapsed */
.logo-image-sidebar-collapsed {
    display: none;
    width: 44px;
    height: 44px;
    object-fit: contain;
    border-radius: 50%;
    background: var(--color-bg-card);
    padding: 4px;
    margin-left: 10px;
}

.bharatgas-logo-sidebar {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-main-sidebar {
    background: #FFD700;
    padding: 10px 15px;
    border-radius: 6px;
    position: relative;
}

.logo-text-sidebar {
    font-size: 20px;
    font-weight: bold;
    color: #003366;
    display: block;
}

.logo-slogan-sidebar {
    background: #003366;
    color: #ffffff;
    font-size: 8px;
    padding: 3px 6px;
    border-radius: 3px;
    margin-top: 3px;
    text-align: center;
    font-weight: 500;
}

.bp-logo-small-sidebar {
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bp-circle-sidebar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #003366 0%, #FFD700 100%);
    border: 2px solid #003366;
    position: relative;
}

.bp-circle-sidebar::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 15px;
    height: 15px;
    background: #FFD700;
    border-radius: 50%;
}

/* Desktop arrow toggle (hidden on mobile) */
.sidebar-toggle {
    background: transparent;
    color: #ffffff;
    border: none;
    width: 48px;
    height: 48px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    font-weight: 800;
    transition: opacity 0.2s;
}

.sidebar-toggle:hover {
    opacity: 0.8;
}

/* Hamburger menu (visible only on mobile) */
.hamburger-menu {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 10;
}

.hamburger-menu span {
    width: 30px;
    height: 3px;
    background: #ffffff;
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
}

/* Sidebar Menu */
.sidebar-menu {
    flex: 1;
    padding: 20px 0;
    display: flex;
    flex-direction: column;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 14px 22px;
    color: #ffffff;
    text-decoration: none;
    transition: background 0.3s;
    margin: 4px 0;
    border-radius: 0;
}

.menu-item:hover {
    background: rgba(255, 255, 255, 0.12);
}

.menu-item.active {
    background: var(--color-sidebar-active);
}

.menu-icon {
    font-size: 18px;
    width: 25px;
    margin-right: 15px;
    text-align: center;
}

.menu-text {
    font-size: 15px;
    font-weight: 600;
}

/* ===== COLLAPSED SIDEBAR STATE (Desktop) ===== */

/* When body has sidebar-collapsed, shrink sidebar and hide text */
.dashboard-body.sidebar-collapsed .sidebar {
    width: 82px;
}

.dashboard-body.sidebar-collapsed .main-content {
    margin-left: 82px;
}

/* Hide big logo and show small logo in collapsed mode */
.dashboard-body.sidebar-collapsed .logo-image-sidebar {
    display: none;
}

.dashboard-body.sidebar-collapsed .logo-image-sidebar-collapsed {
    display: block;
}

.dashboard-body.sidebar-collapsed .sidebar-header {
    background: var(--color-sidebar);
    height: 72px;
    padding: 0 6px 0 6px;
}

/* Center icons and hide menu labels when collapsed */
.dashboard-body.sidebar-collapsed .menu-item {
    justify-content: center;
    padding: 10px 0;
    margin: 2px auto;
    width: 56px;
    border-radius: 12px;
}

/* Reduce top spacing between logo and first icon when collapsed */
.dashboard-body.sidebar-collapsed .sidebar-menu {
    padding-top: 10px;
}

.dashboard-body.sidebar-collapsed .menu-icon {
    margin-right: 0;
}

.dashboard-body.sidebar-collapsed .menu-text {
    display: none;
}

/* Slightly smaller toggle button in collapsed mode */
.dashboard-body.sidebar-collapsed .sidebar-toggle {
    width: 36px;
    height: 36px;
    font-size: 26px;
    color: #ffffff;
}

/* Main Content */
.main-content {
    margin-left: 230px;
    flex: 1;
    padding: 30px;
    min-height: 100vh;
    min-width: 0;
    overflow-x: hidden;
    transition: margin-left 0.3s ease;
}

/* Sidebar Zyneto block – text above, logo below (after menu) */
.sidebar-zyneto {
    padding: 16px 20px 20px;
    margin-top: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.sidebar-zyneto-text {
    display: block;
    font-size: clamp(0.7rem, 1.5vh, 0.85rem);
    color: rgba(255, 255, 255, 0.85);
    font-weight: 500;
    line-height: 1.3;
    margin-bottom: 8px;
}

.sidebar-zyneto-logo {
    height: clamp(1.5rem, 4vh, 2.25rem);
    width: auto;
    object-fit: contain;
    display: block;
}

/* Collapsed sidebar: hide text, show only logo */
.dashboard-body.sidebar-collapsed .sidebar-zyneto-text {
    display: none;
}

.dashboard-body.sidebar-collapsed .sidebar-zyneto {
    padding: 10px 6px 12px;
    align-items: center;
}

/* Ensure Zyneto logo fully visible in collapsed sidebar */
.dashboard-body.sidebar-collapsed .sidebar-zyneto-logo {
    height: 1.5rem;
    max-width: 100%;
}

.content-wrapper {
    background: var(--color-bg-card);
    padding: 24px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.08);
}

.content-wrapper h1 {
    color: var(--color-text);
    margin-bottom: 15px;
}

.content-wrapper p {
    color: var(--color-text-muted);
    font-size: 16px;
}

/* Safety Messages header + button */
.safety-header {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-bottom: 20px;
}

.btn-add-safety {
    display: inline-block;
    padding: 10px 18px;
    background-color: var(--color-primary);
    color: #ffffff;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    font-size: 14px;
}

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

/* Modal styles */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-overlay.modal-hidden {
    display: none;
}

.modal-dialog {
    background: var(--color-bg-subtle);
    border-radius: 12px;
    padding: 22px 24px 20px 24px;
    width: 100%;
    max-width: 520px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.35);
    border: 1px solid var(--color-border);
    margin: 20px;
}

.modal-dialog h2 {
    margin: -4px -4px 18px -4px;
    padding-bottom: 10px;
    font-size: 20px;
    font-weight: 600;
    color: var(--color-text);
    border-bottom: 1px solid var(--color-border);
}

.modal-dialog textarea {
    width: 100%;
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid var(--color-border);
    resize: vertical;
    min-height: 80px;
}

.modal-dialog textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-focus-ring);
}

.modal-dialog input[type="file"] {
    width: 100%;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 10px;
}

.btn-primary,
.btn-secondary {
    padding: 8px 16px;
    border-radius: 6px;
    border: none;
    font-size: 14px;
    cursor: pointer;
}

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

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

.btn-secondary {
    background-color: var(--color-border);
    color: var(--color-text);
}

.btn-secondary:hover {
    background-color: #e8e8d0;
}

/* All table cells: align content to top left */
.data-table th,
.data-table td {
    vertical-align: top;
    text-align: left;
}

/* Date columns in data tables - keep date on one line */
.data-table .date-cell {
    white-space: nowrap;
    min-width: 105px;
}

/* ===== RESPONSIVE BREAKPOINTS ===== */

/* ===== TABLET (768px - 1024px) ===== */
@media (min-width: 769px) and (max-width: 1024px) {
    .main-content {
        padding: 20px;
    }
    
    .content-wrapper {
        padding: 20px;
    }
    
    .content-wrapper h1 {
        font-size: 1.5rem;
    }
}

/* ===== MOBILE (max-width: 768px) ===== */
@media (max-width: 768px) {
    /* Hide desktop arrow toggle, show hamburger */
    .sidebar-toggle {
        display: none;
    }
    
    .hamburger-menu {
        display: flex;
        margin-right: 12px;
    }
    
    /* Sidebar off-canvas by default on mobile */
    .sidebar {
        transform: translateX(-100%);
        width: 260px;
    }
    
    /* When sidebar is open on mobile */
    .sidebar.open {
        transform: translateX(0);
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
    }
    
    /* Hamburger animation when sidebar is open */
    .sidebar.open ~ * .hamburger-menu span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .sidebar.open ~ * .hamburger-menu span:nth-child(2) {
        opacity: 0;
    }
    
    .sidebar.open ~ * .hamburger-menu span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }
    
    /* Main content takes full width on mobile */
    .main-content {
        margin-left: 0;
        padding: 15px;
        width: 100%;
    }
    
    /* Remove collapsed state behavior on mobile */
    .dashboard-body.sidebar-collapsed .sidebar {
        transform: translateX(-100%);
        width: 260px;
    }
    
    .dashboard-body.sidebar-collapsed .main-content {
        margin-left: 0;
    }
    
    /* Login page mobile adjustments */
    .login-card {
        padding: 30px 20px;
        border-radius: 12px;
    }
    
    .page-title {
        font-size: 24px;
    }
    
    .logo-text {
        font-size: 24px;
    }
    
    /* Content wrapper mobile */
    .content-wrapper {
        padding: 16px;
        border-radius: 8px;
    }
    
    .content-wrapper h1 {
        font-size: 1.4rem;
    }
    
    .content-wrapper p {
        font-size: 14px;
    }
    
    /* Modal adjustments for mobile */
    .modal-dialog {
        margin: 10px;
        padding: 18px;
        max-width: 95%;
    }
    
    .modal-dialog h2 {
        font-size: 18px;
    }
    
    /* Make hamburger menu fixed for mobile menu toggle */
    .mobile-menu-toggle {
        position: fixed;
        top: 20px;
        left: 20px;
        z-index: 1001;
        background: var(--color-primary);
        padding: 10px;
        border-radius: 8px;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    }
}

/* ===== LARGE SCREENS (1920px+) - Full HD and beyond ===== */
@media (min-width: 1920px) {
    .main-content {
        max-width: 1800px;
        margin-left: auto;
        margin-right: auto;
        padding: 40px;
    }
    
    .dashboard-body:not(.sidebar-collapsed) .main-content {
        margin-left: 280px;
        margin-right: auto;
    }
    
    .content-wrapper {
        padding: 32px;
    }
    
    .content-wrapper h1 {
        font-size: 2rem;
    }
    
    .content-wrapper p {
        font-size: 18px;
    }
    
    .sidebar {
        width: 280px;
    }
    
    .sidebar-header {
        height: 80px;
    }
    
    .menu-item {
        padding: 16px 24px;
        font-size: 16px;
    }
    
    .menu-icon {
        font-size: 20px;
        width: 28px;
    }
}

/* ===== 4K SCREENS (2560px+) ===== */
@media (min-width: 2560px) {
    :root {
        font-size: 18px;
    }
    
    .main-content {
        max-width: 2400px;
        padding: 50px;
    }
    
    .content-wrapper {
        padding: 40px;
    }
    
    .content-wrapper h1 {
        font-size: 2.5rem;
    }
    
    .content-wrapper p {
        font-size: 20px;
    }
    
    .sidebar {
        width: 320px;
    }
    
    .sidebar-header {
        height: 90px;
    }
    
    .menu-item {
        padding: 18px 28px;
        font-size: 18px;
    }
    
    .menu-icon {
        font-size: 22px;
        width: 30px;
    }
    
    .login-card {
        max-width: 550px;
        padding: 50px;
    }
    
    .page-title {
        font-size: 34px;
    }
    
    .modal-dialog {
        max-width: 650px;
        padding: 35px;
    }
}

/* ===== 8K SCREENS (3840px+) and ULTRA LARGE DISPLAYS ===== */
@media (min-width: 3840px) {
    :root {
        font-size: 24px;
    }
    
    .main-content {
        max-width: 3400px;
        padding: 70px;
    }
    
    .content-wrapper {
        padding: 50px;
    }
    
    .content-wrapper h1 {
        font-size: 3rem;
    }
    
    .content-wrapper p {
        font-size: 24px;
    }
    
    .sidebar {
        width: 400px;
    }
    
    .sidebar-header {
        height: 110px;
    }
    
    .menu-item {
        padding: 22px 32px;
        font-size: 22px;
    }
    
    .menu-icon {
        font-size: 26px;
        width: 35px;
    }
    
    .login-card {
        max-width: 700px;
        padding: 70px;
    }
    
    .page-title {
        font-size: 42px;
    }
    
    .modal-dialog {
        max-width: 800px;
        padding: 45px;
    }
    
    /* Increase button sizes for large displays */
    .btn-add-safety,
    .btn-primary,
    .btn-secondary {
        padding: 14px 24px;
        font-size: 18px;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    .sidebar,
    .sidebar-toggle,
    .hamburger-menu,
    .btn-add-safety,
    .action-btns {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0;
        padding: 0;
    }
}