/* Inventory Portal Styles */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    background: #f5f5f5;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation */
.navbar {
    background: #2c3e50;
    color: white;
    padding: 15px 0;
    margin-bottom: 30px;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand {
    font-size: 20px;
    font-weight: bold;
    color: white;
    text-decoration: none;
}

.navbar-nav {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    gap: 8px 16px;
}

.navbar-nav a {
    color: white;
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background 0.2s;
}

.navbar-nav a:hover {
    background: rgba(255, 255, 255, 0.1);
}
.navbar-nav a.nav-active {
    background: rgba(255, 255, 255, 0.15);
    font-weight: 600;
}

/* Nav Dropdown */
.nav-dropdown {
    position: relative;
}
.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #2c3e50;
    list-style: none;
    min-width: 160px;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 8px 24px rgba(0,0,0,.2);
    z-index: 1000;
    padding: 8px 0 4px;
}
.nav-dropdown:hover .nav-dropdown-menu {
    display: block;
}
.nav-dropdown-menu li {
    display: block;
}
.nav-dropdown-menu a {
    display: block;
    padding: 8px 16px !important;
    white-space: nowrap;
    font-size: 13px;
}
.nav-dropdown-menu a:hover {
    background: rgba(255, 255, 255, 0.15) !important;
}

/* Reports Pill Nav Bar */
.rn-bar {
    background: #fff;
    border-bottom: 1.5px solid #eef0f4;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    margin-bottom: 24px;
    position: sticky;
    top: 0;
    z-index: 200;
}
.rn-bar-inner {
    max-width: 1700px;
    margin: 0 auto;
    padding: 0.7rem 24px;
    display: flex;
    align-items: center;
}

/* Logo */
.rn-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    flex-shrink: 0;
    margin-right: 1.5rem;
}
.rn-logo-icon { flex-shrink: 0; }
.rn-logo-text {
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: #1a1d21;
    letter-spacing: -0.02em;
}
.rn-logo-accent {
    color: #3b82f6;
    font-weight: 700;
}

/* Centered pills container */
.rn-pills {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex: 1;
    justify-content: center;
}

/* Pill base */
.rn-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.55rem 1.25rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', sans-serif;
    font-size: 0.88rem;
    font-weight: 500;
    color: #3d4350;
    text-decoration: none;
    white-space: nowrap;
    border: 1.5px solid #e4e7ec;
    border-radius: 999px;
    background: #fff;
    cursor: pointer;
    transition: all 0.15s ease;
    line-height: 1.4;
}
.rn-pill:hover {
    background: #f4f5f7;
    border-color: #d1d5dc;
    color: #1a1d21;
}
.rn-pill.rn-active {
    background: #1a1d21;
    color: #fff;
    border-color: #1a1d21;
    font-weight: 600;
}
.rn-pill.rn-active:hover {
    background: #2d3139;
    border-color: #2d3139;
}
.rn-chevron {
    flex-shrink: 0;
    opacity: 0.55;
    transition: transform 0.2s;
}
.rn-active .rn-chevron { opacity: 0.8; }

/* Dropdown wrapper */
.rn-dropdown {
    position: relative;
}
.rn-dropdown:hover .rn-menu,
.rn-dropdown:focus-within .rn-menu {
    display: block;
}
.rn-dropdown:hover .rn-chevron {
    transform: rotate(180deg);
}

/* Dropdown menu */
.rn-menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%);
    min-width: 190px;
    background: #fff;
    border: 1.5px solid #eef0f4;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.10), 0 2px 6px rgba(0,0,0,0.04);
    padding: 0.4rem;
    z-index: 300;
}
.rn-menu::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 0;
    right: 0;
    height: 10px;
}
.rn-menu-right {
    left: auto;
    right: 0;
    transform: none;
}
.rn-menu-item {
    display: block;
    padding: 0.55rem 0.9rem;
    font-size: 0.84rem;
    font-weight: 500;
    color: #3d4350;
    text-decoration: none;
    border-radius: 8px;
    transition: background 0.12s, color 0.12s;
    white-space: nowrap;
}
.rn-menu-item:hover {
    background: #f4f5f7;
    color: #1a1d21;
}
.rn-menu-active {
    background: #f0fdf9;
    color: #0d9471;
    font-weight: 600;
}
.rn-menu-active:hover {
    background: #e6faf3;
}

/* User button */
.rn-user-wrap {
    flex-shrink: 0;
    margin-left: 1.5rem;
}
.rn-user-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1.5px solid #e4e7ec;
    background: #f9fafb;
    color: #5f6673;
    cursor: pointer;
    transition: all 0.15s;
}
.rn-user-btn:hover {
    background: #eef0f4;
    border-color: #d1d5dc;
    color: #1a1d21;
}

/* Cards */
.card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.card h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.table thead {
    background: #f8f9fa;
}

.table th,
.table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

.table th {
    font-weight: 600;
    color: #495057;
}

.table tbody tr:hover {
    background: #f8f9fa;
}

.table-sm th,
.table-sm td {
    padding: 8px;
}

.table-responsive {
    overflow-x: auto;
}

.text-right {
    text-align: right !important;
}

.text-center {
    text-align: center !important;
}

.text-success {
    color: #28a745 !important;
}

.text-danger {
    color: #dc3545 !important;
}

.text-warning {
    color: #ffc107 !important;
}

.text-muted {
    color: #6c757d !important;
}

.total-row {
    background: #f8f9fa;
    font-weight: bold;
    border-top: 2px solid #dee2e6;
}

/* Stats */
.stats-table {
    width: 100%;
}

.stats-table td {
    padding: 8px 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.stat-card {
    padding: 15px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    text-align: center;
}

.stat-number {
    font-size: 32px;
    font-weight: bold;
    color: #2c3e50;
    margin: 10px 0;
}

.stat-label {
    font-size: 12px;
    color: #6c757d;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 4px;
    white-space: nowrap;
}

.badge-success {
    background: #28a745;
    color: white;
}

.badge-warning {
    background: #ffc107;
    color: #212529;
}

.badge-danger {
    background: #dc3545;
    color: white;
}

.badge-info {
    background: #17a2b8;
    color: white;
}

.badge-secondary {
    background: #6c757d;
    color: white;
}

/* Forms */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #495057;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group input[type="file"],
.form-group select,
.form-group textarea,
.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
}

.form-group input[type="checkbox"] {
    margin-right: 5px;
}

.form-text {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #6c757d;
}

.filter-form {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 4px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-sm {
    padding: 4px 8px;
    font-size: 12px;
}

/* Alerts */
.alert {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.alert-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.alert-danger {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.alert-info {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
    padding: 20px 0;
}

/* Breadcrumb */
.breadcrumb {
    margin-bottom: 20px;
    color: #6c757d;
}

.breadcrumb a {
    color: #3498db;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* Link List */
.link-list {
    list-style: none;
    padding: 0;
}

.link-list li {
    margin-bottom: 10px;
}

.link-list a {
    color: #3498db;
    text-decoration: none;
    font-weight: 500;
}

.link-list a:hover {
    text-decoration: underline;
}

/* Order Lines */
.order-lines-row {
    background: #f8f9fa;
}

.order-lines-container {
    padding: 20px;
}

.order-lines-container h4 {
    margin-top: 0;
    margin-bottom: 15px;
}

/* Details Table */
.details-table {
    width: 100%;
}

.details-table td {
    padding: 8px;
    border-bottom: 1px solid #dee2e6;
}

.details-table td:first-child {
    width: 200px;
    color: #6c757d;
}

/* Footer */
.footer {
    background: #2c3e50;
    color: white;
    padding: 20px 0;
    margin-top: 50px;
    text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .navbar {
        padding: 10px 0;
    }
    
    .navbar .container {
        flex-direction: column;
        gap: 10px;
    }
    
    .navbar-brand {
        font-size: 18px;
    }
    
    .navbar-nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }
    
    .navbar-nav a {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .card {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    h1 {
        font-size: 1.5em;
    }
    
    .table-responsive {
        margin: 0 -15px;
        padding: 0 15px;
    }
}

@media (max-width: 480px) {
    .navbar-nav {
        gap: 5px;
    }
    
    .navbar-nav a {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .btn {
        padding: 10px 14px;
    }
    
    .btn-sm {
        padding: 6px 10px;
    }
}

/* Loading Spinner */
.loading {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #666;
    font-size: 14px;
}

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
