/* --- Global Styling --- */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    margin: 0;
    background-color: #f8f9fa;
    color: #333;
    padding-top: 130px; /* Aap k baray logo k liye */
}

h1, h2, h3, h4, h5, h6 {
    color: #2c3e50;
    margin-top: 0;
}
a {
    color: #007bff;
    text-decoration: none;
}

/* --- "CRYSTAL" TOP NAVIGATION BAR --- */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 25px;
    height: 120px; /* Aap k baray logo k liye */
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}
.nav-brand {
    display: flex; 
    align-items: center;
    gap: 10px;
}
.nav-logo {
    height: 100px; /* Aap k baray logo k liye */
    width: auto;
}
.nav-links {
    display: flex;
    align-items: center;
}
.nav-links a {
    color: #333;
    text-decoration: none;
    padding: 10px 15px;
    border-radius: 5px;
    font-weight: 500;
}
.nav-links a:hover, .nav-links a.active {
    background: rgba(0, 0, 0, 0.05);
    color: #0056b3;
}
.nav-user {
    display: flex;
    align-items: center;
    gap: 15px;
    color: #555;
}
.nav-user .logout-btn {
    background: #e74c3c;
    color: white;
    padding: 8px 12px;
    border-radius: 5px;
    font-weight: bold;
}
.nav-user .logout-btn:hover {
    background: #c0392b;
    text-decoration: none;
}

/* --- Main Content Area --- */
.content {
    padding: 25px;
}

/* --- Form Elements (Inputs, Buttons) --- */
input[type="text"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="email"],
select {
    width: 100%;
    padding: 10px;
    box-sizing: border-box;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1rem;
    margin-bottom: 10px;
}
button, .btn {
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: bold;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}
.btn-primary { background: #007bff; color: white; }
.btn-success { background: #28a745; color: white; }
.btn-danger { background: #dc3545; color: white; }
.btn-warning { background: #ffc107; color: #212529; }
.btn-info { background: #17a2b8; color: white; }
.btn-secondary { background: #6c757d; color: white; }

/* --- Card Layout --- */
.card {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    margin-bottom: 20px;
}
.card-header {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

/* --- Table Styling --- */
.table-container {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    overflow-x: auto;
}
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}
th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}
th {
    background: #f9f9f9;
    font-weight: bold;
    color: #333;
}
tbody tr:hover {
    background: #f5f5f5;
}

/* --- Controls Bar --- */
.controls-bar {
    background: #fff;
    border: 1px solid #ddd;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

/* --- Flash Messages --- */
.flash-message {
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 5px;
    font-weight: bold;
}
.flash-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}
.flash-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}
.flash-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

/* --- NAYI LOGIN PAGE STYLING --- */

.login-body {
    /* Naya "Crystal" background */
    background: linear-gradient(120deg, #000000 0%, #f5576c 100%); /* Ek soft gradient */
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    padding-top: 0; /* padding-top ko override karein jo body par laga tha */
    overflow: hidden; /* Scrollbars hatayein */
}

.login-container {
    /* Yeh hai "Crystal" box */
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    
    padding: 30px 40px;
    border-radius: 10px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    
    width: 100%;
    max-width: 400px;
    text-align: center;
    box-sizing: border-box;
}

.login-logo {
    height: 120px; /* Logo ko bara karein */
    width: auto;
    margin-bottom: 20px;
}

.login-container h2 {
    margin-bottom: 25px;
    color: #333;
}

/* Form elements (Global CSS se thora alag) */
.login-container .form-group {
    margin-bottom: 20px;
    text-align: left;
}
.login-container .form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.login-container .login-error {
    margin-top: 15px;
    padding: 10px;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 5px;
    font-weight: bold;
}

/* --- NAYA STYLE: Locked Links k liye --- */
.nav-links a.nav-link-disabled {
    color: #aaa; /* Grey color */
    cursor: not-allowed; /* 🚫 wala cursor */
    background: transparent;
}
.nav-links a.nav-link-disabled:hover {
    color: #dc3545; /* Hover par red */
    background: rgba(220, 53, 69, 0.1); /* Halka red background */
}
/* --- YAHAN TAK NAYA CODE --- */




/* =========================================
   MOBILE RESPONSIVE FIXES (FINAL POLISH)
   ========================================= */
@media screen and (max-width: 768px) {

    /* 1. GLOBAL ADJUSTMENTS */
    body {
        padding-top: 160px; /* Header k liye jagah */
        font-size: 14px;
        overflow-x: hidden;
    }
    .content {
        padding: 10px;
        width: 100%;
        box-sizing: border-box;
    }
    h1, h2 {
        font-size: 1.5rem; /* Headings thori choti */
    }

    /* 2. NAVIGATION BAR */
    .top-nav {
        flex-direction: column;
        height: auto;
        padding: 10px;
        position: fixed;
        width: 100%;
        box-sizing: border-box;
    }
    .nav-brand { margin-bottom: 5px; }
    .nav-logo { height: 40px; }
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 5px;
        width: 100%;
    }
    .nav-links a {
        font-size: 11px;
        padding: 5px 8px;
        border: 1px solid #eee;
        flex-grow: 1;
        text-align: center;
    }
    .nav-user {
        margin-top: 8px;
        font-size: 11px;
        width: 100%;
        justify-content: center;
    }

    /* 3. POS TERMINAL HEADER FIX (Jo overlap ho raha tha) */
    #pos-header > div {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 10px;
    }
    #pos-header h1 {
        font-size: 1.5rem;
        margin-bottom: 5px;
    }
    #pos-header div[style*="display: flex"] {
        width: 100%;
        flex-direction: column; /* Buttons upar neechay */
    }
    #pos-header .btn {
        width: 100%;
        margin-bottom: 5px;
        text-align: center;
    }

    /* 4. POS & DASHBOARD GRIDS */
    #pos-grid, .stats-grid, .quick-actions, .product-grid, .customer-grid, .charts-grid {
        display: flex !important;
        flex-direction: column !important;
        grid-template-columns: 1fr !important;
        height: auto !important;
        gap: 15px;
    }
    
    /* 5. REPORTS PAGE CONTROLS FIX */
    .controls-bar form {
        flex-direction: column;
        align-items: stretch !important;
        width: 100%;
    }
    .controls-bar input, .controls-bar select, .controls-bar button, .controls-bar a {
        width: 100%;
        margin-bottom: 8px;
        margin-left: 0 !important; /* Margin hatayein */
    }
    
    /* 6. RETURNS PAGE GRID FIX (Side-by-side hataya) */
    #returns-grid {
        display: flex !important;
        flex-direction: column !important;
    }
    #original-receipt-card, #process-return-card {
        width: 100% !important;
    }

    /* 7. TABLES & SCROLLING */
    .table-container, #cart-table-wrapper {
        overflow-x: auto;
        display: block;
        width: 100%;
    }
    table {
        min-width: 600px; /* Table shrink nahi ho ga, scroll aye ga */
    }

    /* 8. GENERAL BUTTONS & INPUTS */
    .card {
        padding: 10px;
    }
    input[type="text"], input[type="number"], input[type="date"], select {
        font-size: 16px; /* Mobile par zoom in na ho */
    }
    .btn {
        padding: 10px;
        font-size: 14px;
    }
}