/* Clean & Professional CSS for POS Multi-Tenant */
:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #06b6d4;
    --light-bg: #f8fafc;
    --white: #ffffff;
    --dark-text: #0f172a;
    --text-secondary: #475569;
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 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);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--light-bg);
    color: var(--dark-text);
    line-height: 1.6;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Sidebar Layout */
.admin-layout,
.tenant-layout {
    display: flex;
    min-height: 100vh;
    background-color: var(--light-bg);
}

.sidebar {
    width: 280px;
    background: var(--white);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 1000;
    transition: transform 0.3s ease;
    box-shadow: var(--shadow-md);
}

.sidebar-header {
    padding: 1.75rem 1.5rem;
    border-bottom: 1px solid var(--border-light);
}

.sidebar-logo {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: var(--dark-text);
    letter-spacing: -0.02em;
}

.sidebar-subtitle {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin: 0;
    font-weight: 500;
}

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

.nav-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.15s ease;
    border-left: 3px solid transparent;
    font-weight: 500;
    font-size: 0.875rem;
}

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

.nav-item.active {
    background-color: rgba(37, 99, 235, 0.08);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
    font-weight: 600;
}

.nav-icon {
    font-size: 1.125rem;
    margin-right: 0.75rem;
    width: 20px;
    text-align: center;
    line-height: 1;
}

.nav-text {
    font-size: 0.875rem;
}

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-light);
    background-color: var(--light-bg);
}

.user-info {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background-color: var(--white);
    border-radius: 0.5rem;
    border: 1px solid var(--border-light);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), #3b82f6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    margin-right: 0.75rem;
    color: white;
    flex-shrink: 0;
}

.user-details {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--dark-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: capitalize;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.logout-btn {
    margin-top: 0.5rem;
}

.main-content {
    flex: 1;
    margin-left: 280px;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.3s ease;
}

.topbar {
    background: var(--white);
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--text-secondary);
    display: none;
    transition: color 0.15s;
}

.sidebar-toggle:hover {
    color: var(--dark-text);
}

.page-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--dark-text);
    margin: 0;
    letter-spacing: -0.02em;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.welcome-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.welcome-text strong {
    color: var(--dark-text);
    font-weight: 600;
}

.content-area {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}

/* Cards */
.card {
    background: var(--white);
    border-radius: 0.75rem;
    box-shadow: var(--shadow);
    padding: 1.75rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-light);
    transition: box-shadow 0.2s;
}

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

.card h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--dark-text);
    letter-spacing: -0.02em;
}

.card h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--dark-text);
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    border-radius: 0.5rem;
    overflow: hidden;
    border: 1px solid var(--border-light);
}

.table thead {
    background-color: var(--light-bg);
}

.table th {
    padding: 0.875rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-color);
}

.table td {
    padding: 1rem;
    border-top: 1px solid var(--border-light);
    font-size: 0.875rem;
    color: var(--dark-text);
}

.table tbody tr {
    transition: background-color 0.15s;
}

.table tbody tr:hover {
    background-color: var(--light-bg);
}

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

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.15s ease;
    gap: 0.5rem;
    white-space: nowrap;
}

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

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

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

.btn-success:hover {
    background-color: #059669;
}

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

.btn-danger:hover {
    background-color: #dc2626;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.025em;
}

.badge-success {
    background-color: #d1fae5;
    color: #065f46;
}

.badge-danger {
    background-color: #fee2e2;
    color: #991b1b;
}

.badge-warning {
    background-color: #fef3c7;
    color: #92400e;
}

.badge-info {
    background-color: #cffafe;
    color: #164e63;
}

.badge-primary {
    background-color: #dbeafe;
    color: #1e40af;
}

/* Alerts */
.alert {
    padding: 1rem 1.25rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border: 1px solid;
    font-size: 0.875rem;
}

.alert-success {
    background-color: #d1fae5;
    color: #065f46;
    border-color: #10b981;
}

.alert-danger {
    background-color: #fee2e2;
    color: #991b1b;
    border-color: #ef4444;
}

.alert-info {
    background-color: #dbeafe;
    color: #1e40af;
    border-color: var(--info-color);
}

.alert span {
    font-size: 1rem;
    font-weight: 600;
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--dark-text);
}

.form-control {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: all 0.15s;
    background-color: var(--white);
    color: var(--dark-text);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .sidebar {
        width: 240px;
    }
    
    .main-content {
        margin-left: 240px;
    }
    
    .content-area {
        padding: 1.5rem;
    }
}

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

    .sidebar-collapsed .sidebar {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .sidebar-toggle {
        display: block;
    }

    .content-area {
        padding: 1rem;
    }

    .topbar {
        padding: 1rem;
        flex-wrap: wrap;
    }
    
    .topbar-left {
        flex: 1;
        min-width: 0;
    }
    
    .topbar-right {
        width: 100%;
        margin-top: 0.5rem;
        justify-content: flex-end;
    }

    .page-title {
        font-size: 1.25rem;
    }
    
    /* Tables responsive */
    .table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .table thead {
        display: none;
    }
    
    .table tbody {
        display: block;
    }
    
    .table tbody tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid var(--border-color);
        border-radius: 0.5rem;
        padding: 0.75rem;
        background: var(--white);
    }
    
    .table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem 0;
        border: none;
        border-bottom: 1px solid var(--border-light);
        text-align: left;
    }
    
    .table tbody td:last-child {
        border-bottom: none;
    }
    
    .table tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-secondary);
        text-transform: uppercase;
        font-size: 0.75rem;
        margin-right: 1rem;
        flex-shrink: 0;
    }
    
    .table tbody td > * {
        flex: 1;
        text-align: right;
    }
    
    .table tbody td > *:first-child {
        text-align: left;
    }
    
    /* Empty state in tables */
    .table tbody tr td.empty-state {
        display: block;
        text-align: center;
        padding: 2rem 1rem;
    }
    
    .table tbody tr td.empty-state::before {
        display: none;
    }
    
    /* Cards responsive */
    .card {
        padding: 1.25rem;
    }
    
    .card h2 {
        font-size: 1.25rem;
    }
    
    /* Forms responsive */
    .form-group {
        margin-bottom: 1rem;
    }
    
    /* Form grids responsive */
    div[style*="grid-template-columns: 1fr 1fr 1fr"],
    div[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
    
    /* Buttons responsive */
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Grid layouts responsive */
    div[style*="grid-template-columns: 2fr 1fr"],
    div[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 480px) {
    .content-area {
        padding: 0.75rem;
    }
    
    .topbar {
        padding: 0.75rem;
    }
    
    .page-title {
        font-size: 1.125rem;
    }
    
    .card {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .card h2 {
        font-size: 1.125rem;
    }
    
    .welcome-text {
        font-size: 0.75rem;
    }
    
    /* Sidebar mobile */
    .sidebar {
        width: 100%;
        max-width: 320px;
    }
    
    /* Navigation items */
    .nav-item {
        padding: 0.625rem 1rem;
    }
    
    /* Pagination */
    .pagination {
        flex-wrap: wrap;
    }
    
    .pagination a,
    .pagination span {
        padding: 0.375rem 0.5rem;
        font-size: 0.75rem;
    }
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-header-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .page-header-actions {
        width: 100%;
    }
    
    .page-header-actions .btn {
        width: 100%;
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

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

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

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.pagination a,
.pagination span {
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.15s;
}

.pagination a {
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.pagination a:hover {
    background-color: var(--light-bg);
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.pagination .active span {
    background-color: var(--primary-color);
    color: white;
    border: 1px solid var(--primary-color);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state-text {
    font-size: 0.875rem;
}
