.entry-content-wrap{
    padding: 0px !important;
    /* padding-top: 0px !important;
    padding-right: 0px !important; */
}
/* ============================================
   ROOT VARIABLES & RESET
   ============================================ */
:root {
    /* Professional Color Palette - Green Theme */
    --primary-color: #10b981;
    --primary-hover: #059669;
    --primary-light: #d1fae5;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #06b6d4;

    /* Neutral Colors */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;

    /* Semantic Colors */
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-tertiary: #9ca3af;
    --border-color: #e5e7eb;
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;

    /* Shadows */
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
}

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

body {
    background: var(--gray-50);
}

/* ============================================
   LAYOUT (SIDEBAR + MAIN)
   ============================================ */
.allotment-layout {
    display: flex;
    min-height: 100vh;
    background: var(--gray-50);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-primary);
}

/* ============================================
   SIDEBAR
   ============================================ */
.allotment-sidebar {
    width: 170px;
    background: white;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1000;
    transition: width 0.3s ease;
}

/* Collapsed Sidebar */
.allotment-sidebar.collapsed {
    width: 60px;
}

.allotment-sidebar.collapsed .sidebar-logo,
.allotment-sidebar.collapsed .nav-text,
.allotment-sidebar.collapsed .sidebar-logout .nav-text {
    opacity: 0;
    visibility: hidden;
    width: 0;
    overflow: hidden;
    white-space: nowrap;
    transition: opacity 0.15s ease, visibility 0s linear 0.15s, width 0s ease;
}

.allotment-sidebar.collapsed .sidebar-nav-link,
.allotment-sidebar.collapsed .sidebar-logout {
    justify-content: center;
    padding: 10px 12px;
}

.allotment-sidebar.collapsed .sidebar-footer {
    gap: 12px;
}

.allotment-sidebar.collapsed .sidebar-header {
    justify-content: center;
}

.sidebar-header {
    padding: 20px 12px;
    border-bottom: 1px solid var(--border-color);
    min-height: 105px;
    align-content: center;
}

.sidebar-logo {
    font-size: 22px;
    font-weight: 700;
    margin: 0;
    color: var(--primary-color);
    letter-spacing: -0.5px;
    transition: opacity 0.2s ease 0.25s, visibility 0s linear 0.25s, width 0.3s ease;
    opacity: 1;
    visibility: visible;
    overflow: hidden;
    white-space: nowrap;
}

.sidebar-nav {
    flex: 1;
    padding: 12px 0;
    overflow-y: auto;
}

.sidebar-nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 13px;
    transition: all 0.2s ease;
    position: relative;
}

.sidebar-nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary-color);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.sidebar-nav-link:hover {
    background: var(--gray-50);
    color: var(--text-primary);
}

.sidebar-nav-link.active {
    color: var(--primary-color);
    background: var(--primary-light);
}

.sidebar-nav-link.active::before {
    opacity: 1;
}

.sidebar-nav-link .nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    transition: none;
}

.sidebar-nav-link .nav-text {
    flex: 1;
    transition: opacity 0.2s ease 0.25s, visibility 0s linear 0.25s, width 0.3s ease;
    opacity: 1;
    visibility: visible;
    overflow: hidden;
    white-space: nowrap;
}

.sidebar-footer {
    padding: 12px;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-toggle-btn {
    width: 100%;
    background: none;
    border: 1px solid var(--border-color);
    padding: 10px 12px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
}

.sidebar-toggle-btn:hover, .sidebar-toggle-btn:active, .sidebar-toggle-btn:focus {
    background: var(--gray-100);
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.sidebar-toggle-btn svg {
    transition: transform 0.3s ease;
}

.allotment-sidebar.collapsed .sidebar-toggle-btn svg {
    transform: rotate(180deg);
}

.sidebar-logout {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 13px;
    transition: all 0.2s ease;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.sidebar-logout:hover {
    background: #fee2e2;
    color: var(--danger-color);
    border-color: var(--danger-color);
}

.sidebar-logout .nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.sidebar-logout .nav-text {
    transition: opacity 0.2s ease 0.25s, visibility 0s linear 0.25s, width 0.3s ease;
    opacity: 1;
    visibility: visible;
    overflow: hidden;
    white-space: nowrap;
}

/* ============================================
   MOBILE HEADER
   ============================================ */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: white;
    border-bottom: 1px solid var(--border-color);
    z-index: 1001;
    padding: 0 16px;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
}

.mobile-header-left {
    display: flex;
    align-items: center;
}

.mobile-logo {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    color: var(--primary-color);
    letter-spacing: -0.5px;
}

.mobile-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mobile-menu-btn {
    width: 44px;
    height: 44px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-primary);
    transition: all 0.2s ease;
    padding: 0;
}

.mobile-menu-btn:hover {
    background: var(--gray-50);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.mobile-menu-btn:active {
    transform: scale(0.95);
}

/* Sidebar Close Button */
.sidebar-close-btn {
    display: none;
    width: 36px;
    height: 36px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    padding: 0;
    border-radius: var(--radius-md);
    align-items: center;
    justify-content: center;
}

.sidebar-close-btn:hover {
    background: var(--gray-100);
    color: var(--text-primary);
}

/* Sidebar Backdrop */
.sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(17, 24, 39, 0.7);
    backdrop-filter: blur(8px);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-backdrop.active {
    display: block;
    opacity: 1;
}

/* Main Content Area */
.allotment-main {
    flex: 1;
    margin-left: 170px;
    padding: var(--space-xl);
    max-width: calc(100% - 170px);
    transition: margin-left 0.3s ease, max-width 0.3s ease;
}

/* Main content adjustment when sidebar collapsed */
.allotment-sidebar.collapsed ~ .allotment-main {
    margin-left: 60px;
    max-width: calc(100% - 60px);
}

/* ============================================
   HEADER
   ============================================ */
.allotment-header {
    margin-bottom: var(--space-xl);
}

.dashboard-title {
    font-size: 28px;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

/* ============================================
   SECTIONS
   ============================================ */
.add-pan-section,
.pans-list-section {
    background: var(--bg-primary);
    padding: var(--space-xl);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    margin-bottom: var(--space-lg);
}

.section-header {
    margin-bottom: var(--space-lg);
}

.section-header h2 {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 var(--space-sm) 0;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.section-header p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}

/* ============================================
   INPUT STYLES
   ============================================ */
.pan-input {
    padding: 14px 16px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 15px;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    text-transform: uppercase;
    transition: all 0.2s ease;
    font-weight: 600;
    color: var(--text-primary);
    background: var(--bg-primary);
}

.pan-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
    background: white;
}

.pan-input::placeholder {
    color: var(--text-tertiary);
    font-weight: 500;
}

/* ============================================
   SEARCH BOX
   ============================================ */
.search-box {
    margin-bottom: var(--space-lg);
}

.search-input {
    width: 100%;
    text-transform: none;
}

.search-input::placeholder {
    text-transform: none;
}

/* ============================================
   UNIFIED CARD SYSTEM
   ============================================ */
/* Base Card Styles - Used by PAN cards and IPO cards */
.pan-card,
.ipo-card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: all 0.2s ease;
    position: relative;
    box-shadow: var(--shadow-xs);
    border: 1px solid var(--border-color);
}

.pan-card:hover,
.ipo-card:hover {
    box-shadow: var(--shadow-sm);
}

/* Grid Layouts - 3 columns responsive */
.pans-grid,
.ipos-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
}

@media (max-width: 1200px) {
    .pans-grid,
    .ipos-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .pans-grid,
    .ipos-grid {
        grid-template-columns: 1fr;
    }
}

/* Add New PAN Card */
.add-pan-card {
    border: 2px dashed var(--border-color);
    background: var(--gray-50);
    display: flex;
    /* align-items: center; */
    justify-content: center;
    /* min-height: 200px; */
    transition: all 0.3s ease;
}

.add-pan-card:hover {
    border-color: var(--primary-color);
    background: white;
    box-shadow: var(--shadow-md);
}

.add-pan-card-content {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.add-pan-title {
    margin: 0 0 var(--space-xs) 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    letter-spacing: -0.3px;
}

.add-pan-form-row {
    display: flex;
    gap: 12px;
    align-items: stretch;
}

.add-pan-input {
    flex: 1;
    font-size: 14px;
    padding: 12px 14px;
}

.add-pan-submit {
    white-space: nowrap;
    flex-shrink: 0;
}

.pan-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-md);
}

.pan-card .pan-number {
    font-size: 18px;
    font-weight: 700;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    color: var(--primary-color);
    letter-spacing: 0.5px;
}

.pan-actions {
    position: relative;
    flex-shrink: 0;
}

.pan-menu-btn {
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
}

.pan-menu-btn:hover {
    background: var(--gray-100);
    color: var(--text-primary);
}

.pan-menu-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    min-width: 120px;
    z-index: 100;
    overflow: hidden;
}

.pan-menu-dropdown.active {
    display: block;
}

.pan-menu-dropdown .menu-item {
    display: block;
    width: 100%;
    padding: 10px 16px;
    background: none;
    border: none;
    text-align: left;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.15s ease;
}

.pan-menu-dropdown .menu-item:hover {
    background: var(--gray-50);
}

.pan-menu-dropdown .menu-item.delete-pan {
    color: var(--danger-color);
}

.pan-menu-dropdown .menu-item.delete-pan:hover {
    background: #fee2e2;
}

.pan-card-body {
    padding-top: var(--space-md);
    margin-top: var(--space-sm);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pan-info {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    font-size: 14px;
    line-height: 1.6;
}

.pan-info-label {
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 100px;
}

.pan-info-value {
    color: var(--text-primary);
    word-break: break-word;
    overflow-wrap: break-word;
    flex: 1;
    font-weight: 500;
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
    text-align: center;
    padding: 80px 20px;
}

.empty-icon {
    font-size: 72px;
    margin-bottom: var(--space-md);
    opacity: 0.3;
    filter: grayscale(100%);
}

.empty-state h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 var(--space-sm) 0;
}

.empty-state p {
    font-size: 15px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}

/* ============================================
   MODAL
   ============================================ */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(17, 24, 39, 0.7);
    backdrop-filter: blur(8px);
    animation: fadeIn 0.2s ease;
}

.modal-container {
    position: relative;
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    width: 90%;
    max-width: 480px;
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    padding: 4px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
}

.modal-close:hover {
    color: var(--text-primary);
    background: var(--gray-100);
}

.modal-body {
    padding: var(--space-lg);
}

.form-group {
    margin-bottom: var(--space-lg);
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: var(--space-sm);
    color: var(--text-primary);
    font-size: 14px;
}

.form-help {
    display: block;
    margin-top: var(--space-sm);
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: var(--space-xl);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        transform: translateY(20px) scale(0.98);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* IPO Details Modal Placeholder */
.ipo-modal-placeholder {
    text-align: center;
    padding: var(--space-xl) var(--space-lg);
}

.ipo-modal-placeholder .placeholder-icon {
    font-size: 64px;
    margin-bottom: var(--space-lg);
    opacity: 0.4;
    filter: grayscale(100%);
}

.ipo-modal-placeholder h4 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 var(--space-sm) 0;
    letter-spacing: -0.3px;
}

.ipo-modal-placeholder p {
    font-size: 15px;
    color: var(--text-secondary);
    margin: 0 0 var(--space-lg) 0;
    line-height: 1.6;
}

.placeholder-info {
    background: var(--gray-50);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    margin-top: var(--space-lg);
}

.placeholder-info p {
    margin: 0;
    font-size: 14px;
    color: var(--text-primary);
    text-align: left;
}

.placeholder-info strong {
    color: var(--text-secondary);
    font-weight: 600;
}

/* ============================================
   UNIFIED BUTTON SYSTEM
   ============================================ */
/* Base Button - Core Styles */
.button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: var(--space-sm) !important;
    padding: 12px 20px !important;
    background: var(--primary-color) !important;
    color: white !important;
    text-decoration: none !important;
    border: 1px solid var(--primary-color) !important;
    border-radius: var(--radius-md) !important;
    cursor: pointer !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    letter-spacing: 0.3px !important;
    text-transform: uppercase !important;
    transition: all 0.2s ease !important;
    box-shadow: var(--shadow-xs) !important;
}

.button:hover {
    background: var(--primary-hover) !important;
    border-color: var(--primary-hover) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3) !important;
}

.button:disabled {
    background: var(--gray-300) !important;
    border-color: var(--gray-300) !important;
    color: var(--gray-500) !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
}

/* Button Variants */
.button-secondary {
    background: #3b82f6 !important;
    border-color: #3b82f6 !important;
    color: white !important;
}

.button-secondary:hover {
    background: #2563eb !important;
    border-color: #2563eb !important;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3) !important;
}

.button-outline {
    background: transparent !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
    font-weight: 600 !important;
    text-transform: none !important;
}

.button-outline:hover {
    background: var(--gray-50) !important;
    border-color: var(--gray-300) !important;
    box-shadow: var(--shadow-sm) !important;
}

.btn-icon {
    font-size: 18px !important;
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
#toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 420px;
}

.toast {
    background: white;
    padding: 16px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--border-color);
    animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    min-width: 320px;
}

.toast.toast-success {
    border-left: 3px solid var(--success-color);
}

.toast.toast-error {
    border-left: 3px solid var(--danger-color);
}

.toast.toast-warning {
    border-left: 3px solid var(--warning-color);
}

.toast.toast-info {
    border-left: 3px solid var(--info-color);
}

.toast-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.toast-content {
    flex: 1;
}

.toast-message {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
    line-height: 1.5;
}

.toast-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: var(--text-tertiary);
    transition: all 0.2s;
    padding: 4px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
}

.toast-close:hover {
    color: var(--text-primary);
    background: var(--gray-100);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.toast.removing {
    animation: slideOutRight 0.2s ease;
}

/* ============================================
   ALLOTMENT RESULTS (Check Status Page)
   ============================================ */
.allotment-results {
    margin-top: 0;
}

.results-header {
    margin-bottom: var(--space-lg);
}

.results-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
    flex-wrap: wrap;
    gap: var(--space-md);
}

.results-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.3px;
}

.allotment-actions {
    display: flex;
    gap: 12px;
}

.results-controls {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.results-controls .search-box {
    margin-bottom: 0;
}

/* Hide filter toggle button on all screen sizes by default */
.mobile-filter-toggle {
    display: none;
}

.sort-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.sort-tab {
    padding: 10px 20px;
    background: white;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.sort-tab:hover {
    background: var(--gray-50);
    border-color: var(--gray-300);
    color: var(--text-secondary);
}

.sort-tab.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

#allotment_progress {
    margin: var(--space-lg) 0;
    padding: var(--space-md);
    background: var(--primary-light);
    border-radius: var(--radius-md);
    border: 1px solid var(--primary-color);
}

#allotment_progress p {
    margin: 0;
    font-weight: 600;
    color: var(--primary-hover);
}

/* ============================================
   STATUS BADGES
   ============================================ */
.status-cell{
    align-self: flex-start;
    font-size: 12px;
}

.status-badge {
    display: inline-block;
    padding: 3px 6px;
    border-radius: var(--radius-sm);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.status-allotted {
    background: var(--success-color);
    color: white;
}

.status-not-allotted {
    background: var(--danger-color);
    color: white;
}

.status-error {
    background: var(--warning-color);
    color: white;
}

.status-checking {
    background: var(--info-color);
    color: white;
}

.status-pending {
    background: var(--gray-300);
    color: var(--text-primary);
}

.status-not-applied {
    background: #6b7280;
    color: white;
}

/* ============================================
   TABLE CONTROLS & CHECKBOXES
   ============================================ */
.table-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
    padding: var(--space-md);
    background: var(--gray-50);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.toggle-icon {
    display: inline-block;
    transition: transform 0.3s ease;
    font-size: 12px;
}

.select-all-container {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    user-select: none;
}

.select-all-container input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--bg-primary);
}

.selected-count {
    font-size: 14px;
    color: var(--text-secondary);
}

.selected-count strong {
    color: var(--primary-color);
    font-weight: 700;
}

/* Checkbox Column */
.checkbox-col {
    width: 50px;
    text-align: center;
}

.checkbox-col input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.header-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

/* ============================================
   ALLOTMENT CARDS GRID
   ============================================ */
.allotment-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
    margin-top: var(--space-lg);
}

.allotment-card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: 20px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-xs);
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
}

.allotment-card:hover {
    box-shadow: var(--shadow-sm);
}

/* Card Header */
.allotment-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--border-color);
}

.card-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.allotment-card .pan-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--bg-primary);
    flex-shrink: 0;
    align-self: flex-start;
}

.pan-info-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.allotment-card .pan-number {
    font-size: 18px;
    font-weight: 700;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    color: var(--primary-color);
    letter-spacing: 0.5px;
    line-height: 1.2;
}

.pan-name {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
    line-height: 1.2;
}

/* Card Body */
.allotment-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: var(--space-md);
    overflow: hidden;
    transition: all 0.3s ease;
}

.allotment-card.collapsed .allotment-card-body {
    max-height: 0;
    margin-bottom: 0;
    padding-bottom: 0;
    opacity: 0;
}

.allotment-card-footer {
    margin-top: auto;
    overflow: hidden;
    transition: all 0.3s ease;
}

.allotment-card.collapsed .allotment-card-footer {
    max-height: 0;
    margin-top: 0;
    opacity: 0;
}

.allotment-card.collapsed .allotment-card-header {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.card-info-row {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    font-size: 14px;
    line-height: 1.5;
}

.card-info-label {
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 110px;
    flex-shrink: 0;
}

.card-info-value {
    color: var(--text-primary);
    font-weight: 500;
    word-break: break-word;
    flex: 1;
}

.shares-value {
    font-weight: 600;
    color: var(--primary-color);
}

.card-info-message {
    margin-top: var(--space-sm);
    padding: var(--space-sm);
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Card Footer */
.allotment-card-footer {
    margin-top: auto;
}

.view-details-btn {
    width: 100%;
    justify-content: center;
}

/* Modal Detail Rows */
.modal-detail-row {
    display: flex;
    padding: var(--space-md) 0;
    border-bottom: 1px solid var(--border-color);
}

.modal-detail-row:last-child {
    border-bottom: none;
}

.modal-detail-label {
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 140px;
    flex-shrink: 0;
    font-size: 14px;
}

.modal-detail-value {
    color: var(--text-primary);
    font-weight: 500;
    font-size: 14px;
    flex: 1;
    word-break: break-word;
}

.modal-pan-mono {
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    font-weight: 600;
}

/* Responsive Grid */
@media (max-width: 1200px) {
    .allotment-cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .allotment-cards-grid {
        grid-template-columns: 1fr;
    }

    .allotment-card {
        padding: var(--space-md);
    }

    .card-info-label {
        min-width: 90px;
        font-size: 13px;
    }

    .card-info-value {
        font-size: 13px;
    }

    .allotment-card .pan-number {
        font-size: 16px;
    }

    .modal-detail-label {
        min-width: 110px;
        font-size: 13px;
    }

    .modal-detail-value {
        font-size: 13px;
    }
}

/* ============================================
   IPO LIST & DETAILS
   ============================================ */
.ipo-details {
    background: var(--gray-50);
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-lg);
    border: 1px solid var(--border-color);
}

.ipo-details h3 {
    margin-top: 0;
    font-size: 18px;
    font-weight: 700;
}

.ipo-details p {
    margin: var(--space-sm) 0;
    line-height: 1.6;
}

.allotment-notice {
    padding: var(--space-md);
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
    border-radius: var(--radius-md);
    margin: var(--space-lg) 0;
    font-size: 14px;
    line-height: 1.6;
}

/* IPO Card Specific Styles */
.ipo-card-content {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.ipo-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.3px;
    line-height: 1.4;
}

.ipo-card-actions {
    display: flex;
    gap: 10px;
}

.ipo-action-btn {
    flex: 1;
}

/* Check Status Page Styles */
.ipo-details-card {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    padding: var(--space-xl);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-lg);
    box-shadow: var(--shadow-md);
}

.ipo-details-title {
    font-size: 24px;
    font-weight: 700;
    color: white;
    margin: 0 0 var(--space-sm) 0;
    letter-spacing: -0.5px;
}

.ipo-details-subtitle {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    line-height: 1.5;
}

.results-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 var(--space-md) 0;
    letter-spacing: -0.3px;
}

/* ============================================
   LOGIN FORM
   ============================================ */
.allotment-login-wrapper {
    max-width: 420px;
    margin: 60px auto;
    padding: var(--space-lg);
}

.allotment-login-form {
    background: white;
    padding: var(--space-xl);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

.allotment-login-form h2 {
    margin-top: 0;
    margin-bottom: var(--space-lg);
    text-align: center;
    font-size: 24px;
    font-weight: 700;
}

.allotment-login-form label {
    display: block;
    margin-bottom: var(--space-sm);
    font-weight: 600;
    font-size: 14px;
}

.allotment-login-form input[type="text"],
.allotment-login-form input[type="password"] {
    width: 100%;
    padding: 12px 16px;
    margin-bottom: var(--space-md);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    box-sizing: border-box;
    font-size: 15px;
    transition: all 0.2s ease;
}

.allotment-login-form input[type="text"]:focus,
.allotment-login-form input[type="password"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.allotment-login-form .login-remember {
    margin-bottom: var(--space-md);
}

.allotment-login-form .login-submit {
    text-align: center;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    /* Show mobile header */
    .mobile-header {
        display: flex;
    }

    /* Sidebar becomes overlay */
    .allotment-sidebar {
        transform: translateX(-100%);
        z-index: 1000;
        box-shadow: none;
    }

    .allotment-sidebar.active {
        transform: translateX(0);
        box-shadow: var(--shadow-xl);
    }

    /* Show close button in sidebar header on mobile */
    .sidebar-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .sidebar-close-btn {
        display: flex;
    }

    /* Main content takes full width */
    .allotment-main {
        margin-left: 0;
        max-width: 100%;
        padding: var(--space-lg);
        padding-top: 76px; /* Header height + spacing */
    }

    /* Sidebar toggle button hidden on mobile (header menu used instead) */
    .sidebar-toggle-btn {
        display: none;
    }

    .dashboard-title {
        font-size: 24px;
    }

    .dashboard-subtitle {
        font-size: 14px;
    }

    /* Hide filters on mobile and tablet */
    .sort-tabs {
        display: none !important;
    }
}

@media (max-width: 768px) {
    /* ===== LAYOUT ===== */
    .allotment-main {
        margin-left: 0;
        max-width: 100%;
        padding: 12px;
        padding-top: 72px;
    }

    .allotment-header {
        padding: 0;
        margin-bottom: 20px;
    }

    .dashboard-title {
        font-size: 20px;
        line-height: 1.3;
        word-break: break-word;
    }

    /* ===== SECTIONS ===== */
    .add-pan-section,
    .pans-list-section {
        padding: 16px;
        border-radius: 12px;
    }

    .section-header h2 {
        font-size: 18px;
    }

    .section-header p {
        font-size: 13px;
    }

    /* ===== GRIDS ===== */
    .pans-grid,
    .ipos-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .add-pan-form {
        flex-direction: column;
    }

    /* ===== CHECK STATUS PAGE ===== */
    .results-header-top {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .results-title {
        font-size: 16px;
        width: 100%;
    }

    /* Action buttons - Full width stacked */
    .allotment-actions {
        align-self: center;
    }

    .allotment-actions .button {
        width: 100% !important;
        min-height: 44px !important;
        font-size: 12px !important;
        padding: 12px 16px !important;
        white-space: nowrap;
    }

    /* Search box */
    .results-controls .search-box {
        width: 100%;
    }

    .search-input {
        font-size: 14px;
        padding: 12px 14px;
    }

    /* Table controls - Optimized mobile layout with grid */
    .table-controls {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        padding: 10px;
        background: var(--bg-primary);
    }

    .select-all-container {
        font-size: 13px;
        font-weight: 600;
        padding: 10px 12px;
        background: var(--gray-50);
        border-radius: var(--radius-md);
        border: 1px solid var(--border-color);
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        grid-column: 1;
        white-space: nowrap;
    }

    .select-all-container span {
        font-size: 12px;
    }

    .select-all-container input[type="checkbox"] {
        margin: 0;
        flex-shrink: 0;
    }

    .selected-count {
        font-size: 12px;
        padding: 10px 12px;
        background: var(--gray-50);
        border-radius: var(--radius-md);
        border: 1px solid var(--border-color);
        min-height: auto;
        display: block;
        line-height: 1.6;
        grid-column: 1 / -1;
    }

    /* Processing status - Display on new line */
    #processing_status {
        display: block !important;
        margin-left: 0 !important;
        margin-top: 6px !important;
        padding-top: 6px;
        border-top: 1px solid var(--border-color);
        font-size: 11px !important;
        line-height: 1.4;
    }

    #toggle_all_cards {
        width: 100%;
        min-height: 44px !important;
        grid-column: 2;
        font-size: 11px !important;
        padding: 8px 10px !important;
        white-space: nowrap;
    }

    /* ===== CARDS GRID ===== */
    .allotment-cards-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-top: 16px;
    }

    .allotment-card {
        padding: 14px;
    }

    /* Card header - Better mobile layout */
    .allotment-card-header {
        margin-bottom: 12px;
        padding-bottom: 12px;
        gap: 10px;
    }

    .card-header-left {
        gap: 10px;
        min-width: 0;
        flex: 1;
    }

    .allotment-card .pan-checkbox {
        width: 20px;
        height: 20px;
        min-width: 20px;
    }

    .pan-info-header {
        min-width: 0;
        flex: 1;
    }

    .allotment-card .pan-number {
        font-size: 15px;
        word-break: break-all;
        line-height: 1.3;
    }

    .pan-name {
        font-size: 11px;
        word-break: break-word;
    }

    /* Status badges - Larger for mobile */
    .status-cell {
        min-width: fit-content;
    }

    .status-badge {
        font-size: 9px;
        padding: 4px 8px;
        white-space: nowrap;
    }

    /* Card body */
    .allotment-card-body {
        gap: 8px;
        margin-bottom: 12px;
    }

    .card-info-row {
        font-size: 13px;
        gap: 8px;
        flex-wrap: wrap;
    }

    .card-info-label {
        min-width: 80px;
        font-size: 12px;
    }

    .card-info-value {
        font-size: 12px;
        word-break: break-word;
    }

    .card-info-message {
        font-size: 12px;
        padding: 8px;
    }

    /* View details button */
    .view-details-btn {
        min-height: 44px !important;
        font-size: 12px !important;
    }

    /* ===== MODAL OPTIMIZATION ===== */
    .modal-container {
        width: 95%;
        max-width: 100%;
        margin: 10px;
        max-height: 90vh;
        overflow-y: auto;
    }

    .modal-header {
        padding: 16px;
        position: sticky;
        top: 0;
        background: white;
        z-index: 1;
    }

    .modal-header h3 {
        font-size: 16px;
        line-height: 1.3;
        word-break: break-word;
        padding-right: 10px;
    }

    .modal-close {
        min-width: 40px;
        min-height: 40px;
        font-size: 28px;
    }

    .modal-body {
        padding: 16px;
    }

    .modal-detail-row {
        flex-direction: column;
        padding: 12px 0;
        gap: 6px;
    }

    .modal-detail-label {
        min-width: auto;
        font-size: 12px;
        color: var(--text-secondary);
    }

    .modal-detail-value {
        font-size: 13px;
        word-break: break-word;
    }

    /* ===== BUTTONS ===== */
    .button {
        min-height: 44px !important;
        font-size: 12px !important;
        padding: 12px 18px !important;
        letter-spacing: 0.2px !important;
    }

    .button-outline {
        min-height: 44px !important;
    }

    /* ===== TOAST NOTIFICATIONS ===== */
    #toast-container {
        left: 12px;
        right: 12px;
        max-width: none;
        top: 80px;
    }

    .toast {
        min-width: auto;
        padding: 12px;
        font-size: 13px;
    }

    .toast-message {
        font-size: 13px;
    }

    /* ===== CHECKBOXES ===== */
    .checkbox-col {
        width: 40px;
    }

    .checkbox-col input[type="checkbox"],
    .header-checkbox,
    .select-all-container input[type="checkbox"] {
        width: 20px;
        height: 20px;
        min-width: 20px;
        min-height: 20px;
    }

    /* ===== IPO CARDS ===== */
    .ipo-card {
        padding: 16px;
    }

    .ipo-name {
        font-size: 16px;
        word-break: break-word;
    }

    .ipo-card-actions {
        flex-direction: column;
        gap: 8px;
    }

    .ipo-action-btn {
        width: 100%;
        min-height: 44px !important;
    }

    /* ===== FORM ELEMENTS ===== */
    .pan-input {
        font-size: 14px;
        padding: 12px 14px;
    }

    .add-pan-input {
        font-size: 14px;
        padding: 12px 14px;
    }

    .add-pan-form-row {
        flex-direction: column;
        gap: 10px;
    }

    .add-pan-submit {
        width: 100%;
        min-height: 44px !important;
    }

    /* ===== PROGRESS STATUS ===== */
    #processing_status {
        display: block !important;
        margin-left: 0 !important;
        margin-top: 4px;
        font-size: 12px;
    }

    /* ===== EMPTY STATE ===== */
    .empty-state {
        padding: 60px 16px;
    }

    .empty-icon {
        font-size: 56px;
    }

    .empty-state h3 {
        font-size: 18px;
    }

    .empty-state p {
        font-size: 14px;
    }

    /* ===== NOTICE ===== */
    .allotment-notice {
        padding: 12px;
        font-size: 13px;
    }

    .allotment-notice a {
        display: inline-block;
        margin-top: 4px;
    }
}

/* ===== SMALL MOBILE (≤480px) ===== */
@media (max-width: 480px) {
    .allotment-main {
        margin-left: 0;
        max-width: 100%;
        padding: 8px;
        padding-top: 68px;
    }

    .dashboard-title {
        font-size: 18px;
    }

    .add-pan-section,
    .pans-list-section {
        padding: 12px;
        border-radius: 10px;
    }

    .results-title {
        font-size: 15px;
    }

    .allotment-actions .button {
        font-size: 11px !important;
        padding: 10px 14px !important;
    }

    .sort-tabs {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .sort-tab {
        font-size: 12px;
        padding: 12px 8px;
    }

    .allotment-card .pan-number {
        font-size: 14px;
    }

    .card-info-label {
        min-width: 70px;
        font-size: 11px;
    }

    .card-info-value {
        font-size: 11px;
    }

    .status-badge {
        font-size: 8px;
        padding: 3px 6px;
    }

    .button {
        font-size: 11px !important;
        padding: 10px 14px !important;
    }

    .modal-header h3 {
        font-size: 15px;
    }

    .modal-detail-label,
    .modal-detail-value {
        font-size: 12px;
    }
}
