/* StockTrotter - Base Styles */

/* ===== BRAND COLORS ===== */
.brand-stock {
    color: #2563eb;
}
.brand-trotter {
    color: #f59e0b;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #f8fafc;
    color: #1e293b;
    line-height: 1.5;
}

/* ===== NAVBAR ===== */
nav {
    background: white;
    border-bottom: 1px solid #e2e8f0;
    padding: 0 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
}
.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}
.nav-left {
    display: flex;
    align-items: center;
    gap: 3rem;
}
.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #2563eb 0%, #f59e0b 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
}
.nav-links {
    display: flex;
    gap: 0.5rem;
}
.nav-links a {
    color: #64748b;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s;
}
.nav-links a:hover {
    color: #0f172a;
    background: #f1f5f9;
}
.nav-links a.active {
    color: #2563eb;
    background: #dbeafe;
}
.nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.user-menu {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: #f8fafc;
    border-radius: 50px;
    border: 1px solid #e2e8f0;
}
.user-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.85rem;
}
.user-info {
    line-height: 1.3;
}
.user-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: #0f172a;
}
.user-role {
    font-size: 0.75rem;
    color: #64748b;
}
.btn-logout {
    color: #64748b;
    text-decoration: none;
    font-size: 0.85rem;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    transition: all 0.2s;
}
.btn-logout:hover {
    background: #fee2e2;
    color: #dc2626;
}

/* Mobile menu button */
.nav-mobile-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}
.nav-mobile-btn span {
    display: block;
    width: 20px;
    height: 2px;
    background: #334155;
    margin: 4px 0;
    border-radius: 2px;
    transition: all 0.3s;
}
.nav-mobile-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(4px, 4px);
}
.nav-mobile-btn.active span:nth-child(2) {
    opacity: 0;
}
.nav-mobile-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(4px, -4px);
}

/* Mobile dropdown menu */
.nav-mobile-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    padding: 1rem;
    animation: navSlideDown 0.2s ease-out;
}
.nav-mobile-menu.active {
    display: block;
}
@keyframes navSlideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}
.nav-mobile-menu .mobile-links {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e2e8f0;
}
.nav-mobile-menu .mobile-links a {
    display: block;
    padding: 0.75rem 1rem;
    color: #334155;
    text-decoration: none;
    font-weight: 500;
    border-radius: 8px;
}
.nav-mobile-menu .mobile-links a:hover,
.nav-mobile-menu .mobile-links a.active {
    background: #dbeafe;
    color: #2563eb;
}
.nav-mobile-menu .mobile-user {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0;
}
.nav-mobile-menu .mobile-user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Responsive nav */
@media (max-width: 768px) {
    nav { padding: 0 0.75rem; position: relative; }
    .nav-container { height: 60px; }
    .nav-left { gap: 0; }
    .nav-left .nav-links { display: none; }
    .nav-right { display: none; }
    .nav-mobile-btn { display: block; }
    .logo { font-size: 1.25rem; }
    .logo-icon { width: 32px; height: 32px; font-size: 0.85rem; }
    main { padding: 1rem 0.75rem; }
    .page-header h1 { font-size: 1.5rem; }
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 0.75rem; }
    .stat-card { padding: 1rem; }
    .stat-card .stat-value { font-size: 1.5rem; }
    .stat-card .stat-icon { width: 40px; height: 40px; font-size: 1.25rem; margin-bottom: 0.75rem; }
    .card-header { padding: 1rem; flex-direction: column; align-items: flex-start; gap: 0.75rem; }
    .card-body { padding: 1rem; }
    th, td { padding: 0.75rem; font-size: 0.85rem; }
    .btn { padding: 0.5rem 1rem; font-size: 0.875rem; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
}

/* ===== MAIN CONTENT ===== */
main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}
.btn-primary {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3);
}
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}
.btn-secondary {
    background: white;
    color: #475569;
    border: 1px solid #e2e8f0;
}
.btn-secondary:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}
.btn-success {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
}
.btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4);
}
.btn-danger {
    background: #fee2e2;
    color: #dc2626;
}
.btn-danger:hover {
    background: #fecaca;
}
.btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
}
.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.85rem;
}

/* ===== CARDS ===== */
.card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.1);
    overflow: hidden;
}
.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.card-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #0f172a;
}
.card-body {
    padding: 1.5rem;
}

/* ===== FORMS ===== */
.form-group {
    margin-bottom: 1.25rem;
}
.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.9rem;
    color: #475569;
}
.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.2s;
    background: white;
}
.form-control:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.form-control::placeholder {
    color: #94a3b8;
}
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

/* ===== BADGES ===== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 500;
}
.badge-available {
    background: #dcfce7;
    color: #166534;
}
.badge-pending {
    background: #fef3c7;
    color: #92400e;
}
.badge-sold {
    background: #f1f5f9;
    color: #475569;
}
.badge-accepted {
    background: #dcfce7;
    color: #166534;
}
.badge-rejected {
    background: #fee2e2;
    color: #dc2626;
}
.badge-paid {
    background: #dbeafe;
    color: #1e40af;
}
.badge-shipped {
    background: #e0e7ff;
    color: #3730a3;
}
.badge-delivered {
    background: #d1fae5;
    color: #065f46;
}
.badge-completed {
    background: #dcfce7;
    color: #14532d;
}
.badge-disputed {
    background: #fef3c7;
    color: #92400e;
}
.badge-cancelled {
    background: #f1f5f9;
    color: #475569;
}

/* ===== STATS ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}
.stat-card {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}
.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #0f172a;
}
.stat-card .stat-label {
    color: #64748b;
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

/* ===== TABLE ===== */
.table-container {
    overflow-x: auto;
}
table {
    width: 100%;
    border-collapse: collapse;
}
th {
    text-align: left;
    padding: 1rem 1.25rem;
    font-weight: 600;
    font-size: 0.8rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}
td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.95rem;
}
tr:hover {
    background: #fafbfc;
}

/* ===== ALERTS ===== */
.alert {
    padding: 1rem 1.25rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.alert-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}
.alert-error {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

/* ===== PAGE HEADER ===== */
.page-header {
    margin-bottom: 2rem;
}
.page-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.5rem;
}
.page-header p {
    color: #64748b;
    font-size: 1rem;
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: #64748b;
}
.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}
.empty-state h3 {
    font-size: 1.1rem;
    color: #475569;
    margin-bottom: 0.5rem;
}

/* ===== UTILITIES ===== */
.text-muted { color: #64748b; }
.text-success { color: #16a34a; }
.text-warning { color: #d97706; }
.text-danger { color: #dc2626; }
.font-bold { font-weight: 600; }
.text-sm { font-size: 0.875rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }

/* ===== ADMIN THEME ===== */
.admin-theme nav {
    background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%);
    border-bottom: none;
}
.admin-theme .logo { color: white; }
.admin-theme .logo-icon {
    background: rgba(255,255,255,0.2);
}
.admin-theme .nav-links a {
    color: rgba(255,255,255,0.8);
}
.admin-theme .nav-links a:hover {
    color: white;
    background: rgba(255,255,255,0.1);
}
.admin-theme .nav-links a.active {
    color: white;
    background: rgba(255,255,255,0.2);
}
.admin-theme .user-menu {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.2);
}
.admin-theme .user-name { color: white; }
.admin-theme .user-role { color: rgba(255,255,255,0.7); }
.admin-theme .user-avatar {
    background: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%);
}
.admin-theme .btn-logout {
    color: rgba(255,255,255,0.8);
}
.admin-theme .btn-logout:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}
.admin-theme .btn-primary {
    background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%);
    box-shadow: 0 2px 4px rgba(124, 58, 237, 0.3);
}
.admin-theme .btn-primary:hover {
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.4);
}
.admin-theme .nav-mobile-btn span { background: white; }
.admin-theme .nav-mobile-menu .mobile-links a:hover,
.admin-theme .nav-mobile-menu .mobile-links a.active {
    background: #ede9fe;
    color: #6d28d9;
}
