/* static/css/styles.css */

/* ============================================
   COLOR SCHEME - Change these variables only
   ============================================ */
:root {
    /* Primary Colors */
    --primary: #04674e;
    --primary-hover: #03573f;
    --primary-light: #e8f5f0;

    /* Secondary Colors */
    --secondary: #2c3e50;
    --secondary-hover: #34495e;
    --secondary-light: #ecf0f1;

    /* Status Colors */
    --success: #28a745;
    --success-bg: #e8f5e9;
    --danger: #dc3545;
    --danger-bg: #ffebee;
    --info: #007bff;
    --info-bg: #e3f2fd;
    --warning: #ffc107;

    /* Neutral Colors */
    --bg-body: #f5f5f5;
    --bg-white: #ffffff;
    --text-dark: #2c3e50;
    --text-muted: #666666;
    --text-light: #888888;
    --border-light: #e9ecef;
    --border-default: #dddddd;
    --shadow: rgba(0, 0, 0, 0.1);

    /* Sidebar */
    --sidebar-bg: #2c3e50;
    --sidebar-border: #34495e;
    --sidebar-text: #ecf0f1;

    /* Branding */
    --brand-gradient-start: #f8f9fa;
    --brand-gradient-end: #e9ecef;

    /* Typography */
    --font-family: Arial, sans-serif;
}

/* ============================================
   GLOBAL
   ============================================ */
* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    margin: 0;
    padding: 20px;
    background: var(--bg-body);
}

/* ============================================
   LOGIN PAGE
   ============================================ */
.login-wrapper {
    display: flex;
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

/* Left side - Branding */
.login-brand {
    flex: 1;
    background: linear-gradient(135deg, var(--brand-gradient-start) 0%, var(--brand-gradient-end) 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px;
    text-align: center;
}

.login-logo {
    max-width: 200px;
    height: auto;
    margin-bottom: 30px;
}

.login-brand h1 {
    font-size: 32px;
    color: var(--text-dark);
    margin: 0 0 10px 0;
}

.login-brand p {
    font-size: 18px;
    color: var(--text-muted);
    margin: 0;
}

/* Right side - Login Form */
.login-form-wrapper {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--bg-white);
    padding: 40px;
}

.login-form-container {
    width: 100%;
    max-width: 400px;
}

.login-form-container h2 {
    text-align: center;
    margin-bottom: 30px;
    color: var(--text-dark);
}

/* ============================================
   CARDS / CONTAINERS
   ============================================ */
.card {
    background: var(--bg-white);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px var(--shadow);
}

/* ============================================
   HEADERS
   ============================================ */
h1,
h2,
h3 {
    margin: 0;
}

h2 {
    text-align: center;
    margin-bottom: 20px;
}

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

label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

input {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border-default);
    border-radius: 4px;
    box-sizing: border-box;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    font-size: 16px;
    display: inline-block;
    transition: background 0.3s;
}

.btn-primary {
    background: var(--primary);
    color: var(--bg-white);
    width: 100%;
    padding: 10px;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-danger {
    background: var(--danger);
    color: var(--bg-white);
}

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

/* ============================================
   MESSAGES
   ============================================ */
.messages {
    margin-bottom: 15px;
}

.error {
    color: var(--danger);
    padding: 10px;
    background: var(--danger-bg);
    border-radius: 4px;
    margin-bottom: 15px;
}

/* ============================================
   DASHBOARD LAYOUT
   ============================================ */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
    padding: 0;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background: var(--sidebar-bg);
    color: var(--bg-white);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
}

.sidebar-brand {
    padding: 20px;
    border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-brand h2 {
    margin: 0;
    color: var(--bg-white);
    font-size: 20px;
}

.sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 20px 0;
    flex: 1;
}

.sidebar-nav li {
    padding: 0;
}

.sidebar-link {
    display: block;
    padding: 12px 20px;
    color: var(--sidebar-text);
    text-decoration: none;
    transition: background 0.3s;
}

.sidebar-link:hover {
    background: var(--sidebar-border);
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--sidebar-border);
}

/* Main Content */
.main-content {
    margin-left: 250px;
    flex: 1;
    padding: 20px;
    background: var(--bg-body);
    min-height: 100vh;
}

.top-bar {
    background: var(--bg-white);
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px var(--shadow);
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.content-area {
    background: var(--bg-white);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px var(--shadow);
    min-height: 400px;
}

/* ============================================
   WIDGETS
   ============================================ */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

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

.widget {
    background: var(--bg-white);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px var(--shadow);
}

.widget h3 {
    margin: 0 0 15px 0;
    color: var(--text-dark);
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.chart-container {
    max-width: 200px;
    margin: 0 auto 15px;
}

/* Widget Stats */
.widget-stats {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border-light);
}

.stat-item {
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 12px;
    color: var(--text-light);
    text-transform: uppercase;
}

.stat-value {
    font-size: 18px;
    font-weight: bold;
}

.stat-value.cash {
    color: var(--success);
}

.stat-value.cards {
    color: var(--warning);
}

.stat-value.refund {
    color: var(--danger);
}

.stat-value.positive {
    color: var(--success);
}

.stat-value.negative {
    color: var(--danger);
}

/* Big Number */
.big-number {
    font-size: 48px;
    font-weight: bold;
    text-align: center;
    color: var(--text-dark);
    padding: 10px 0;
}

/* ============================================
   HEADER BAR (Dashboard)
   ============================================ */
.store-info {
    color: var(--text-muted);
    font-size: 14px;
}

.welcome {
    font-size: 18px;
}

.content {
    min-height: 300px;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .login-wrapper {
        flex-direction: column;
    }

    .login-brand {
        padding: 40px 20px;
        min-height: 200px;
    }

    .login-brand h1 {
        font-size: 24px;
    }

    .login-logo {
        max-width: 120px;
    }

    .login-form-wrapper {
        padding: 20px;
    }
}

/* ============================================
   TRANSACTIONS TABLE
   ============================================ */
.table-wrapper {
    overflow-x: auto;
    margin-top: 10px;
}

.transactions-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.transactions-table thead th {
    text-align: left;
    padding: 12px 15px;
    background: var(--secondary);
    color: white;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.transactions-table tbody td {
    padding: 11px 15px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-dark);
}

.transactions-table tbody tr:hover {
    background: var(--primary-light);
}

.transactions-table tbody tr:last-child td {
    border-bottom: none;
}

.transactions-table code {
    background: var(--border-light);
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 12px;
    color: var(--text-dark);
}

.empty-state {
    text-align: center;
    padding: 40px !important;
    color: var(--text-muted);
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
}

.status-completed {
    background: var(--success-bg);
    color: var(--success);
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

.status-refunded {
    background: var(--danger-bg);
    color: var(--danger);
}

.status-failed {
    background: #f8d7da;
    color: #721c24;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid var(--border-light);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
    background: var(--secondary);
    color: white;
    border-radius: 4px;
}

.btn-sm:hover {
    background: var(--secondary-hover);
}

.pagination-info {
    color: var(--text-muted);
    font-size: 14px;
}

/* ============================================
   PAGE HEADER
   ============================================ */
.page-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.page-header h3 {
    margin: 0;
}

.count-badge {
    background: var(--border-light);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 13px;
    color: var(--text-muted);
}

/* ============================================
   SEARCH FORM
   ============================================ */

.search-form {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    align-items: center;
}

.search-form input {
    flex: 0 1 300px;
    padding: 8px 12px;
    border: 1px solid var(--border-default);
    border-radius: 4px;
    font-size: 14px;
    min-width: 200px;
}

.search-form input:focus {
    outline: none;
    border-color: var(--primary);
}

.search-form .btn-sm {
    flex-shrink: 0;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
    background: var(--secondary);
    color: white;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    width: auto;
}

.btn-sm:hover {
    background: var(--secondary-hover);
}

.btn-clear {
    background: var(--danger);
}

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

.btn-outline {
    background: transparent;
    color: var(--secondary);
    border: 1px solid var(--secondary);
}

.btn-outline:hover {
    background: var(--secondary);
    color: white;
}

/* ============================================
   PRODUCTS TABLE
   ============================================ */
.products-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.products-table thead th {
    text-align: left;
    padding: 12px 15px;
    background: var(--secondary);
    color: white;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.products-table tbody td {
    padding: 11px 15px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-dark);
}

.products-table tbody tr:hover {
    background: var(--primary-light);
}

.products-table tbody tr:last-child td {
    border-bottom: none;
}

.products-table code {
    background: var(--border-light);
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 12px;
    color: var(--text-dark);
}

/* Status Badges for Products */
.status-in-stock {
    background: var(--success-bg);
    color: var(--success);
}

.status-out-of-stock {
    background: var(--danger-bg);
    color: var(--danger);
}

/* ============================================
   USERS TABLE
   ============================================ */
.users-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 14px;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px var(--shadow);
}

.users-table thead th {
    text-align: left;
    padding: 16px 20px;
    background: var(--secondary);
    color: white;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.users-table thead th:last-child {
    text-align: center;
}

.users-table tbody td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

.users-table tbody tr {
    transition: all 0.2s ease;
}

.users-table tbody tr:hover {
    background: var(--primary-light);
    transform: scale(1.002);
}

.users-table tbody tr:last-child td {
    border-bottom: none;
}

/* User Info Cell */
.user-info {
    display: flex;
    align-items: center;
    gap: 14px;
}

.user-avatar {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.user-name {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 15px;
}

.user-email {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Role Badges */
.role-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.role-admin {
    background: var(--primary-light);
    color: var(--primary);
    border: 1px solid var(--primary);
}

.role-user {
    background: var(--border-light);
    color: var(--text-muted);
    border: 1px solid transparent;
}

/* Date Info */
.date-info {
    display: flex;
    flex-direction: column;
}

.date-main {
    font-weight: 500;
    color: var(--text-dark);
}

.date-time {
    font-size: 12px;
    color: var(--text-muted);
}

/* Status with Dot */
.status-active {
    background: var(--success-bg);
    color: var(--success);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 14px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 12px;
}

.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }

    100% {
        opacity: 1;
    }
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.action-btn {
    background: var(--border-light);
    border: none;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 16px;
    line-height: 1;
}

.action-btn:hover {
    background: var(--secondary);
    transform: scale(1.1);
}

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

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