/* ===== THEME: Bharatgas / Bharat Petroleum – logo color scheme ===== */
: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;
}

.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%;
}

.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; /* larger, bolder arrow */
    font-weight: 800;
    transition: opacity 0.2s;
}

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

/* 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 ===== */

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

.dashboard-body.sidebar-collapsed .main-content {
    margin-left: 122px; /* keep content aligned with new width */
}

/* 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; /* keep arrow prominent when collapsed */
    color: #ffffff; /* white arrow on teal background */
}

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

.content-wrapper {
    background: var(--color-bg-card);
    padding: 24px 24px 18px 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);
}

.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 Design */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .login-card {
        padding: 30px 20px;
    }
}
