/**
 * HABERIC LAB Inc. - Common Styles
 * Corporate Colors: #21305C (Dark Blue), #94B595 (Light Green)
 * Design: Modern, Startup/Tech Style
 */

/* ============================================
   CSS Variables (Corporate Colors)
   ============================================ */
:root {
    /* Primary Colors */
    --color-primary: #21305C;
    --color-primary-dark: #1a2647;
    --color-primary-light: #2d4078;

    /* Secondary Colors */
    --color-secondary: #94B595;
    --color-secondary-dark: #7a9e7b;
    --color-secondary-light: #a8c4a9;

    /* Background Colors */
    --color-bg: #F8F9FA;
    --color-bg-dark: #E9ECEF;
    --color-card: #FFFFFF;

    /* Text Colors */
    --color-text-primary: #21305C;
    --color-text-secondary: #6C757D;
    --color-text-muted: #ADB5BD;

    /* Status Colors */
    --color-success: #94B595;
    --color-error: #DC3545;
    --color-warning: #FFC107;
    --color-info: #17A2B8;

    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(33, 48, 92, 0.08);
    --shadow-md: 0 4px 12px rgba(33, 48, 92, 0.12);
    --shadow-lg: 0 8px 24px rgba(33, 48, 92, 0.16);
    --shadow-xl: 0 12px 48px rgba(33, 48, 92, 0.2);

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

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;

    /* Font */
    --font-family: 'Source Sans 3', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ============================================
   Base Styles
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    font-weight: 400;
    line-height: 1.6;
    color: var(--color-text-primary);
    background-color: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   Typography
   ============================================ */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--color-text-primary);
    margin-bottom: 0.5em;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1rem;
    color: var(--color-text-secondary);
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-secondary);
}

/* ============================================
   Login Page Styles
   ============================================ */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, var(--color-bg) 0%, var(--color-bg-dark) 100%);
    position: relative;
    overflow: hidden;
}

/* Background decoration */
.login-container::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 80%;
    height: 150%;
    background: linear-gradient(135deg, var(--color-secondary-light) 0%, transparent 60%);
    opacity: 0.3;
    border-radius: 50%;
    transform: rotate(-15deg);
}

.login-container::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 50%;
    height: 80%;
    background: linear-gradient(45deg, var(--color-primary) 0%, transparent 60%);
    opacity: 0.05;
    border-radius: 50%;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--color-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    padding: 48px 40px;
    position: relative;
    z-index: 1;
    animation: slideUp 0.6s ease;
}

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

/* Logo */
.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo img {
    height: 48px;
    width: auto;
}

.login-logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary);
    letter-spacing: -0.5px;
}

.login-logo-text span {
    color: var(--color-secondary);
}

/* Welcome text */
.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-text-primary);
    margin-bottom: 8px;
}

.login-header p {
    font-size: 0.95rem;
    color: var(--color-text-secondary);
    margin-bottom: 0;
}

/* Form styles */
.login-form {
    margin-bottom: 24px;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: 8px;
}

.form-control {
    width: 100%;
    padding: 14px 16px;
    font-size: 1rem;
    font-family: var(--font-family);
    color: var(--color-text-primary);
    background-color: var(--color-bg);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.form-control:focus {
    outline: none;
    background-color: var(--color-card);
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px rgba(33, 48, 92, 0.1);
}

.form-control::placeholder {
    color: var(--color-text-muted);
}

/* Password toggle */
.password-wrapper {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    padding: 4px;
    transition: color var(--transition-fast);
}

.password-toggle:hover {
    color: var(--color-primary);
}

/* Button styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-family);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.btn-primary {
    width: 100%;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    background: linear-gradient(135deg, var(--color-primary-light) 0%, var(--color-primary) 100%);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--color-bg);
    color: var(--color-text-primary);
}

.btn-secondary:hover {
    background: var(--color-bg-dark);
}

/* Remember me & Forgot password */
.login-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    font-size: 0.875rem;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

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

.forgot-password {
    color: var(--color-primary);
    font-weight: 500;
}

.forgot-password:hover {
    color: var(--color-secondary);
    text-decoration: underline;
}

/* Footer */
.login-footer {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid var(--color-bg-dark);
}

.login-footer p {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    margin-bottom: 0;
}

/* Alert styles */
.alert {
    padding: 14px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-error {
    background-color: #FEE2E2;
    color: #991B1B;
    border: 1px solid #FECACA;
}

.alert-success {
    background-color: #D1FAE5;
    color: #065F46;
    border: 1px solid #A7F3D0;
}

/* ============================================
   2FA Page Styles
   ============================================ */
.two-factor-inputs {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 24px;
}

.two-factor-inputs input {
    width: 48px;
    height: 56px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 600;
    border: 2px solid var(--color-bg-dark);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.two-factor-inputs input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px rgba(33, 48, 92, 0.1);
}

/* ============================================
   Responsive Styles
   ============================================ */
@media (max-width: 480px) {
    .login-card {
        padding: 32px 24px;
        border-radius: var(--radius-lg);
    }

    .login-header h1 {
        font-size: 1.5rem;
    }

    .login-options {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .two-factor-inputs input {
        width: 40px;
        height: 48px;
        font-size: 1.25rem;
    }
}

/* ============================================
   Utility Classes
   ============================================ */
.text-center { text-align: center; }
.text-primary { color: var(--color-primary); }
.text-secondary { color: var(--color-secondary); }
.text-muted { color: var(--color-text-muted); }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

/* ============================================
   Dashboard Layout
   ============================================ */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
    background-color: var(--color-bg);
}

/* ============================================
   Sidebar
   ============================================ */
.sidebar {
    width: 260px;
    background: var(--color-card);
    border-right: 1px solid var(--color-bg-dark);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--color-bg-dark);
}

.sidebar-logo {
    display: flex;
    align-items: center;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-primary);
    letter-spacing: -0.5px;
}

.logo-text span {
    color: var(--color-secondary);
}

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

.nav-section {
    margin-bottom: 24px;
}

.nav-section-title {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0 12px;
    margin-bottom: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.nav-item:hover {
    background-color: var(--color-bg);
    color: var(--color-primary);
}

.nav-item.active {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: white;
}

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

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--color-bg-dark);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-secondary) 0%, var(--color-secondary-dark) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text-primary);
}

.user-role {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.logout-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
    transition: all var(--transition-fast);
}

.logout-btn:hover {
    background-color: var(--color-error);
    color: white;
}

.logout-btn svg {
    width: 20px;
    height: 20px;
}

/* ============================================
   Main Content Area
   ============================================ */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 24px 32px;
}

.main-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 32px;
}

.header-left h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-text-primary);
    margin-bottom: 4px;
}

.header-subtitle {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    margin-bottom: 0;
}

.current-date {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    background: var(--color-card);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
}

/* ============================================
   Dashboard Grid
   ============================================ */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.dashboard-card {
    background: var(--color-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: box-shadow var(--transition-normal);
}

.dashboard-card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--color-bg-dark);
}

.card-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: 0;
}

.card-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
}

.badge-success {
    background-color: rgba(148, 181, 149, 0.15);
    color: var(--color-secondary-dark);
}

.card-link {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-primary);
}

.card-link:hover {
    color: var(--color-secondary);
}

.card-body {
    padding: 24px;
}

/* ============================================
   Sales Card
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-item {
    text-align: center;
    padding: 16px;
    background: var(--color-bg);
    border-radius: var(--radius-md);
}

.stat-label {
    display: block;
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin-bottom: 4px;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-text-primary);
}

.platform-breakdown {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.platform-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.platform-name {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    width: 70px;
}

.platform-bar {
    flex: 1;
    height: 8px;
    background: var(--color-bg-dark);
    border-radius: 4px;
    overflow: hidden;
}

.platform-progress {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
    border-radius: 4px;
}

.platform-percent {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-text-primary);
    width: 40px;
    text-align: right;
}

/* ============================================
   Orders Card
   ============================================ */
.order-stats {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

.order-stat-item {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--color-bg);
    border-radius: var(--radius-md);
}

.order-stat-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.order-stat-icon svg {
    width: 20px;
    height: 20px;
}

.icon-pending {
    background: rgba(255, 193, 7, 0.15);
    color: #D97706;
}

.icon-processing {
    background: rgba(23, 162, 184, 0.15);
    color: #0891B2;
}

.icon-shipped {
    background: rgba(148, 181, 149, 0.15);
    color: var(--color-secondary-dark);
}

.order-stat-info {
    display: flex;
    flex-direction: column;
}

.order-stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-text-primary);
}

.order-stat-label {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.recent-orders h4 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    margin-bottom: 12px;
}

.order-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.order-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--color-bg);
    border-radius: var(--radius-sm);
}

.order-id {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-primary);
}

.order-platform {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
}

.platform-rakuten {
    background: #BF0000;
    color: white;
}

.platform-yahoo {
    background: #FF0033;
    color: white;
}

.platform-amazon {
    background: #FF9900;
    color: #232F3E;
}

.order-amount {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-primary);
}

/* ============================================
   Ranking Card
   ============================================ */
.ranking-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ranking-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--color-bg);
    border-radius: var(--radius-md);
}

.ranking-position {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
}

.ranking-product {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-text-primary);
}

.product-category {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.ranking-change {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.ranking-change svg {
    width: 16px;
    height: 16px;
}

.ranking-change.up {
    color: var(--color-secondary-dark);
}

.ranking-change.down {
    color: var(--color-error);
}

.ranking-change.same {
    color: var(--color-text-muted);
}

/* ============================================
   Settings Card
   ============================================ */
.settings-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.settings-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--color-bg);
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.settings-item:hover {
    background: var(--color-bg-dark);
    transform: translateX(4px);
}

.settings-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.settings-icon svg {
    width: 22px;
    height: 22px;
}

.settings-icon.icon-admin {
    background: linear-gradient(135deg, var(--color-secondary) 0%, var(--color-secondary-dark) 100%);
}

.settings-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.settings-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-text-primary);
}

.settings-desc {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.settings-arrow {
    width: 20px;
    height: 20px;
    color: var(--color-text-muted);
    flex-shrink: 0;
}

/* ============================================
   Dashboard Responsive
   ============================================ */
@media (max-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform var(--transition-normal);
    }

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

    .main-content {
        margin-left: 0;
        padding: 16px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .order-stats {
        flex-direction: column;
    }
}
