* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #ffffff;
    min-height: 100vh;
    margin: 0;
}

/* Sidebar Styles */
.sidebar {
    width: 260px;
    background: #2d3748;
    min-height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar.mobile-hidden {
    transform: translateX(-100%);
}

.sidebar-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px 20px;
    text-align: center;
}

.sidebar-header h1 {
    font-size: 1.3em;
    margin-bottom: 5px;
}

.sidebar-header p {
    font-size: 0.85em;
    opacity: 0.9;
    margin: 0;
}

nav {
    flex: 1;
    padding: 20px 0;
}

nav a {
    color: #cbd5e0;
    text-decoration: none;
    padding: 15px 25px;
    display: block;
    transition: all 0.3s;
    border-left: 4px solid transparent;
}

nav a:hover {
    background: #4a5568;
    color: white;
    border-left-color: #667eea;
}

nav a.active {
    background: #4a5568;
    color: white;
    border-left-color: #667eea;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid #4a5568;
    color: #cbd5e0;
}

.sidebar-footer .user-info {
    margin-bottom: 10px;
    font-size: 0.9em;
}

.sidebar-footer .user-name {
    font-weight: 600;
    color: white;
    display: block;
    margin-bottom: 5px;
}

.sidebar-footer .logout-btn {
    color: #f56565;
    text-decoration: none;
    font-size: 0.9em;
    display: inline-block;
    padding: 8px 15px;
    border: 1px solid #f56565;
    border-radius: 5px;
    transition: all 0.3s;
    width: 100%;
    text-align: center;
}

.sidebar-footer .logout-btn:hover {
    background: #f56565;
    color: white;
}

/* Mobile Toggle Button */
.mobile-toggle {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1001;
    background: #667eea;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

.sidebar-overlay.active {
    display: block;
}

/* Main Container */
.container-fluid {
    margin-left: 260px;
    width: calc(100% - 260px);
    min-height: 100vh;
    padding: 0;
}

header {
    background: #f7fafc;
    padding: 25px 30px;
    border-bottom: 2px solid #e2e8f0;
}

header h1 {
    font-size: 1.8em;
    margin-bottom: 5px;
    color: #2d3748;
}

header p {
    color: #718096;
    font-size: 0.95em;
    margin: 0;
}

.content, .dashboard {
    padding: 30px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.stat-card.warning {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.stat-icon {
    font-size: 3em;
}

.stat-info h3 {
    font-size: 2.5em;
    margin-bottom: 5px;
}

.stat-info p {
    opacity: 0.9;
    margin: 0;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.page-header h2 {
    color: #2d3748;
    margin: 0;
}

/* Table Styles */
.table-responsive {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

table thead {
    background: #2d3748;
    color: white;
}

table th, table td {
    padding: 15px;
    text-align: left;
}

table tbody tr {
    border-bottom: 1px solid #e2e8f0;
    transition: background 0.2s;
}

table tbody tr:hover {
    background: #f7fafc;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
}

.badge.active {
    background: #48bb78;
    color: white;
}

.badge.inactive {
    background: #cbd5e0;
    color: #2d3748;
}

.badge.expired {
    background: #f56565;
    color: white;
}

.badge.warning {
    background: #ed8936;
    color: white;
}

.badge.pending {
    background: #ecc94b;
    color: #2d3748;
}

.badge.open {
    background: #4299e1;
    color: white;
}

.badge.closed {
    background: #718096;
    color: white;
}

.badge.deleted {
    background: #e53e3e;
    color: white;
}

.badge.buy, .badge.buy_limit, .badge.buy_stop {
    background: #48bb78;
    color: white;
}

.badge.sell, .badge.sell_limit, .badge.sell_stop {
    background: #f56565;
    color: white;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #cbd5e0;
    color: #2d3748;
}

.btn-secondary:hover {
    background: #a0aec0;
}

.btn-small {
    padding: 5px 12px;
    font-size: 0.85em;
    margin: 0 2px;
}

.btn-danger {
    background: #f56565;
    color: white;
}

.btn-danger:hover {
    background: #e53e3e;
}

/* Forms */
.form-container {
    background: #f7fafc;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 25px;
    border: 2px solid #e2e8f0;
}

.form-container h3 {
    margin-bottom: 20px;
    color: #2d3748;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #4a5568;
    font-weight: 600;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 10px;
    border: 2px solid #e2e8f0;
    border-radius: 5px;
    font-size: 1em;
    transition: border 0.3s;
}

.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: #667eea;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

/* Alerts */
.alert {
    padding: 15px 20px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.alert.success {
    background: #c6f6d5;
    color: #22543d;
    border-left: 4px solid #48bb78;
}

.alert.error {
    background: #fed7d7;
    color: #742a2a;
    border-left: 4px solid #f56565;
}

.alert.alert-info {
    background: #e6f3ff;
    color: #004085;
    border-left: 4px solid #4299e1;
}

/* Recent Activity */
.recent-activity {
    margin-top: 30px;
}

.recent-activity h2 {
    color: #2d3748;
    margin-bottom: 20px;
}

/* Filter Section */
.filter-section {
    background: #f7fafc;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 25px;
}

.filter-form .form-row {
    display: flex;
    gap: 15px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.filter-form .form-group {
    flex: 1;
    margin-bottom: 0;
    min-width: 200px;
}

/* Profit Colors */
.profit-positive {
    color: #22543d;
    font-weight: 600;
}

.profit-negative {
    color: #742a2a;
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 992px) {
    .mobile-toggle {
        display: block;
    }
    
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.mobile-visible {
        transform: translateX(0);
    }
    
    .container-fluid {
        margin-left: 0;
        width: 100%;
    }
    
    header {
        padding-left: 70px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
    
    .stat-card {
        padding: 20px;
    }
    
    .stat-icon {
        font-size: 2.5em;
    }
    
    .stat-info h3 {
        font-size: 2em;
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    table {
        font-size: 0.85em;
    }
    
    table th, table td {
        padding: 10px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .filter-form .form-row {
        flex-direction: column;
    }
    
    .filter-form .form-group {
        width: 100%;
    }
    
    .content, .dashboard {
        padding: 15px;
    }
    
    header {
        padding: 20px 20px 20px 70px;
    }
    
    header h1 {
        font-size: 1.5em;
    }
}

@media (max-width: 576px) {
    .stat-card {
        flex-direction: column;
        text-align: center;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
    }
    
    table {
        font-size: 0.75em;
    }
    
    .btn-small {
        padding: 4px 8px;
        font-size: 0.75em;
    }
}

.content, .dashboard {
    padding: 30px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.stat-card.warning {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.stat-icon {
    font-size: 3em;
}

.stat-info h3 {
    font-size: 2.5em;
    margin-bottom: 5px;
}

.stat-info p {
    opacity: 0.9;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.page-header h2 {
    color: #2d3748;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

table thead {
    background: #2d3748;
    color: white;
}

table th, table td {
    padding: 15px;
    text-align: left;
}

table tbody tr {
    border-bottom: 1px solid #e2e8f0;
    transition: background 0.2s;
}

table tbody tr:hover {
    background: #f7fafc;
}

.badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
}

.badge.active {
    background: #48bb78;
    color: white;
}

.badge.inactive {
    background: #cbd5e0;
    color: #2d3748;
}

.badge.expired {
    background: #f56565;
    color: white;
}

.badge.warning {
    background: #ed8936;
    color: white;
}

.badge.pending {
    background: #ecc94b;
    color: #2d3748;
}

.badge.open {
    background: #4299e1;
    color: white;
}

.badge.closed {
    background: #718096;
    color: white;
}

.badge.deleted {
    background: #e53e3e;
    color: white;
}

.badge.buy, .badge.buy_limit, .badge.buy_stop {
    background: #48bb78;
    color: white;
}

.badge.sell, .badge.sell_limit, .badge.sell_stop {
    background: #f56565;
    color: white;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #cbd5e0;
    color: #2d3748;
}

.btn-secondary:hover {
    background: #a0aec0;
}

.btn-small {
    padding: 5px 12px;
    font-size: 0.85em;
    margin: 0 2px;
}

.btn-danger {
    background: #f56565;
    color: white;
}

.btn-danger:hover {
    background: #e53e3e;
}

.form-container {
    background: #f7fafc;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 25px;
    border: 2px solid #e2e8f0;
}

.form-container h3 {
    margin-bottom: 20px;
    color: #2d3748;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #4a5568;
    font-weight: 600;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 10px;
    border: 2px solid #e2e8f0;
    border-radius: 5px;
    font-size: 1em;
    transition: border 0.3s;
}

.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: #667eea;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.alert {
    padding: 15px 20px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.alert.success {
    background: #c6f6d5;
    color: #22543d;
    border-left: 4px solid #48bb78;
}

.alert.error {
    background: #fed7d7;
    color: #742a2a;
    border-left: 4px solid #f56565;
}

.recent-activity {
    margin-top: 30px;
}

.recent-activity h2 {
    color: #2d3748;
    margin-bottom: 20px;
}

.filter-section {
    background: #f7fafc;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 25px;
}

.filter-form .form-row {
    display: flex;
    gap: 15px;
    align-items: flex-end;
}

.filter-form .form-group {
    flex: 1;
    margin-bottom: 0;
}

.profit-positive {
    color: #22543d;
    font-weight: 600;
}

.profit-negative {
    color: #742a2a;
    font-weight: 600;
}

@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        position: relative;
        min-height: auto;
    }
    
    .container {
        margin-left: 0;
        width: 100%;
    }
    
    nav {
        padding: 10px 0;
    }
    
    nav a {
        padding: 12px 20px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .page-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    table {
        font-size: 0.85em;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
}
